227 Commits

Author SHA1 Message Date
Noel Grandin
ed76d1d350 loplugins:redundantcast teach it about c-style typedef casts
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c
Reviewed-on: https://gerrit.libreoffice.org/35558
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23 09:48:10 +00:00
Caolán McNamara
3f243471b5 ofz: segv on nullptr
Change-Id: I5ec64411b101972ddd150a782b845d4f790ea873
2017-03-19 21:34:58 +00:00
Tor Lillqvist
6de3688cc6 Drop :: prefix from std in c*/
Change-Id: If078cda95fa6ccd37270a5e9d81cfa0b84e71155
Reviewed-on: https://gerrit.libreoffice.org/34324
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-02-15 23:01:23 +00:00
Stephan Bergmann
20d648625b Some simplifications, using UNO_QUERY_THROW
Change-Id: I143ec0287421675fb13a03e8cf3c7054a17be37f
Reviewed-on: https://gerrit.libreoffice.org/34271
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-15 14:19:13 +00:00
Stephan Bergmann
6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Noel Grandin
8a16f665b1 makeAny->Any in canvas..configmgr
Change-Id: Id06812595f373cd0da8b421dbac34a60a266ae6e
Reviewed-on: https://gerrit.libreoffice.org/33869
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03 10:44:01 +00:00
Noel Grandin
c0f9bdd3e6 unnecessary use of OUStringBuffer in throwing exceptions
Change-Id: Iec1473264426f19c31e72260dfce9494389e474f
Reviewed-on: https://gerrit.libreoffice.org/33788
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02 07:48:21 +00:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Noel Grandin
3bb8bdb93f use rtl::Reference in OContainerListener
instead of manual acquire/release

Change-Id: I83e6229029e662073e2e01e98f4846fb0a0ed643
2017-01-20 08:51:08 +02:00
Huzaifa Iftikhar
5c983bc2ab tdf#70998 Change word "Graphic(s)" to "Image(s)"
There was an error in the previous patch inside the file embeddedobjectcontainer.cxx
This is fixed in this patch.

Change-Id: I01c9e254e58e1683a8e6e9a0bcff3c4663bf32e0
Reviewed-on: https://gerrit.libreoffice.org/32353
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-12-23 18:27:05 +00:00
Noel Grandin
d15b4e2045 teach sallogareas plugin to catch inconsistencies
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a
Reviewed-on: https://gerrit.libreoffice.org/32004
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-15 06:45:14 +00:00
Arnaud Versini
033ff2f9ad comphelper: cleanup class NameContainer.
Remove useless class NameContainerImpl.

Change-Id: I3066abea69ed68d597aeecdd6b3ec7264f7ebe9c
Reviewed-on: https://gerrit.libreoffice.org/31830
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-12 12:18:28 +00:00
Stephan Bergmann
0c59e2ddd6 loplugin:unnecessaryoverride (dtors) in comphelper
Change-Id: I13ebc4efa7f8bd0d3732ed65e397c710ae65d14e
2016-11-28 14:14:04 +01:00
Noel Grandin
c123c528bf loplugin:unnecessaryvirtual in comphelper..forms
Change-Id: Iabe292e68cb84b97f207061347ed6a30309dc9fd
Reviewed-on: https://gerrit.libreoffice.org/30679
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08 06:57:57 +00:00
Stephan Bergmann
a53808c0ed loplugin:dllprivate
Change-Id: I1fe70a39c50aba8b84c117653185fc37dbbfeab0
2016-09-13 22:26:22 +02:00
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Tor Lillqvist
714de95ec5 Remove nonsense comments: // bitfield
Surely the actual bitfield syntax is enough to tell the code reader
that it is a bitfield.

Change-Id: Ic9552e01b19c8b34b2a17db56b9ff63e7c7de926
2016-09-13 11:09:06 +03:00
Noel Grandin
127f70d66a new loplugin to check for static OUStrings
that are better declared as OUStringLiteral

Change-Id: Ifb5d9a12bb31a68641940bec16971a8181a46567
Reviewed-on: https://gerrit.libreoffice.org/27377
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-16 06:30:09 +00:00
nadith
efef273e2c tdf#100726: Improve readability of OUString concatenation
this bug fixed in the modules between canvas - cppu

