Commit Graph

1122 Commits

Author SHA1 Message Date
0a48e0fb4e loplugin:simplifybool
Change-Id: Ia4177cf1a4b0c06ef614b54298fd6f9224956afc
2015-04-24 12:36:25 +02:00
2240118177 Improved loplugin:literaltoboolconversion looking into cond. exprs.
...automatic rewriter fixes

Change-Id: I6b04ca80f08f8a71ff94e309fd52f44d736751ee
2015-04-23 18:39:07 +02:00
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
a0f2bb7042 unnecessary cast
Change-Id: I7c040b2539b9f7f923620a02d0a27e8e000fee4a
2015-04-12 21:17:58 +01:00
35163715ea loplugin:staticmethods
Change-Id: Ie348778ea666c24e95e048386547f301083a0017
2015-04-09 10:13:18 +02:00
9222f5d065 A UNO Any can't contain an Any
...and css::uno::makeAny<css::uno::Any>() was never meant to be used.  Introduce
css::uno::toAny for the (template-code) cases that shall return an Any for both
Any and non-Any inputs.

Change-Id: Ifa977d73f1da71b2fedde7e8140b19497c4a0257
2015-04-08 17:45:08 +02:00
c9c991a9af Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I6979d9af3a97918593f0596df17c096bd3f4c4ad
2015-03-31 13:15:43 +02:00
b857703113 const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I313d61fc6e7be3a5513da83d3de9202237306739
2015-03-26 15:33:33 +01:00
ca5ff45597 tdf#90010 Partially revert "package: Do not bother with deflating jpeg images"
This reverts commit 0843ade74e5848c0babad509b10c334b01847be2 for the case, when
the document is protected by password. Would be nice to fix properly later.

Change-Id: If159639d6f74de4e106e9dad382faac9d5de4a09
2015-03-25 22:32:40 +01:00
858e455634 loplugin:constantfunction: various
Change-Id: I6eddda9f4b31c7ce413c328b6a857a81bd222eed
2015-03-24 10:51:22 +02:00
0777231112 V803 decreased performance postfix increment
These are pretty silly anyway, but apparently it complains even about
integer variables which make this rather a waste of time.

Change-Id: I15e847d33d5decd2adcab04e4f1567d3997d28a2
2015-03-13 16:23:26 +01:00
ad62a2e1bd package: PVS-Studio V595 'm_pData' pointer could be null
... so convert the last member of StorInternalData_Impl that needs
manual cleanup to rtl::Reference

Change-Id: Ie1549c1f52d50dc3c63715176c02821b63c7cab1
2015-03-12 20:22:14 +01:00
44177f0209 package: convert StorInternalData_Impl member to std::unique_ptr
Change-Id: If523dbd4596f4023bda6509c6dc09b8ab3d74874
2015-03-12 20:22:14 +01:00
c3e45f10e0 package: convert OStorage::m_pData to std::unique_ptr
Change-Id: I875432aeb98072882df1f228d9fcf43c6027e8d5
2015-03-12 20:22:13 +01:00
e43d5f26de package: move WSInternalData_Impl out of header
Change-Id: Ie7c01b37e9a4eb2221d4b40fc6b13672d9b3a684
2015-03-12 20:22:12 +01:00
9ad17c2536 package: convert OWriteStream::m_pData to std::unique_ptr
Change-Id: I9e72325679b2758cd4297d2693cf49fd533f8baa
2015-03-12 20:22:12 +01:00
2877e5a9c7 package: PVS-Studio V595 'm_pData' pointer could be null
... just convert its explicitly deleted member to unique_ptr.

Change-Id: I826257ff512632a2aedd53a7ce5e4bedf49c3cfe
2015-03-12 20:22:11 +01:00
252a73ff22 redundant check
Change-Id: Id6b72a1a3133e47a07ee274f4082dde0e7032894
2015-03-11 14:08:36 +00:00
d22519f62b V801: Decreased performance
Change-Id: Id8cd45d2844c121f63684734ab3546c24a1aab32
2015-03-09 22:04:31 +00:00
4f7a1f5b94 fdo#75757: Remove inheritance from std::vector
Deprecated comphelper/sequenceasvector.hxx.

