1454 Commits

Author SHA1 Message Date
Noel Grandin
2fffaf6f05 loplugin:unusedmethods
Change-Id: Ia874baf21257e5fe41e104211068a2bcc50446eb
Reviewed-on: https://gerrit.libreoffice.org/40391
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-25 12:03:50 +02:00
Noel Grandin
8045cef05c improve unusedfields loplugin readonly analysis
(*) better analysis of init-list-expressions
(*) fix analysis of calls to members, turns out there is no parameter
offset after all
(*) check for passing arrays to functions, need to check
  if the parameter is T* or T const *
(*) check for assigning field to a T& variable

Change-Id: Ie6f07f970310c3854e74619fe4fd02a299bf6879
2017-07-24 08:39:55 +02:00
Noel Grandin
c24d293661 loplugin:unnecessaryvirtual
Change-Id: Id3f0bbcae731d777ac7c1fbc9f020ff35833864b
Reviewed-on: https://gerrit.libreoffice.org/40323
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-23 21:12:41 +02:00
Julien Nabet
1cf7a4c39e Typo: "disposeAndClear", not "clearAndDispose"
Change-Id: I9f7f30fce9324f7ccb79e9a8ef0c13e091d7c3a3
Reviewed-on: https://gerrit.libreoffice.org/40304
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 14:16:03 +02:00
Noel Grandin
2b4cb88c02 loplugin:unusedfields in basctl..connectivity
Change-Id: I2f10daadb84e48eaf96f6cc63899b2f4fce7326e
Reviewed-on: https://gerrit.libreoffice.org/40295
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 14:07:49 +02:00
Noel Grandin
939f9bd0b5 loplugin:unusedfields in cppcanvas..cui
Change-Id: I1cf1f7919e03d863c6f7756e1caf3b9313777479
Reviewed-on: https://gerrit.libreoffice.org/40294
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 14:04:39 +02:00
Noel Grandin
5fad6eb1b3 loplugin:unusedfields in editeng
Change-Id: I61ddd2ce8ded65251fdf1903e6cb67f0d18c9451
Reviewed-on: https://gerrit.libreoffice.org/40293
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 08:51:32 +02:00
Noel Grandin
3ff8ecb53e loplugin:unusedfields in extensions..framework
Change-Id: I687c67c8f3c0e03c6ab2da0a93a9e62f0caf12cd
Reviewed-on: https://gerrit.libreoffice.org/40292
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 08:50:41 +02:00
Noel Grandin
760a7791a2 loplugin:unusedfields in io
Change-Id: I8be28fa2ed1e005c76eafc60746620338c8a49ac
Reviewed-on: https://gerrit.libreoffice.org/40291
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 08:49:43 +02:00
Noel Grandin
e5ee29737e loplugin:unusedfields in oox,reportdesign
Change-Id: I0201d76cb3d4605bdc00c81cfa9d91f98341c7f3
Reviewed-on: https://gerrit.libreoffice.org/40290
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 08:47:34 +02:00
Noel Grandin
0281b18775 make oncevar plugin ignore methods with #ifdef-ery
Change-Id: I8a9cf2c4b81b95bf654f7e90306328d72e3d3408
Reviewed-on: https://gerrit.libreoffice.org/40280
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 08:46:34 +02:00
Noel Grandin
ec340697d6 loplugin:constparams in soltools and various
Change-Id: I5e8e4a9a31aa7c3ff54cc7ce137d08770ea297e1
Reviewed-on: https://gerrit.libreoffice.org/40279
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21 17:11:15 +02:00
Noel Grandin
cf530f290d loplugin:unusedfields in sd
Change-Id: I7f89e038f3d9bd0da658c7d3b8faec23d8a593db
Reviewed-on: https://gerrit.libreoffice.org/40257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21 10:06:51 +02:00
Noel Grandin
5e4b4eecb1 loplugin:unusedfields in sfx2
Change-Id: Id6666065bf3b27388d87aa2605229e83f1aed79a
Reviewed-on: https://gerrit.libreoffice.org/40255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21 09:39:21 +02:00
Caolán McNamara
00657aef09 migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::resource::OfficeResourceLoader
      com::sun::resource::XResourceBundleLoader
      com::sun::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01:00