Change-Id: I2022b022897dafde20251352376e3facdb9b8d75
Reviewed-on: https://gerrit.libreoffice.org/27663
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-01 06:12:30 +00:00
Noel Grandin
508c95f1b6 improve passstuffbyref return analysis
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c
Reviewed-on: https://gerrit.libreoffice.org/27317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-27 06:48:25 +00:00
Stephan Bergmann
a291c8fbaa loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I11d6467a35fb9e32cc0608549bd323b1f6683b9f
2016-07-07 18:59:55 +02:00
Noel Grandin
c144288abe loplugin:singlevalfields in comphelper
Change-Id: I22711d226a266dc00c32beff54398a55c4c9691a
Reviewed-on: https://gerrit.libreoffice.org/26599
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-24 08:41:01 +00:00
Stephan Bergmann
50a0473e82 Clean up uses of Any::getValue() in comphelper
Change-Id: I433cca20fb29c6b6ede934edcb2e200f15b060f2
2016-06-20 11:43:37 +02:00
Xisco Fauli
e88107c055 tdf#89329: use unique_ptr for pImpl in embeddedobjectcontainer
Change-Id: I679555e2eb51e2b9660bb035a08d8da8b1687cab
Reviewed-on: https://gerrit.libreoffice.org/25747
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 06:16:52 +00:00
Noel Grandin
74713b34a3 loplugin:unusedmethods
Change-Id: Ib36bc0e87d00abb638cbfec511cd13b6179eabda
Reviewed-on: https://gerrit.libreoffice.org/25431
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26 07:50:33 +00:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Noel Grandin
58a32075ca use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04 12:39:40 +02:00
Seraphime Kirkovski
7739bd5f54 Iteration must not start at the end
Change-Id: I2aebcc909aa9222fc1881e57bbc844025a154e84
Reviewed-on: https://gerrit.libreoffice.org/24497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-04-29 18:42:16 +00:00
Stephan Bergmann
f555ab4e96 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Idb7e5ff0c73bbc2c462b92cd96444eb5d2d4194b
2016-04-20 17:25:37 +02:00
Jochen Nitschke
4c7ec9f112 cleanup: remove unused com/sun/star/uno includes
Sequence.h(xx), Any.h(xx) and Type.h(xx)
and remove unused using-declarations from these files.

Add a few missing includes provided by them.

Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4
Reviewed-on: https://gerrit.libreoffice.org/23805
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12 06:38:26 +00:00
Noel Grandin
f3a43c723e clang-tidy performance-unnecessary-value-param in comphelper
Change-Id: Iff26c89ea6079e0f12691dbc04bb36f02b85c305
Reviewed-on: https://gerrit.libreoffice.org/23920
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11 06:20:32 +00:00
Jochen Nitschke
f781997ee1 tdf#94306 replace boost::noncopyable in c...
comphelper, connectivity and cppcanvas.

Replace with C++11 delete copy-constructur
and copy-assignment.
Removed unused boost/noncopyable.hpp includes from
some source files in cppcanvas.

Change-Id: I90780820e21fbfd291ac10c266e7d16616e3a81b
Reviewed-on: https://gerrit.libreoffice.org/23905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-08 09:58:36 +00:00
Noel Grandin
b9372f0e90 loplugin:constantparam in comphelper
Change-Id: I81e6af1ee869caa3b40d2d00604e8e22517d92d7
Reviewed-on: https://gerrit.libreoffice.org/23808
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-05 06:26:22 +00:00
Jochen Nitschke
f7a75a66fa cleanup: remove unused Reference.h(xx) includes
and unused using-declarations from Reference.h

Change-Id: I297a7ae6044fa329d245ecf08fd5c4cb930f5b19
Reviewed-on: https://gerrit.libreoffice.org/23735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-02 19:01:24 +00:00
Stephan Bergmann
20c6cb0e79 Avoid reserved identifiers
Change-Id: Iaf015fdcf9818655243e138c6c655c5f86511ac3
2016-03-10 18:32:02 +01:00
Noel Grandin
337f517af6 loplugin:unuseddefaultparams comphelper
Change-Id: I78280a13fc0d82fc87041b5dad0c3f2f7d462652
Reviewed-on: https://gerrit.libreoffice.org/22853
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-03 12:06:57 +00:00
Noel Grandin
a9a04f11a6 convert ComponentMethodGuard::MethodType to scoped enum
Change-Id: I1f1b4981c70c2b8ff8087a85f0af28b816b4654a
2016-02-24 11:48:38 +02:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
kripton
9ab1bdc217 tdf#74608 comphelper: Constructor feature for NamedPropertyValuesContainer
Change-Id: I63390eca5c887bfd84846655cef6339ba9785e24
Reviewed-on: https://gerrit.libreoffice.org/21888
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Matúš Kukan <matus@libreoffice.org>
2016-01-31 13:31:03 +00:00
kripton
2416a2965f tdf#74608 comphelper: Constructor feature for IndexedPropertyValuesContainer
Change-Id: I0e9ea9e4c750918b33040dad2279fe55facd4cab
Reviewed-on: https://gerrit.libreoffice.org/21858
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Matúš Kukan <matus@libreoffice.org>
2016-01-30 07:33:06 +00:00
Noel Grandin
752cd07d08 InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer.
It uses a std::vector instead of a Sequence for the mutable listener
list, which provides far better performance.

