Commit Graph

3893 Commits

Author SHA1 Message Date
bddd6c7781 Revert "loplugin:changetoolsgen in avmedia..basic" and reapply plugin
because I
(a) forgot to insert parentheses which changes the meaning of some expressions and
(b) I now use the AdjustFoo calls when changing unary operations, which reads much better

This reverts commit 1adb1a320a7e9832a41545bde13fd59d27ce7954.

Change-Id: I52924b35008c8e4b44c8a6b6657cc3a1ac513886
Reviewed-on: https://gerrit.libreoffice.org/49848
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-16 19:50:47 +01:00
7faa218231 ofz#6311 still problems with SdrEdgeObj listening to same obj at start as end
Change-Id: Ibd80b484788779b73943b28a5f36e51ebcacec30
Reviewed-on: https://gerrit.libreoffice.org/49821
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-16 00:35:10 +01:00
1adb1a320a loplugin:changetoolsgen in avmedia..basic
Change-Id: I4e355ae27b9fad1cc6e8f8f408dbd9e93d7256d7
Reviewed-on: https://gerrit.libreoffice.org/49603
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-13 07:38:03 +01:00
73256b9181 Decrease fragility in odd use cases with no current document
Change-Id: I9966166561d4c6e577f3f7e8e04572f97a0b295e
Reviewed-on: https://gerrit.libreoffice.org/49450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-02-09 00:50:02 +01:00
7a42f39663 basic: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I9e157f7b27eab831c5c15f6c22b9ffb20207b593
Reviewed-on: https://gerrit.libreoffice.org/48947
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-31 21:01:49 +01:00
7c7aa4e307 loplugin:pointerbool (clang-cl)
Change-Id: Idaf9e1858afb8f22bba1767470138ec820a8d7cb
2018-01-25 08:13:11 +01:00
ad9871a5d1 Introduce SbxValues::clear
...to avoid upcoming GCC 8 -Werror=class-memaccess ("clearing an object of non-
trivial type ‘struct SbxValues’")

Change-Id: Icf610e692b81030bfd6f2f940c43ee8bf6f1d4e0
Reviewed-on: https://gerrit.libreoffice.org/48389
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23 19:54:06 +01:00
9af8f190ed More loplugin:cstylecast on Windows
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after
cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some
more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More
loplugin:cstylecast"

Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862
Reviewed-on: https://gerrit.libreoffice.org/48317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23 07:54:51 +01:00
44853cc8be loplugin:useuniqeptr in SbxVariable
Change-Id: I788ec594589d9708e12db83a7371b5a8d9fed38c
2018-01-19 08:58:46 +02:00
000fa4c495 loplugin:useuniqueptr in SbiStdObject
Change-Id: Ic66d817746de423549c87f58068e47f9942d04fd
2018-01-19 08:58:46 +02:00
24cbc7a1fc loplugin:useuniqueptr in SbUnoMethod
Change-Id: Ibeae1754a18152c3a17379c95e3caa536a8822db
2018-01-19 08:58:46 +02:00
5954878448 loplugin:useuniqueptr in SbiGlobals
Change-Id: I0ebec3193b4369039f90be4223ebdf6d048b8478
2018-01-19 08:58:46 +02:00
263d732569 loplugin:useuniqueptr in SbModule
Change-Id: I20525bd69c91ff35c9e569525a0d4556bc184982
2018-01-19 08:58:46 +02:00
624f84c07e Fix typos
Change-Id: I078626eaa3155cc429320cc8c1532003b382b22a
Reviewed-on: https://gerrit.libreoffice.org/47855
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-16 12:40:51 +01:00
3a40d3de89 More loplugin:cstylecast: basic
Change-Id: I0bb219632da384ab047a2b1fc3f2b041dacaf2cb
2018-01-15 09:07:14 +01:00
7d8e94444d convert a<b?a:b to std::min(a,b)
with something like

    git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx

Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23
Note: we also convert a>b?b:a
Reviewed-on: https://gerrit.libreoffice.org/47736
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-15 07:26:17 +01:00
6070aaa47d More loplugin:cstylecast: basic
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I20b38196ee1b6a34384dc46d9de1b6e1b44947ae
2018-01-12 20:29:14 +01:00
728104b31c tdf#96099 Removed some trivial typedefs related to UnOrderedMap and size_t.
Change-Id: I59d3d0b2c1097b5ca96505dc99a4a104b4f8ab48
Reviewed-on: https://gerrit.libreoffice.org/47082
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-10 15:20:44 +01:00
ee4b074ce2 basic, solve link problems
When not using scripting, there were a number of
unresolved symbols. First aproach did not work, so this
commit is the more extensive.

Change-Id: Iaf78bde10d9a43862d58d1aa8f46b14aa075eddb
2018-01-08 13:18:36 +01:00
0a1b0458cb SAL_TYPES_SIZEOFINT == 2 no longer possible
on any of our platforms

Change-Id: Id453ada9c79c76f2736f568436e386b05bcd08c5
Reviewed-on: https://gerrit.libreoffice.org/47468
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-06 13:38:36 +01:00
54227c9a20 Silence loplugin:unnecessarycatchthrow with --disable-debug
(An alternative fix could be to suppress warnings for catch blocks containing
preprocessor conditionals, but as these two places seem to be the only ones
affected, keep it simple for now.)

Change-Id: Ia83e56d1eab69bb2920ffdbbfc2182addce47963
Reviewed-on: https://gerrit.libreoffice.org/47331
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-04 08:06:13 +01:00
884cbe174e RID_* can be extern global variables
no need to access them via methods

Change-Id: If0d1a65d6f56ce2fc585749d974ba13c9f2749b2
Reviewed-on: https://gerrit.libreoffice.org/47245
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-02 12:19:01 +01:00
d0222ba1fd Fix typos
Change-Id: I3d16dc162e5fa2e08134d848a835eb392e64056e
Reviewed-on: https://gerrit.libreoffice.org/47126
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-12-29 09:54:33 +01:00
2a421b26c0 loplugin:passstuffbyref improved return in basic,framework
Change-Id: Ib19836febb59f4e2bb07dc874cfc6baabc653237
Reviewed-on: https://gerrit.libreoffice.org/47065
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-26 19:56:02 +01:00
101a79cc4d lokdialog: Allow switching language of some of the ResMgr's.
This way, it is possible to have all the strings translated in dialogs even
when different users use different languages.  [It was already possible
to have different languages previously, but not everything in the dialog has
switched - like the buttons at the bottom of the dialogs etc.]

Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9
Reviewed-on: https://gerrit.libreoffice.org/46417
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/46979
Tested-by: Jenkins <ci@libreoffice.org>
2017-12-22 22:39:39 +01:00
00bc5a0973 wrap scoped enum around css::util::NumberFormat
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa
Reviewed-on: https://gerrit.libreoffice.org/46339
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2017-12-19 22:08:26 +01:00
be359b156b loplugin:unusedenumconstants
Change-Id: I9dc4b369872a7c6c076ae9be1dcdf2f8385af8a7
Reviewed-on: https://gerrit.libreoffice.org/46684
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19 07:49:33 +01:00
4e144751f1 loplugin:unusedindex
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146
Reviewed-on: https://gerrit.libreoffice.org/46652
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-18 07:36:32 +01:00
8de8e0ce21 Get rid of loop counter variable
Change-Id: Ia4f4e24819525287e720a9c016b3666bc006b545
Reviewed-on: https://gerrit.libreoffice.org/46531
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-15 19:54:16 +01:00
29baa05bb9 tools: remove unused #include from solar.h
Change-Id: I214e13add371380701ae39403d90a574a63e495d
2017-12-13 22:12:39 +01:00
3af500580b loplugin:salcall fix functions
since cdecl is the default calling convention on Windows for
such functions, the annotation is redundant.

Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d
Reviewed-on: https://gerrit.libreoffice.org/46164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11 12:13:46 +01:00
c947a25b3a loplugin:countusersofdefaultparams in basctl..basegfx
Change-Id: I515acfb9de1f6dff1de94a60055c5b600e5e5241
Reviewed-on: https://gerrit.libreoffice.org/45957
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-07 07:19:59 +01:00
9f9347c265 basic: SfxLibraryContainer: replace maMutex
... with cppu::BaseMutex, because a member cannot ensure the life
cycle guarantees expected by WeakComponentImplHelper.

Change-Id: Iaa10c699abf69882d917487740db241ba1455e1c
2017-12-06 10:03:24 +01:00
c0ac78c971 loplugin:salcall handle virtual methods
Change-Id: Iab95db31188ea2914a46d63a7ebef3d825e6ec42
Reviewed-on: https://gerrit.libreoffice.org/45851
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06 07:42:50 +01:00
ef6940a480 Save an unnecessary duplicate GetObject() call
Change-Id: Ib0efc84ad2cedc1a149fa57996bc0481bd64591b
2017-12-05 20:06:07 +01:00
36493607d8 Simplify the IsObject()/GetObject() logic here
Change-Id: I816b15b6795b4946b1bfed0d1f6d103a6a1aba4f
2017-12-05 18:30:22 +01:00
d1cd68fac3 Rather call GetObject() only if IsObject(), tdf#112571 follow-up
Which effectively is what GetObject() internally also does to
determine whether to set an error, so resetting an error here is
moot (or might even hide a nested error?).

Change-Id: I8736d16e386d1833126965538f96aaa1fd73dfd6
2017-12-05 18:17:06 +01:00
863e269cd3 Resolves: tdf#114232 reset error after unsuccessful GetObject() query
Probably broken already since

    commit 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a
    Date:   Wed Oct 6 10:16:27 2010 +0100

        initial commit for vba blob ( not including container_control stuff )

Change-Id: Iecce564851a76921b491ff101365c70883ad7475
2017-12-05 17:27:57 +01:00
d915cb417b Resolves: tdf#114231 do not mask ErrCode with GetRest()
Regression from

    commit 7ca950ec744b7af1d15724ec2abc296573a641e4
    Date:   Wed Aug 23 19:25:02 2017 +0200

	no need to use ERRCODE_RES_MASK here

	the relevant usage sites already call GetRest() before comparing

which exactly is the reason that it didn't work anymore.

Old StringArray ItemList resources stored only 16-bit values,
hence ERRCODE_RES_MASK was used to mask the ErrCode values in the
resource for which code had to mask ERRCODE_RES_MASK as well to
compare values. Now the full ErrCode is stored, so code must not
use GetRest() on a value to compare against, or use GetRest() on
both values (which theoretically could lead to ambiguities, but
probably doesn't in resources that are restricted to one module).

Change-Id: I835e47424bb008bc680dc4f8c502c9558397db36
2017-12-05 15:20:07 +01:00
9a06b99d2f loplugin:salcall fix non-virtual methods
first, since those are safer to change than virtual methods

Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe
Reviewed-on: https://gerrit.libreoffice.org/45798
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05 07:32:46 +01:00
af8431d8db Find VBA-only functions when compiling first on module level
This likely never worked as there is no SbiInstance in that step,
but worked by chance when running a module's code that was
compiled with VBA support where the VBA-only function was added as
a symbol to be resolved later during runtime and then the
SbiInstance exists and the symbol was magically resolved.

Found when trying to correct vba_tests to actually fail if all
subtests fail that then started to fail in Atn.vb because of the
Round() function being VBA-only.

Change-Id: I7d9f6e2640a73388a2a58c3d180820c6ef85abe3
Reviewed-on: https://gerrit.libreoffice.org/45425
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-11-29 11:08:58 +01:00
a566fd1c1a loplugin:unusedmethods
Change-Id: I2efb5c0e5735c179314c6c5de87821cee3b033e1
Reviewed-on: https://gerrit.libreoffice.org/45386
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-29 07:28:57 +01:00
bb4cd5271e Get rid of two more temporary SvNumberFormatter instances
Change-Id: Id2afd9dd9d791383a1374b5abe52b47b43a19f08
Reviewed-on: https://gerrit.libreoffice.org/45236
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24 21:34:14 +01:00
5e1d49db80 Get rid of a temporary SvNumberFormatter instance
For each Format call..

Change-Id: I2f9d875ca27d5a10e609df1c0168be2dad65eaab
Reviewed-on: https://gerrit.libreoffice.org/45230
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24 21:33:30 +01:00
f1b5b22a5f Get rid of that LANGUAGE_GERMAN nonsense
Change-Id: I1ca3125e893a54ac00a3d785d77ed5612fb01857
Reviewed-on: https://gerrit.libreoffice.org/45235
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24 21:32:45 +01:00
2f8174594d Aaand another one.. SvNumberFormatter instance
... just to parse with LANGUAGE_ENGLISH_US if system locale failed..

Change-Id: Id9b7cfb5b5f21c46789f30e8e8c72a7524491e95
Reviewed-on: https://gerrit.libreoffice.org/45238
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24 21:32:01 +01:00
28288295ae Get rid of a temporary SvNumberFormatter instance
... in case we have a runtime instance already. Only used for
scanning date literals in source so not frequently used, otherwise
we could remember a non-runtime instance formatter somewhere.

Change-Id: I1146860c4b0aa4091708c22e498a6f720d6c7a13
Reviewed-on: https://gerrit.libreoffice.org/45232
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24 21:31:15 +01:00
4b98e352e5 Make the SbiInstance SvNumberFormatter shared_ptr
In preparation to get rid of the per call locally created
SvNumberFormatter instances..

Change-Id: Ic7db3bbb655aa18e939f5722964655a20f2eadf2
Reviewed-on: https://gerrit.libreoffice.org/45227
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-11-24 21:30:02 +01:00
462866cfdc various coverity warnings
Change-Id: I27f20c51f86aeaed8e932f7ca45cce8770bc34ec
Reviewed-on: https://gerrit.libreoffice.org/45140
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-23 21:28:47 +01:00
db080dad6c tdf#114011 limit/truncate date, not only year
Change-Id: I479040f411fb8b5975c0aa1aa24f95c957cf80cf
2017-11-23 18:44:48 +01:00