Noel Grandin
8e7cb95888 loplugin:unusedfields in svtools
Change-Id: I5484fe5ee449e72919591bd374366aa60f792e28
Reviewed-on: https://gerrit.libreoffice.org/40254
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21 08:40:03 +02:00
Noel Grandin
7b59273c6c loplugin:unusedfields in svx
Change-Id: I7fc5bf55b01d464815771220914f21d8e85b5a36
Reviewed-on: https://gerrit.libreoffice.org/40253
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21 08:38:06 +02:00
Noel Grandin
5b5995c05a loplugin:unusedfields in writerfilter
Change-Id: I7831da8cccfa730c8615ef770d0add95cbde396b
Reviewed-on: https://gerrit.libreoffice.org/40215
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 15:47:54 +02:00
Noel Grandin
4f75a93101 loplugin:unusedfields in tools
Change-Id: I4e26c4750f6ff6c246a25507cfed1a0b4e3c6b81
Reviewed-on: https://gerrit.libreoffice.org/40225
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 15:09:55 +02:00
Noel Grandin
85f08e3e34 remove some "optimisation" insanity in ScriptEventContainer
I can only imagine the weird bugs that must have periodically resulted
when we had a hash value collision.
In the process, fix hasElements() to return a useful value

Change-Id: I1d9a052e73332b4b2bbc9c1fd8142c13eb22f1be
Reviewed-on: https://gerrit.libreoffice.org/40226
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 15:09:20 +02:00
Noel Grandin
f24b46c272 loplugin:unusedfields in vcl
Change-Id: I207866df495ec81bb9288e6d0f664b96d90251d6
Reviewed-on: https://gerrit.libreoffice.org/40217
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 13:02:31 +02:00
Noel Grandin
6d829ae4f2 loplugin:constparams in basic
Change-Id: Idf55f63f2d56be4997a8cdc6afc5690eacac9a60
Reviewed-on: https://gerrit.libreoffice.org/40214
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 12:01:08 +02:00
Noel Grandin
a976fa5f00 mxStatusIndicator is unused
ever since
    commit 8dc268058690337459bc38862c1532c34f171a48
    Author: Björn Milcke <bm@openoffice.org>
    Date:   Fri Feb 9 15:48:29 2001 +0000
    Req. change Load/SaveAs for XML format - removed deprecated CTOR

Change-Id: I772123e89391fea3578c7ed0986e1bc2d2a42a97
2017-07-20 09:36:58 +02:00
Noel Grandin
1802cfca17 mxStatusIndicator is unused
ever since
    commit eaefa688bfff0f73992c84496d4ce89e16ac3550
    Author: Caolán McNamara <caolanm@redhat.com>
    Date:   Wed Nov 2 22:33:34 2011 +0000
    callcatcher: ditch some unused code

Change-Id: Ifca9734ad29257d0d692cf36e709837cbe02af29
2017-07-20 09:36:57 +02:00
Noel Grandin
bd5a91f5a3 m_xExtHandler is unused
ever since it was added in
commit eb4b36c6e797e5eda511422c48ff0a210e2cc460
Date:   Tue Jul 13 08:00:42 2004 +0000
INTEGRATION: CWS oasis (1.1.2); FILE ADDED

