481 Commits

Author SHA1 Message Date
Noel Grandin
e48f0084df remove unused AccessibilityChanged from SfxHintId enum
Change-Id: Ic2d413002466e92d38a7a918b3f7e04d3c9eebf2
2017-02-15 08:33:37 +02:00
Noel Grandin
b8d977c017 convert CharCompressType to scoped enum
and move it to svl, where it belongs

Change-Id: Ic4d846419dfe2dd85de5ade8ed1a041867bbf1dc
2017-02-13 08:17:42 +02:00
Jochen Nitschke
d584e2dcc0 simplify SfxWhichIter
only one of 164 calls used the ctor with a restricting range.
handle this special case.
remove nFrom and nTo members.
use operator[] on range pointer to highlight we access lower [0]
and upper [1] range bound.
remove dtor.

Change-Id: I87b28502515e45bb190425eb88aa187ac0b5b2d2
Reviewed-on: https://gerrit.libreoffice.org/33911
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-02-04 11:37:42 +00:00
Noel Grandin
1c3e84d819 teach lolugin:stringconstant about calling constructors
so we can remove unnecessary calls to the OUString(literal) constructor
when calling constructors like this:
   Foo(OUString("xxx"), 1)

Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36
Reviewed-on: https://gerrit.libreoffice.org/33698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31 08:56:20 +00:00
Jochen Nitschke
70dee11c2e use a define for invalid SfxPoolItem
and use helper function IsInvalidItem() more

Change-Id: Ifd651a336a7bd4ef4f945219d765afb827465438
Reviewed-on: https://gerrit.libreoffice.org/33611
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-01-27 15:58:28 +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
58868eb9ed loplugin: unnecessary destructor svl..svtools
Change-Id: Ie96dda7194c83ba88693f8c91899c732d704a4bd
Reviewed-on: https://gerrit.libreoffice.org/33515
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-25 11:29:08 +00:00
Noel Grandin
96def52140 move GetPosByValue from SfxEnumItemInterface to SfxAllEnumItem
which is it's only use-site

Change-Id: I35943282ad4f5fd5ad297831d63e8abee9a2ddff
2017-01-25 09:10:13 +02:00
Noel Grandin
00aa9f622c Revert "used std::map in SfxItemSet"
This reverts commit 2757ee9fe610e253e4ccc37423fa420004d0f388.

Besides causing a performance regression, I now notice that
there is code in SW that relies on iterating over two different
SfxItemSet's in parallel, and assumes that missing items are
returned as nullptr, which is not the case for my std::map based
change.

Change-Id: I2b1110350fe4c4b74e5508558e9661ef1e1a103e
2017-01-23 13:19:56 +02:00
Stephan Bergmann
ebcc8707a0 New loplugin:dynexcspec: Add @throws documentation, svl
Change-Id: Idbe6378e2c7da51a2f08de5173bc58733eceb95f
2017-01-19 18:03:13 +01:00
Noel Grandin
afaa10da25 make SfxItemSet with SAL_WARN_UNUSED
Change-Id: Ia74ca329d8438f614169031acfbe0406faf7c281
Reviewed-on: https://gerrit.libreoffice.org/33268
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19 05:41:29 +00:00
Noel Grandin
352e036ada new loplugin: useuniqueptr: svl..svtools
Change-Id: Ia4d5b37ee3cf67318e3cc01525e4b733af60d038
Reviewed-on: https://gerrit.libreoffice.org/33251
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-18 09:26:26 +00:00
Noel Grandin
2757ee9fe6 used std::map in SfxItemSet
instead of naked array

SfxItemIter ended up needing to take copies of stuff because various
code likes to iterate over the items and delete items inside the loop.

The gdb pretty printer is no longer quite as pretty as it was before,
but it still prints useful info.

Change-Id: I59b07ea42f6b1c74798a15402970b9dbd8233dbe
2017-01-17 10:07:10 +02:00
Noel Grandin
feade09e18 SfxUShortRangesItem is unused
Change-Id: I6f88f37eca2bdd6b40c8713f1b2e35ad0be94ab0
2017-01-11 10:11:02 +02:00
Noel Grandin
014b9ac2e4 loplugin:unusedmethods
Change-Id: Ibe11923601760ded53a277c48631e4893606b2d6
Reviewed-on: https://gerrit.libreoffice.org/32875
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-10 06:29:10 +00:00
Caolán McNamara
f97cd16ea4 coverity#1371220 Missing move assignment operator
Change-Id: Ie2947ea621da7ffc6c9530f007e1acdd4efb50cb
Reviewed-on: https://gerrit.libreoffice.org/32650
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-01-02 18:23:50 +00:00
Caolán McNamara
d09888b835 use std::unique_ptr
Change-Id: I1c4f81e0ba0529b9e365c6ddb3d77a8a6a6d5741
Reviewed-on: https://gerrit.libreoffice.org/32649
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-01-02 16:35:58 +00:00
Noel Grandin
833e6ca9d2 use std::vector instead of naked array in SfxItemPool
Change-Id: I2d4ac010ff5818e673567cee05700872588918e4
Reviewed-on: https://gerrit.libreoffice.org/32384
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-12-26 18:35:59 +00:00
Noel Grandin
a66731982e convert SFX_HINT to scoped enum
Notes

