Commit Graph

462 Commits

Author SHA1 Message Date
af5ebbf783 create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution.  (Unfortunately MSVC 2012
does not support explicit conversion operators.  Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)

Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-13 17:45:57 +02:00
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
0745982dc5 loplugin: cstylecast
Change-Id: I88a106081b7413bff6313d1e07f53e39d8350002
2014-10-06 07:52:55 +02:00
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
98ef8894dd convert RID_PDF_WARNPDFAPASSWORD to MessageDialog + string
Change-Id: I40da6ede705bf8e56adee7a45c56cb60cf42d166
2014-08-25 16:45:29 +01:00
bb761be472 Change SfxTabPage ctor SfxItemSet param from ref to pointer
...and also corresponding param of CreateTabPage function type and corresponding
Craete functions.  There were some call sites that passed undefined "null
pointer references" and SfxTabPage internally uses a pointer member pSet that is
checked for null anyway.

Change-Id: I4eb3636155eac46c9c9d26e6e6e842e85d7e95af
2014-06-11 14:39:04 +02:00
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
3db8d606d5 hrc and src files: squeeze multiple newlines
for i in `find . -name *.src -or -name *.hrc`; do FILE=$(cat -s "$i"); echo "$FILE" > "$i"; done

Change-Id: I2bac5ad3e1eb3c566e5c867ccf45893a19e1561e
2014-05-19 20:04:22 +02:00
0283251f58 coverity#1210181 Uninitialized scalar field
Change-Id: I30c9449901cd96b74141dd511cabff3c5b9201bc
2014-04-29 11:40:27 +01:00
d83dfeb5e5 filter: sal_Bool->bool
Change-Id: Icf20f23cb46ad3cb147d8c6a743f1d25a23fbca5
2014-04-22 09:56:06 +02:00
c5265586e6 fdo#74654 fix typo: printnone -> printhigh
Change-Id: I286dedfb6dfd8d9c119bf1b6ac777a2a08f22d7e
2014-04-15 16:49:49 +02:00
4e939b9599 Avoid possible memory leaks in case of exceptions
Change-Id: I4f1e00dd275976cdba8490f35ccbb491914829b7
2014-04-12 01:34:45 +09:00
d913a5a9df untangle the bFmt == 2 hack
Firstly, IsFormat is unused so there's no "escape" of
bFmt back into the outside world.

Then bFmt has two purposes.

Purpose 1 is 'not be a format dialog, be a format dialog, be a format dialog but hide standard button'

so, lets just add an explicit "Hide standard button" method and call
it in the (apparently) one place where it's necessary.

Purpose 2 is to flag that "BaseFmtHdl" was called from clicking
the "Standard" button at which point its set to 2.

SfxTabDialog::Init_Impl had...

"
  // bFmt = temporary Flag passed on in the Constructor(),
  // if bFmt == 2, then also sal_True,
  // additional suppression of the standard button,
  // after the Initializing set to sal_True again
  if ( bFmtFlag != 2 )
      m_pBaseFmtBtn->Show();
  else
      bFmtFlag = sal_True;
"

but the variable acted on is bFmtFlag a copy of bFmt, and is never read again
after that line, so setting it to sal_True is meaningless. The comment suggests
that the intent is to reset bFmt to true if it was 2 during initialization,
which fits with the later use of bFmt == 2 to indicate that the standard button was
clicked, i.e. reset bFmt back to its standard value.

So make bFmt a simple toggle of dialog as a format dialog or not, add a way
to remove the standard button and add a second variable to indicate the standard
button got pressed.