Change-Id: If4375c6e57dbe635f53ca0395cb7bdc02de81b18
2017-07-20 09:36:57 +02:00
Noel Grandin
30f7ce30c9 loplugin:constparams in connectivity
Change-Id: I9b81c6227fb3c89a832640058a11444f72019694
Reviewed-on: https://gerrit.libreoffice.org/40155
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-19 09:35:59 +02:00
Noel Grandin
0f7e64f3ed loplugin:constparams in desktop
Change-Id: Idba3acbd1e6ad5e1ce1cae9f80f764906ab8b143
Reviewed-on: https://gerrit.libreoffice.org/40157
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-19 09:28:00 +02:00
Noel Grandin
32878b6857 enhance unusedfields plugin to find readonly fields
Change-Id: I4da97443fc7eb14fd94959a026ab45a9256c055f
Reviewed-on: https://gerrit.libreoffice.org/40158
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-19 09:25:52 +02:00
Caolán McNamara
eff84b958c remove unused CntWallpaperItem
Change-Id: I47cf9fc37bb64a80a21ed805bff2bb3ac3eb6da5
Reviewed-on: https://gerrit.libreoffice.org/40148
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-18 22:14:07 +02:00
Noel Grandin
3964408f7f loplugin:constparams in sdext
Change-Id: Ia5d2c00b02bf1758f7502065dd109f0f54fda2d3
Reviewed-on: https://gerrit.libreoffice.org/40124
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 14:59:47 +02:00
Noel Grandin
c932e26138 loplugin:constparams in toolkit,ucb,xmlhelp
Change-Id: I2287bf468aae5008e25aa8b1bc0b63cff7bb1bf1
Reviewed-on: https://gerrit.libreoffice.org/40117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 11:13:05 +02:00
Noel Grandin
72f36adb93 loplugin:constparams in vcl
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4
Reviewed-on: https://gerrit.libreoffice.org/40116
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 09:57:26 +02:00
Andrea Gelmini
26b52972a8 Fix typos
Change-Id: I9d2c641b485c32ddccf0bfaaed1d0796572d1d33
Reviewed-on: https://gerrit.libreoffice.org/39477
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2017-07-17 19:15:00 +02:00
Stephan Bergmann
e27f2a8720 Fix test for clang-cl
...whatever it is that causes clang-cl to not analyze the template code
otherwise

Change-Id: Id4da996714fe93c454abb3669a12d8afe27b918b
2017-07-17 17:17:27 +02:00
Noel Grandin
db3860062e extend loplugin useuniqueptr to OUString pointers
Change-Id: Ieb5bab3895e1edaff497c4a1a88303ccac097edc
Reviewed-on: https://gerrit.libreoffice.org/39948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17 07:23:22 +02:00
Stephan Bergmann
e4faf5502d lopgluin:unnecessaryparen: Properly treat parenthesized sub-expr in sizeof (x)
...where redundant parentheses are probably common enough to not warn about them

Change-Id: Ia88097f5d3433e03337d6d42a144abfe210733c2
2017-07-16 20:35:11 +02:00
Noel Grandin
3ef7e85deb remove some dead code from unusedfields plugin
Change-Id: I268b32270a17c0c3fcf8236c3e0eebac9a57cb5d
2017-07-14 11:53:03 +02:00
Noel Grandin
8e39ef6692 extend loplugin useuniqueptr to POD types
Change-Id: I6ff24f048bd8f75bf87a78b718f37b57855d4781
Reviewed-on: https://gerrit.libreoffice.org/39932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-14 10:13:46 +02:00
Stephan Bergmann
7892b4191b loplugin:oncevar: empty strings
...which showed that checking the parent statement (which may be too large to)
in OnceVar::VisitDeclRefExpr is inadequate.

Change-Id: I07fb8ba9e2dfbd0c65a2723737d14abcddcefec4
Reviewed-on: https://gerrit.libreoffice.org/39757
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-14 09:52:51 +02:00
Noel Grandin
51a50cc95a improve useuniqueptr loplugin to find arrays
Change-Id: I81e9d0cd4f430b11d20037054055683240792240
Reviewed-on: https://gerrit.libreoffice.org/39825
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13 11:56:05 +02:00
Stephan Bergmann
367a34cb5f Use isSamePathname for full-pathname comparisons
Change-Id: Iccc20f441aceae7c6bcdf3a24d2a42ec9be8bb8f
2017-07-13 11:26:39 +02:00
Stephan Bergmann
4e451cad21 loplugin:oncevar for value-dependent constant expressions
(Where the change to basic/source/comp/codegen.cxx reveals that
loplugin:loopvartoosmall also needs the Clang < 3.9 workaround from
33ee8e61292af05627f5f72ea2f93ad80e715e46 "Work around bug in Clang 3.8".)