(*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a
dynamic_cast check.

(*) In SC, removed the hint id field from ScIndexHint, no point in
storing the hint id twice

(*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no
point in storing two different hint ids

(*) In some cases, multiple #define's used to map to the same SFX_HINT
value (notably the SFX_HINT_USER* values). I made all of those separate
values.

Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5
Reviewed-on: https://gerrit.libreoffice.org/31751
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-08 12:35:09 +00:00
Noel Grandin
50151db9f7 convert FSysStyle to o3tl::typed_flags
Change-Id: I58a63a0e6f619442f21827064644ecd8ca57b8ff
2016-12-05 12:49:02 +02:00
Noel Grandin
bfde4866e0 convert DecodeMechanism to scoped enum
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-12-05 12:49:02 +02:00
Noel Grandin
803215142e convert INetURLObject::EncodeMechanism to scoped enum
Change-Id: I50ea17c7779c7b5cacddf548f1773fd7d6c8bade
2016-12-05 12:49:02 +02:00
Jochen Nitschke
61f61e7723 don't hold vector as pointer here ...
and make impl types private

Change-Id: I7ead64bac38da3d813e0b47fa124970937c36617
Reviewed-on: https://gerrit.libreoffice.org/31438
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-11-30 21:46:11 +00:00
Noel Grandin
04a84913ea use o3tl::typed_flags in ConfigurationListener::ConfigurationChanged
Change-Id: I0ad7c02953aa53168dc242f1f374ab871728c84e
2016-11-24 11:27:51 +02:00
Noel Grandin
1617eef124 loplugin:countusersofdefaultparams in include/sot..svl
Change-Id: Idb022a4a6fb950f1b259abbba57daed9401732d9
Reviewed-on: https://gerrit.libreoffice.org/31038
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-21 12:09:24 +00:00
Noel Grandin
bb674aa550 loplugin:unusedfields
Change-Id: Id2dbbf384637223db3d334d95332251832918003
Reviewed-on: https://gerrit.libreoffice.org/30927
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-17 13:10:42 +00:00
David Tardon
27a165cfc9 drop useless semicolons
Change-Id: I039f8ff491b42ea9c3936bf13922df8095434228
2016-11-13 19:08:22 +01:00
Noel Grandin
41ea741cd8 loplugin:unnecessaryvirtual in sfx2..svtools
Change-Id: Ib34e14806f7cc9a97ecfd68687ab17ee5c1f022b
Reviewed-on: https://gerrit.libreoffice.org/30652
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-07 09:39:55 +00:00
Noel Grandin
880bcf9ed8 loplugin:unnecessaryvirtual
Change-Id: I572b83949c7e643536b7d62567760546509e4d9f
Reviewed-on: https://gerrit.libreoffice.org/30514
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-03 09:06:45 +00:00
Noel Grandin
8de24d1652 Revert "remove unnecessary casts"
This reverts commit fa80dae9a79a7414af8adcb91bc04dfff13bbb63.

because current Clang master complains with

/home/noel/libo3/svl/source/items/itemset.cxx:189:26: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
        va_start( pArgs, nNull );
                         ^
/home/noel/libo3/svl/source/items/itemset.cxx:176:89: note: parameter of type 'sal_uInt16' (aka 'unsigned short') is declared here
SfxItemSet::SfxItemSet(SfxItemPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull, ...)
2016-11-03 08:47:47 +02:00
Jochen Nitschke
fa80dae9a7 remove unnecessary casts
Which IDs are always sal_uInt16 and likely passed from defines

Change-Id: I134358289ccd338ef1ff6ba963e25a524e790f4e
Reviewed-on: https://gerrit.libreoffice.org/30498
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-03 06:34:22 +00:00
Jochen Nitschke
1bbf7f653b bin nranges.*, move remaining functions into itemset.cxx
Change-Id: I1b88d98e00415e9c32a48486912d577a00fbfbda
Reviewed-on: https://gerrit.libreoffice.org/30486
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-03 06:33:34 +00:00
Jochen Nitschke
e75561bd19 bin SfxUShortRanges, inline and rewrite only usage
only use was to merge 2 range tables in SfxItemSet::MergeRange
of which one table always contained a single range.

rewrite the merge algorithm (SfxUShortRanges += operator).
sort new range into the table of ranges and merge overlapping
ranges afterwards. Not as optimal as the original code but it's
short, maintainable and works without 'goto'

inline the DBG_CHECK_RANGES macro

Change-Id: I991c050f069d44fe72b3ea374863f5f26e7099e9
Reviewed-on: https://gerrit.libreoffice.org/30299
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-30 18:59:13 +00:00
Michael Stahl
85c38f1cf4 svl: change SfxPoolItem ref-count to sal_uInt32
Fixes the inconsistency between potentially 64-bit sal_uLong and
the max-value macros that are ~2^32.

Change-Id: I895c674819cf4766cb2c7441f670bc1305362a74
2016-10-28 22:49:28 +02:00
Michael Stahl
855e69d37e svl: SfxPoolItem reference counting assertions
Change-Id: Ice2ec9a4592a1fad36913ae7d089aa8c63dfc669
2016-10-28 22:49:28 +02:00
Noel Grandin
8a22bc93e0 update unnecessaryoverride plugin to find pure forwarding methods
which can be replaced with using declarations.

Is there a more efficient way to code the search? Seems to slow the
build down a little.

Change-Id: I08cda21fa70dce6572e1acc71bf5e6df36bb951f
Reviewed-on: https://gerrit.libreoffice.org/30157
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-28 12:56:17 +00:00
Noel Grandin
c19d2b276b loplugin:expandablemethods in stoc..svl
Change-Id: I7dd701ef07a14f70589b87154bfeeda7530b628f
Reviewed-on: https://gerrit.libreoffice.org/30316
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-27 10:16:08 +00:00
Miklos Vajna
36c4fd5c33 svl: the compiler can generate the same SfxGrabBagItem copy ctor itself
Change-Id: I54f94e8ec710ca117ecdf33ebe97a0e5f07c59ec
Reviewed-on: https://gerrit.libreoffice.org/30283
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-10-26 11:21:04 +00:00
Jochen Nitschke
20f2a6b3f7 untangle .cxx include in itemset.cxx
Change-Id: I0102ad82d82c8f0e9f8939512bae83424613c54e
Reviewed-on: https://gerrit.libreoffice.org/30281
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-26 06:59:32 +00:00
Jacek Fraczek
f004aa9951 tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method.
Changed static_cast<T*>(svRef<T>) occurances to svRef.get().
Added operator == and != to SvRef.

SbxObject::Execute is using SbxVariableRef internally.
SbxObject::FindQualified is using SbxVariableRef internally.

Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395
Reviewed-on: https://gerrit.libreoffice.org/29621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10 08:48:30 +00:00
Michael Stahl
d211dafa9e svl: remove #include windows.h from svdde.hxx
Move Win32 stuff over to DdeInternal class where it can be better
encapsulated.

Change-Id: Ia3d4c72cf7ad1b7d54bef5d175c579cd426407e7
2016-10-07 17:48:37 +02:00
Michael Stahl
ce650fc1cd Revert "More blind fix for --enable-pch Windows builds"
This reverts commit 1b613450f85d052b7343eacefd79abbfe4f35e2f.
2016-10-07 17:47:35 +02:00
Stephan Bergmann
1b613450f8 More blind fix for --enable-pch Windows builds
Change-Id: I8e7c79a4d3a9d6c226f9d112c59ada5a7f76c7a4
2016-10-07 17:20:32 +02:00
Stephan Bergmann
cb4bfd0c82 More blind fix for --enable-pch Windows builds
Change-Id: I0e95a5ec30a9418b2635c0dd7cbe74a72055552f
2016-10-07 14:45:21 +02:00
Stephan Bergmann
8e7462e700 Blind fix for --enable-pch Windows builds
Change-Id: Ieffc0e8a29870dcc63c28fc644742b3e6a6031a4
2016-10-07 14:00:18 +02:00
Stephan Bergmann
7e68c64c1e Make _WIN32-only DDE code use proper HCONV
...instead of various integer types.  Revealed that the GetConvId functions were
unused.

Change-Id: I6c6427bd8c14166e58bed3405084e3919bdc97f9
2016-10-07 13:52:47 +02:00
Stephan Bergmann
5700899b13 loplugin:staticmethods: svl
Change-Id: I5cadb5e19790a941c719253966bc65d54e2b60bd
2016-10-07 12:07:43 +02:00
Stephan Bergmann
f1a8c3119f Replace DdeData conversion operators with proper functions
Change-Id: I866bdcbf1b6a5cda4472b6655ace866a3d5a8983
2016-10-05 13:39:25 +02:00
Stephan Bergmann
106ea87205 Remove _TYPED suffix from tools/link.hxx macros
...which was introduced with 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed "Gradually
typed Link" to distinguish the new, typed versions from the old, untyped ones,
but is no longer necessary since 382eb1a23c390154619c385414bdbe6f6e461173
"remove untyped Link<>" removed the old versions.

Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-10-05 07:56:12 +02:00
Noel Grandin
ba3521f288 add more dumpAsXml()
and make it format the output nicely, so I don't have to use 'xmllint
--format' before I can read it.

Change-Id: I065ee93193f3c6c7bab87212ab96021fb0d7c5ed
Reviewed-on: https://gerrit.libreoffice.org/29407
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-03 06:08:14 +00:00