Change-Id: I98a441f5f314845abe243e05b6d92fd71d7b0b04
2014-04-07 13:47:02 +01:00
362d4f0cd4 Explicitly mark overriding destructors as "virtual"
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."

Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +02:00
567ef6d578 Second batch of adding SAL_OVERRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: Ie656f9d653fc716f72ac175925272696d509038f
2014-03-27 18:12:18 +01:00
3f50dfa1aa coverity#736776 Dereference before null check
Change-Id: Ifd666fe1b71087ab8c5a20f1bd002277fe8f05da
2014-03-22 16:00:46 +00:00
f35b1958e3 convert pdf warn dialog to .ui
Change-Id: I379c7f06ae87bee5571c1f2ef5053b3b863d6e61
2014-03-14 11:47:08 +00:00
ee2befb862 filter: simplify deprecated XTypeProvider.getImplementationId
Change-Id: I56739de05cacebe93983bd27fcaa1ec7f27b5fa8
2014-03-10 17:39:55 +01:00
b6588bd7c8 Reduce image resolution by default in PDF Export
PDF Files can quickly become very big when a user inserts some images. Most users don't know how to reduce the size of their images.
This patch enables the resolution reduction for PDF Export to 300DPI by default.

Change-Id: I3ce5191de35561b59169e52e2e2efbc4a343f025
Reviewed-on: https://gerrit.libreoffice.org/8422
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2014-03-10 05:58:12 -05:00
aeaded675c Remove visual noise from filter
Change-Id: Ieab1d12204bcf917b2e1bf74f3145fc96d7b207c
Reviewed-on: https://gerrit.libreoffice.org/8261
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2014-02-27 06:10:36 -06:00
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
e8f8f24c84 vcl: sal_Bool -> bool
Change-Id: I2a3e3d3e3266ea0f0fafdd91362076a4aa160f0e
2014-02-21 12:53:51 +01:00
a18a1a4545 Remove vcl/settings.hxx from vcl/svapp.hxx and vcl/outdev.hxx
Added vcl/settings.hxx to all cxx files which require it.
This helps to speed up compilation after changes to the settings.

Conflicts:
	sc/source/ui/dbgui/pvlaydlg.cxx

Change-Id: I211a0735c47f72d6879f6f15339355abfe0e3cf4
Reviewed-on: https://gerrit.libreoffice.org/7933
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-20 16:22:17 +00:00
d22d2fb1de cid#736777 dereference before null check
Change-Id: I40faf8a98d6e71361f952c61a8c8d6b5e25c41be
2014-02-17 14:04:33 +02:00
29e1d1988e cid#736775 dereference before null check
Change-Id: I3539146b3ab126c939e5805e5bb4e013d9f93857
2014-02-17 14:04:27 +02:00
3d96b1e0ff coverity#737139 Uncaught exception
Change-Id: I75fc43e365afa44b54c27aeb8887f9e37954f03b
2014-02-13 14:56:20 +00:00
f0dc6cda75 bool improvements
Change-Id: Ib0f16e57ce84a40412fd95bffd4f41a113810a96
2014-01-28 20:24:40 +01:00
d803483f6a convert more SvStream::operator<< calls
.. to more explicit SvStream::Write* calls
This was done using another run of the clang rewriter, and then
a lot of hand tweaking to fix all the places where the rewriter
did not play nice with various macros.

Change-Id: I7bcab93851c8dfb59cde6bc76290c6484d88fb18
Reviewed-on: https://gerrit.libreoffice.org/7494
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-01-22 22:00:39 +00:00
89cd19fdcb bool improvements
Change-Id: I65ad52e4dee12a94d48ff0f5858e29df7f8d9721
2014-01-22 11:39:20 +01:00
eeeefd6fd8 fdo#54938: Convert filter to cppu::supportsService
final part

Change-Id: If9387b4f7aa8ca694092f51eabeac096c71347eb
2014-01-16 10:26:04 +01:00
9ed364774c Adapt all (non-extension, SharedLibrary) .components to environment="..."
Change-Id: I56f38bd786f3a026cb2908f28540dc9c4003af83
2013-12-17 11:06:00 +01:00
7722a5906d fdo#68099 Move pdf viewer call to GUI related code
This change fixes two bugs:
1) In it's old location at PDFFilter::implExport, the pdf viewer is called
*before* the final file is actually written. It causes a problem under
Windows, because we use ShellExecute function which fails if the file
doesn't exist. Calling a function blocks execution, so we have no chance
to write the file before that function fails. (fdo#68099)
2) Being a part of the saving/filter code means that the pdf viewer will
open even when converting to a pdf in headless mode. It's definitely not
something that we want to happen.