Change-Id: I9f23b9648bc11ca4136a0fbdd332570ba70ee77c
Reviewed-on: https://gerrit.libreoffice.org/39667
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-13 10:37:53 +02:00
Armin Le Grand
f65cbae894 borderline: correct problems with border display
Borderline display with direct paint and with primitive direct
paint has quite some errors in the current state. Started to
unify usages, check deeper with creation/usage.

borderline: deep changes to BorderLine

Found basic error in determining the offset values
for BorderLinePrimitive creation, these were not
centered on the lines. Corrected that. This makes
it possible to remove the formally used clipping
which seems to have been used to correct that. Also
allows to go back to a 'normal' decomposition that
creates line primitives as expected. That again can
then be painted quite normally.
Also added view-dependent case to the decomposition
to guarantee a gap of one discrete unit (pixel).
Removed the direct painter, too. Checked and corrected
stroking.

borderline: Adapted previews to primitives

Added code to use the primitive representation in
all dialogs and apps using tables. The edit views
use these mostly, so the preview should do that,
too. Currently missing is a good visualization of
diagonals, but this is also true for edit views.
Checked all apps and table usages to not get worse

borderline: correct line dash visualization

When a dashed line is used, a factor of 10.0 was applied in the
original coded, added that. Also the orientation of vertical
borders was inverted since it was simpler to exchange Start/End,
but this also mirrors the line dash visualisation, corrected that

Change-Id: I4c1b380a76cb37389fab1259a53fb7cc9da982d1
e95e246d5563360617a2a2213e4d5ec7d0e736b9
62369b4de58fb0264aeb710ec6983ceddca5701d
77418cc6c84ebb0632f8c3448976e82ce612d6b6
b4eb28dc86ce05eb89b26517167305b994158ef8
borderline: adapt cppunittest and clang
2017-07-12 21:01:20 +02:00
Noel Grandin
b533b2748e unusedfields plugin needs to ignore fields that have reinterpret_cast on them
Change-Id: Ie8570de6a4eafc95352899fbfd1447d7c3a84e1a
2017-07-11 16:10:01 +02:00
Stephan Bergmann
4ec6a5e3ac Only consider calls on const member functions as consumptions
Change-Id: I968614ba25affe58ea05c97c97dd10912359df2c
Reviewed-on: https://gerrit.libreoffice.org/39755
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-10 16:07:27 +02:00
Noel Grandin
4250b25c6a teach unnecessaryparen loplugin about identifiers
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b
Reviewed-on: https://gerrit.libreoffice.org/39737
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10 09:57:24 +02:00
Noel Grandin
868d8c8f0f loplugin:unnecessaryparen handle parens inside call expr
stick to single-arg function calls, sometimes parens in multi-arg calls
might be there for clarity

Change-Id: Ib80190c571ce65b5d219a88056687042de749e74
Reviewed-on: https://gerrit.libreoffice.org/39676
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07 10:45:05 +02:00
Noel Grandin
4f7b2ca221 loplugin:unusedfields in sc
found a couple more by running
    make build-nocheck
to exclude testing code

Also, teach unusedfields loplugin about operator<<, since
referring to a field in an ostream operator<< does not indicate a
real use, it's normally for debugging

Change-Id: I3dce22bf5afda2fd09e01de9bf1d0ef85e535aa8
Reviewed-on: https://gerrit.libreoffice.org/39625
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06 13:00:56 +02:00
Noel Grandin
13341ffa49 teach unnecessaryparen plugin about other kinds of statements
i.e. do / while / switch

Change-Id: Id0985015cc425557f9984734701d56466f8a6088
Reviewed-on: https://gerrit.libreoffice.org/39601
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06 08:31:52 +02:00
Noel Grandin
a1ead1a028 loplugin unnecessaryparan improvements
Change-Id: I73e945d6ec53537a0da45f6b6291018c7f251a7e
Reviewed-on: https://gerrit.libreoffice.org/39587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06 08:31:30 +02:00