Switch all our internal use-sites to the new class.

Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
2016-01-25 08:52:03 +02:00
Michael Stahl
bd58340058 tdf#97108: SwDocShell of clipboard document has no base URL
... which triggers this assert; have to downgrade it to SAL_INFO.

The startsWith("0x") check is obsolete anyway since commit
0f02bc189b6e89ca2e62d4bd6a2f407a9fd4ec3b.

Change-Id: If47bc4496852ff85ba1bbeb4205ffc16be0782de
2016-01-13 23:42:33 +01:00
Caolán McNamara
d9b589379c crashtesting: fdo85994-1.doc assert on reexport to doc
try setting DefaultParentBaseURL based on the parent BaseURL
for objects created this way

Change-Id: I1a660ff6e4874321e0308d556c7ce0e10a2605fe
2016-01-09 15:17:08 +00:00
Caolán McNamara
a4764cfa80 crashtesting: fdo73974-1.doc assert on reexport to doc
try setting DefaultParentBaseURL based on the parent BaseURL
for objects created this way

Change-Id: Idfc44d90e4f73f23976e8648c504786955b4fce6
2015-12-24 21:24:13 +00:00
Michael Stahl
e4a06fc983 sw: set a BaseURL when copying embedded objects
Turns out that SfxObjectShell::CreateShellID() will produce the
SfxMedium's base URL if it exists, so
EmbeddedObjectContainer::CopyAndGetEmbeddedObject() already has
parameters, sw just needs to set them.

Change-Id: I36cedfde4e7c2e25c43c66a30d8ca572f099ad69
2015-12-15 17:44:37 +01:00
Michael Stahl
b0fc09daf1 fix missing BaseURL when loading embedded objects
When the object is edited in the UI, the m_xClient is set to a
SfxInPlaceClient and the DocumentBaseURL is retrieved from it.  But if
the object is not edited, it will be loaded during export via the API
and without a m_xClient; in this case the DocumentBaseURL must have been
set previously to be available during import.

There appears to be no way to get the URL of the document via the API
while it is being imported; SfxBaseModel's m_sURL is unfortunately only
initialized from SfxObjectShell::FinishedLoading().

During ODF import, the SvXMLEmbeddedObjectHelper creates the
embedded object, so let's make it pass in the parent's BaseURL.

The "DefaultParentBaseURL" parameter already exists but was unused
previously.

Change-Id: I3d1ed29b3a2c0e77ec606a1d09f7bc07e7860733
2015-12-15 17:44:36 +01:00
Noel Grandin
048f396084 loplugin:unusedfields in comphelper
Change-Id: I2e410c973af2eb443fee8fe787920bf6bc205d95
2015-11-20 12:43:56 +02:00
Noel Grandin
fe3fd05966 add mapKeysToSequence/mapValuesToSequence methods to comphelper
and use them

Change-Id: If4dc9df63db37185228aeaaab2979498d61304ec
Reviewed-on: https://gerrit.libreoffice.org/20055
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-20 08:14:13 +00:00
Noel Grandin
8e234c5b7d use initialiser syntax for Sequence<OUString>
replaced using the script:

git grep -lP 'Sequence.*OUString.*\(1\)'
  | xargs perl -0777 -pi
    -e "s/Sequence< OUString > (\w+)\(1\);
.*\[0\] = (\S+);/Sequence< OUString > \1 { \2 };/g"

Change-Id: I23688a91562051a8eed11fc2a85599545c285c34
Reviewed-on: https://gerrit.libreoffice.org/19967
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-15 10:13:08 +00:00
Stephan Bergmann
fb4ce444c2 loplugin:nullptr (automatic rewrite)
Change-Id: Ibd0e6ae5e3243464b2484a009f2b4781bdaac471
2015-11-10 10:31:19 +01:00