Change-Id: I1a6f70ec76100ac9e008869aa57ad738ced3ab6c
Reviewed-on: https://gerrit.libreoffice.org/6565
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-11-04 07:52:14 -06:00
3a6148e811 fixincludeguards.sh: filter
Change-Id: Ifdb49a0fd5f658056b14b7c2f4e323dd38b412e6
2013-10-23 23:22:33 +02:00
a7724966ab Bin comments that claim to say why some header is included
They are practically always useless, often misleading or obsolete.

Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-22 16:56:28 +03:00
6fbf0762ab WaE: private field 'nWidth' is not used
Change-Id: I855a92d55646eff1c79634a839726564bf973744
2013-09-17 12:45:01 +03:00
ed53efd9db convert remains of filter module from String to OUString
Change-Id: I87b1d2d944ba2b6e2e42adb2c948fff85ec021e1
2013-09-17 09:05:13 +02:00
db4fb3b716 remove dead code
Change-Id: Ibaa30ae983ddff4d7c9c1e9f95abf7b44124d07d
2013-09-17 09:04:55 +02:00
6b20520517 Resolves: fdo#33983 use 'Slides' instead of 'Pages' for impress pdf export
Change-Id: Id380514f8f74783a0a0baf61cc9358f2b1bcbc47
2013-08-15 17:34:45 +01:00
0c68a3867f convert pdf signing page to .ui format
Change-Id: I037036e410a6f9d7da7bc34721c105e81470d5d9
2013-07-08 14:54:07 +01:00
28d6687131 convert pdf options dialog to .ui format
Change-Id: I7c186ea77bbadd20ac881dcb0aa2cf7db525dc1e
2013-07-08 13:10:03 +01:00
aa93c3c9a0 convert pdf export general page to .ui
Change-Id: I94d86f9807e67bd4f352321fde1c83913b5a4fed
2013-07-08 10:40:42 +01:00
1e467c8b38 convert pdf view page to .ui format
Change-Id: I738dd72f66658f60025152c9c3db765dbcb981ac
2013-07-04 10:23:03 +01:00
937abc32bf stray debugging
Change-Id: Ie9408fecfdb9216a6a80d92a2c215ebf25997e9f
2013-06-28 13:46:18 +01:00
396ab1eba7 convert pdf security page to .ui
Change-Id: Ie785f4b112b8992707f886720d92bd34d0823f39
2013-06-28 11:50:15 +01:00
feaebe7f93 Always embed 14 standard Postscript fonts in PDF
Ealier version of PDF standard allowed for not embedding the so called
standard PostScript fonts in the PDF files and all PDF readers had to
include them or a "suitable substitute". This behaviour had many issues
and is deprecated for 10 years now. The current version of PDF spec
says:

  Beginning with PDF 1.5, the special treatment given to the standard 14
  fonts is deprecated. Conforming writers should represent all fonts
  using a complete font descriptor. For backwards capability, conforming
  readers shall still provide the special treatment identified for the
  standard 14 fonts.

This commits removes support for not embedding these fonts, and the, now
redundant, option to embed them.

This has the side effect of elimanating the cause of fdo#66108 and
fdo#41547.

Change-Id: I4f1fc4137a2de7baeef9e504f2e4f84fbec0a491
Reviewed-on: https://gerrit.libreoffice.org/4495
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-06-27 19:03:31 +00:00
dbf1360e9f Convert to .ui pdf userinterface tab page
Change-Id: I9203a63b2d6d1ab14ebee17611a78221755af082
2013-06-21 15:54:12 +02:00
c5debaa9c4 convert pdf links tab page to .ui
Change-Id: I305021366a2670a582f00433be2a6e26d745f587
2013-06-08 11:51:09 +02:00
73e686725e fdo#46808, Convert some more XMultiServiceFactory
Change-Id: Ib96976e0a40c025d1b6408aeadfc70d7885c11d4
2013-06-05 14:48:20 +02:00
c0654ce022 fdo#46808, Convert XMultiServiceFactory in filter module
Change-Id: I9dcddba4f5a8a7adeddc31b5df014b0174b9745d
2013-06-05 08:13:22 +02:00