Rewritten code using it. Using instead the functions containerToSequence and
sequenceToContainer, found in include/comphelper/sequence.hxx.

One class that inherits from it (in framework/inc/stdtypes.h), and
the code using that has been left.

Signed-off-by: Michael Stahl <mstahl@redhat.com>

Conflicts:
	writerfilter/source/dmapper/DomainMapper.cxx
	writerfilter/source/dmapper/TblStylePrHandler.hxx
	writerfilter/source/dmapper/WrapPolygonHandler.hxx

Change-Id: Ice61c94ffb052e389281aebb7cdf185134221061
2015-02-06 23:06:58 +01:00
598d8194b0 Visible function type RTTI for Clang -fsanitize=function
...by adding some further SAL_DLLPUBLIC_RTTI type annotations (cf.
b4f6b26b5a1a78fecfa95ec2eb7ac8b80495d8aa "SAL_DLLPUBLIC_RTTI for proper RTTI
visibility for LLVM") and by making sure relevant function types do not use
incomplete types in their parameter and return types (which would make the RTTI
hidden).

Change-Id: Id7aadcbc0704b9759968ae36266fc9ce11a2e340
2015-01-26 15:17:28 +01:00
00173d8c3a Some more loplugin:cstylecast: package
Change-Id: Icf7351082cf63aeb70ec47a8562a89d452ae9d8e
2015-01-20 09:06:50 +01:00
238ce4af68 remove unnecessary casts
leftovers from conversion of SvStream operator>> to Write methods

Change-Id: Id1d1e60ae42afb689910845a3c6ec75e3388fb56
2015-01-15 13:32:15 +02:00
7da92fdcb0 cppcheck: Possible inefficient checking for <var> emptiness
Change-Id: I6ca0e477a4429e762c48c721951b9876db3a5c6c
2015-01-04 19:11:13 +01:00
3a2b1af87d Fix simple typos.
Change-Id: I1fdbe47ed7a6e05d2cf20f4c296bffad4bbc6599
Reviewed-on: https://gerrit.libreoffice.org/13719
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-01-02 20:23:51 +00:00
5484475fc1 include algorithm
Change-Id: I55abf17a1da2616ca2b1303747ca8cc7e402634e
2015-01-02 17:03:55 +00:00
65e7851444 include algorithm
Change-Id: Icd44b7c128bf72236206d7c753a9ef986f50dad2
2015-01-02 16:44:34 +00:00
fd1372ba8b boost::unordered_map->std::unordered_map
you can get debug stl this way

Change-Id: Ia70a3e7c7c452390e8bee34975d296c9318e4a19
2015-01-02 16:14:36 +00:00
d41bc0f7b3 fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.

Change-Id: Idcedd908c653d5a5700884f233ad134dde8be018
Reviewed-on: https://gerrit.libreoffice.org/13540
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-19 11:00:32 +00:00
180f0791da comphelper: Use appropriate OUString functions on string constants
Change-Id: Id1d5c3cf2f76dbb33606cec1c0f17d4a1f282247
2014-12-18 12:34:40 +01:00
3fcd2ccb44 fdo#87210: Re-enable parallel deflate, which was not the root cause.
With f92183833fa569006602ac7e93c906d2094e0d4d, export no longer crashes,
and there is no reason to leave this piece disabled any more.  Let's
re-enable this.

Change-Id: Ibeca8869f152cbcd80f1dcb55f8199110125741d
2014-12-15 15:13:44 -05:00
ca8e26aefd package: Use appropriate OUString functions on string constants
Change-Id: I8d01dbad13cf26473c03d0c3dd01ae7baca991fb
2014-12-15 10:13:40 +01:00
f92183833f package: Better to use temporary files for huge memory zip streams
ZipPackageBuffer was holding the whole compressed data stream in one
uno::Sequence which seems to be a lot for big documents in some cases.

Change-Id: Ib10d00ac54df9674231f4bbf047fab7e9b0a7d45
2014-12-14 00:21:20 +01:00
43eca2d9f8 package: Create memory buffer only when we need it - if we use parallelism
Otherwise write directly to the resulting zip file.

Change-Id: I75097969f0cccf0b45da591c71221e5ae18668cb
2014-12-14 00:21:18 +01:00
2c2e80da68 callcatcher: remove newly unused code
and rework reads to just return the read value

Change-Id: I5d2f01064465c65859ec4ba031ec9dfa16403487
2014-12-12 11:49:03 +00:00
70d4989c27 remove operator>> methods
in favour of ReadXXX methods.

Change-Id: I242b92da7dbcafe22aef69dc7348ac58dadc9241
2014-12-11 14:57:34 +02:00
e0425f9493 Globally disable threading for these for now.
It doesn't win us much performance-wise (as it turned out), and causes
weird crashers with large documents.

Change-Id: I0566ce850b8f6656e6f9821c653b7a825a7874a3
2014-12-10 10:55:23 -05:00
0674dd36b6 coverity#1242675 Untrusted value as argument
Change-Id: Id1f1ff8de23b041742d2a8286b78312529f6566e
2014-11-21 11:55:12 +00:00
319524767e coverity#1242675 Untrusted value as argument
Change-Id: I1d8f32095f297919dc3ccab51093295f8c31707d
2014-11-19 11:01:07 +00:00
15b4ab8d19 cppuhelper: clean up public headers with include-what-you-use
Change-Id: I41ba46831f24b2960a1fe982b74a2b623e682e0b
2014-11-18 18:51:49 +01:00
6a0fe37dec sal: clean up public headers with include-what-you-use
Sadly cannot forward declare "struct {...} TimeValue;".

rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h
was painful enough for now...

Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-11-17 11:06:53 +01:00
0843ade74e package: Do not bother with deflating jpeg images
It takes a lot of time and we can save ~1% of size if at all. Rather
store them uncompressed in the zip file.
With png, we can save a bit more, although it's still only about 4% - 8%?

Change-Id: I43a3e3812882e4ce85e7af9d0aaab454d98c4860
2014-11-17 10:49:24 +01:00
d09b6209f1 package: Do not deflate small streams in a thread
Change-Id: Iae804a34f344aa793a6d5c13315f7bc1eb64c0a2
2014-11-17 10:49:24 +01:00
7088166a67 Simplify input parameters to just take the sequence
Change-Id: Ic2538ca8b0f7261064e1dfbf3884dd452003c797
2014-11-17 10:49:23 +01:00
a42aa52acb package: Add possibility to disable deflating in a thread
Change-Id: I4d98b6f8b3315b731206700eb65f08463299dda3
2014-11-17 10:49:23 +01:00
fbf714b456 package: Finally implement parallel zip entries deflating
For that:
1, create ZipPackageStream::successfullyWritten to be called after
the content is written
2, Do not take mutex when reading from WrapStreamForShare - threads should
be using different streams anyway, but there is only one common mutex. :-/

Change-Id: I90303e49206b19454dd4141e24cc8be29c433045
2014-11-17 10:49:23 +01:00
db5552631b package: Call writeLOC always after putNextEntry explicitly
Preparation step to parallel deflating.
Rename putNextEntry to setEntry and make it a static function.
We need to call setEntry before starting thread but writeLOC after.

Change-Id: I99a9ffa7dc4c18b47c621847b48bf8469bfb789a
2014-11-17 10:49:22 +01:00
30f80f12fb package: Do not use hacky bit 1<<4 in ZipEntry::nFlag
Change-Id: I504f5c0c9aa9b655ffb53d9820a33677dad6aa08
2014-11-17 10:49:22 +01:00
ef8e7eabe1 There is no XZipOutputEntry interface
Change-Id: Ib8fa3351ba25416a13d6c8bf63bd5fc8e43703c5
2014-11-17 10:49:22 +01:00
3e3b8483d7 package: Use memory stream for compressing zip entries
Change-Id: Ibf81dc3cd8a9a9da3dfd6ee6e587a522c4d56a44
2014-11-17 10:49:21 +01:00