Commit Graph

155 Commits

Author SHA1 Message Date
Noel Grandin
49eb02f07a new loplugin:unusedvariablemore
collection of heuristics to look for local variables that are never read
from i.e. do not contribute to the surrounding logic

This is an expensive plugin, since it walks up the parent tree,
so it is off by default.

Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06
Reviewed-on: https://gerrit.libreoffice.org/52450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-11 09:48:10 +02:00
Andrea Gelmini
fe47e5fdd3 Fix typos
Change-Id: I9ecf648960ddd131aa3d961bf86c2f1d3389355f
Reviewed-on: https://gerrit.libreoffice.org/49584
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-12 15:36:33 +01:00
Caolán McNamara
6afb78d3dd ofz#5244 tighten depth check
Change-Id: Ia841f3419ebe14d8f73d09a6fc089973252725ff
Reviewed-on: https://gerrit.libreoffice.org/47770
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-11 21:38:54 +01:00
Caolán McNamara
585328a713 ofz#4703 Direct-leak
Change-Id: I5f3385d87aa5a48a8df3b6774dd1166cec60ebf8
Reviewed-on: https://gerrit.libreoffice.org/46893
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-21 13:53:17 +01:00
Noel Grandin
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
Caolán McNamara
0ecd8c5fe3 ofz#4570 depth protect mathtype parsing
Change-Id: I1d8ca1704c057e154aa1d3aa57d722c24609cc48
Reviewed-on: https://gerrit.libreoffice.org/46181
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-10 16:25:19 +01:00
Caolán McNamara
71c2a1d313 ofz: reset sPush and sMainTerm once 'popped'
Change-Id: Ib63dd132cb2055b76492f5d53e45c2a86dd8a131
Reviewed-on: https://gerrit.libreoffice.org/45940
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-06 18:30:32 +01:00
Caolán McNamara
a8781520e3 ofz: oom, variation 0 and 1 have one argument
while variation 2 has two arguments

Change-Id: Ia2a9bd5e33b589b6e002da78d1a5b45d703565ef
Reviewed-on: https://gerrit.libreoffice.org/45926
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-06 15:18:41 +01:00
Caolán McNamara
175c0541c7 ofz: tmRoot variation 1 has two arguments
Change-Id: I75ad9bcbc35ee2a0b9b7941cadc9b4bee79fb6c0
Reviewed-on: https://gerrit.libreoffice.org/45905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-06 09:54:56 +01:00
Caolán McNamara
870f23b69b ofz: avoid oom, tmLDIV has only two slots
Change-Id: I6df2ec0790e94008eba6a7d97256440db5a26ac7
Reviewed-on: https://gerrit.libreoffice.org/45870
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-06 09:54:31 +01:00
Caolán McNamara
20faa6eeda extend enum with missing entries and use those instead
of raw numbers

Change-Id: I5a10716fd30a469d25e50a3dea6e9dd50602a457
Reviewed-on: https://gerrit.libreoffice.org/45871
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-05 21:25:07 +01:00
Caolán McNamara
0722363c2b ofz: infinite loop
Change-Id: Ie2148fd0048c6894e1b317dd2a4f2533ff2e1814
Reviewed-on: https://gerrit.libreoffice.org/45827
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-05 10:11:29 +01:00
Caolán McNamara
6b0a2d193a ofz: allow std::out_of_range
Change-Id: I4d63214e3691e56816d66162660c243a7454e114
2017-12-04 15:50:19 +00:00
Caolán McNamara
a60d7fde54 Add mathtype to fftester
Change-Id: If082fc85d943c5b2537800456dcebbce3cb10791
Reviewed-on: https://gerrit.libreoffice.org/45730
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-03 10:30:23 +01:00
Caolán McNamara
0c566771c4 let mathtype import take a SvStream of the contents
Change-Id: I3c02dbee53554aa644b78f8a425b6a4333f2b95d
Reviewed-on: https://gerrit.libreoffice.org/45729
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-03 10:28:13 +01:00
Caolán McNamara
b4daa672d3 try to hide the evidence
of my involvement with starmath

Change-Id: I072d1c6cee1e20a70afac43022658b6878028f18
2017-12-02 20:27:26 +00:00
Caolán McNamara
2161d04688 drop duplicate method
Change-Id: Idadd0a64e41cd02f5167b275081c3576a6224b12
Reviewed-on: https://gerrit.libreoffice.org/45075
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-22 13:33:25 +01:00
Andrea Gelmini
a26b6c5a37 Fix typos
Change-Id: I7b6c699b46fb71c1f19b5e5548c22a11efe8b864
Reviewed-on: https://gerrit.libreoffice.org/44836
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-11-16 21:05:44 +01:00
Stephan Bergmann
ff77d83afd loplugin:includeform: starmath
Change-Id: Ic5d81bdeb98024f41f9dfca260eca0359b27b809
2017-10-23 22:45:52 +02:00
Jochen Nitschke
1a68c13518 starmath: cleanup includes with iwyu
Change-Id: I6de145f8b59d3ebcbc0cb32df3f955c9ee738eeb
Reviewed-on: https://gerrit.libreoffice.org/40666
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 09:18:44 +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
4b2262ab5b new loplugin unnecessaryparen
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec
Reviewed-on: https://gerrit.libreoffice.org/39549
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05 11:08:48 +02:00
Takeshi Abe
94662151fe starmath: SvStream::Seek()/Tell() uses sal_uInt64, not sal_uLong
Change-Id: I210a9969f4bf6a1dc5c199836abec08d78968c36
Reviewed-on: https://gerrit.libreoffice.org/38702
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-06-13 01:56:46 +02:00
Noel Grandin
de8caac6be replace SVSTREAM_OK with ERRCODE_NONE
since the first is #define'd to the second, and offers no extra value

Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450
Reviewed-on: https://gerrit.libreoffice.org/38406
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-06 08:15:57 +02:00
Noel Grandin
98c4cd372b loplugin:unusedfields improve write-only analysis
by whitelisting a couple of methods we know only write to their
parameters

Change-Id: Id7aef9c03c23d10c27707b21eb9a0db4a6c2757c
Reviewed-on: https://gerrit.libreoffice.org/37647
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-16 08:45:17 +02:00
Noel Grandin
9fbd05e0c7 loplugin:checkunusedparams in starmath
Change-Id: I1a2299f66e077879863ac0e694e42196c9432458
Reviewed-on: https://gerrit.libreoffice.org/37192
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-04 08:39:52 +02:00
Takeshi Abe
d52d230fc2 starmath: Convert SmNodeType to scoped enum
Change-Id: I30921f9426e0e50ab8c6dfb1e86400847176b707
Reviewed-on: https://gerrit.libreoffice.org/36613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-04-18 12:47:25 +02:00
Andrea Gelmini
25e0872da6 Fix typos
Change-Id: I4eda687db6ad8d41e6a28430c76b288510da605d
Reviewed-on: https://gerrit.libreoffice.org/35645
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 12:25:17 +00:00
Noel Grandin
4978328534 convert method names in tools::SvRef to be more like our other..
reference classes, uno::Reference and rtl::Reference.

Specifically rename Is()->is() and Clear()->clear().

Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae
Reviewed-on: https://gerrit.libreoffice.org/33576
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02 08:02:54 +00:00
Jacek Fraczek
398d641664 tdf#89307: Removed T* SvRef::opeartor &()
Usage has been replaced with SvRef::get() or removed where applicable.

Change-Id: I49f108910b668466134c40940b53fc3ab2acd816
Reviewed-on: https://gerrit.libreoffice.org/29780
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-18 09:27:56 +00:00
Noel Grandin
3b48b3cc92 loplugin:singlevalfields in sc..vcl
Change-Id: I68752a3daf5ddd8581c07759b8be2c1dabbb9258
2016-09-15 11:30:42 +02:00
Stephan Bergmann
f5a99c3748 loplugin:stringconstant: adapt to improved OUStringLiteral1 (starmath)
Change-Id: Ic0a3a2ae6c0e2601cb415cba971620a71ded02a5
2016-08-30 15:29:20 +02:00
Jochen Nitschke
33b38082ca put StreamMode masks in scope of enum class
Change-Id: I77682f7e289a59b986bb84edf014029a20266470
Reviewed-on: https://gerrit.libreoffice.org/28420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-27 12:06:15 +00:00
Noel Grandin
069d71b725 loplugin:countusersofdefaultparams in shell..starmath
Change-Id: I553d1b031b8d261a1caa8b77a8d687af21a6f8d6
Reviewed-on: https://gerrit.libreoffice.org/27672
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-01 06:05:58 +00:00
Noel Grandin
48a8d6d843 loplugin:singlevalfields in various
Change-Id: Ia0d8f463a4dba9ec63aa0159441e3e607dd3bf5e
Reviewed-on: https://gerrit.libreoffice.org/26738
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-28 11:21:17 +00:00
Michael Stahl
62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Takeshi Abe
53bc542093 STREAM_STD_READ already includes StreamMode::NOCREATE
Change-Id: Ib8c81056619a383cedc828b945c1802ff1ce42ca
Reviewed-on: https://gerrit.libreoffice.org/25802
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-02 10:52:45 +00:00
Stephan Bergmann
14cd5182c5 Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough.  (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)

Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently.  (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.)  C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.

Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-10 16:42:16 +02:00
Rohan Kumar
28aaa27438 tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
I removed all the OSL_DEBUG_LEVEL > 1 conditionals and also
made SAL_WARN open to production code which was earlier under
OSL_DEBUG_LEVEL > 0

Change-Id: Ibe71defed9a7191ec8e4a934e746ef0f3ebd8b3a
Reviewed-on: https://gerrit.libreoffice.org/23065
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-21 17:01:53 +00:00
Douglas Mencken
9a3d702c3d starmath.mathtype: change int -> bool for returned values
it looks like it always supposed to be bool

Change-Id: Ie18dfdf9c91bb66828889d0370ceeb946cc9289d
Reviewed-on: https://gerrit.libreoffice.org/21764
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2016-01-27 15:44:33 +00:00
Michael Stahl
1a18c92a52 consolidate MSO format ClassID magic numbers in msfilter/classids.hxx
Change-Id: I673eeaa4168f769cb002995c43d986ee5f2030b2
2015-12-08 22:11:43 +01:00
Stephan Bergmann
61f168d987 Add SvStream::ReadUtf16 (don't assume sal_Unicode is unsigned short)
Change-Id: I74f34e3389582617fa83f8f4a3d6867cf87189e1
2015-11-17 10:36:13 +01:00
Stephan Bergmann
374b4f349f loplugin:nullptr (automatic rewrite)
Change-Id: Ife1eef04d905f12308b64b971176c2f045a1b268
2015-11-10 10:31:41 +01:00
Stephan Bergmann
bf6b30ba95 loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: Id5b78aa78fc585a67712fa44329479a86230d194
2015-11-06 09:37:28 +01:00
Andrea Gelmini
7319f5facc Fix typos
Change-Id: Ic3d2171521e308261c354d8f699b44b26c95f1ea
Reviewed-on: https://gerrit.libreoffice.org/18978
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-09-30 10:45:48 +00:00
Andrea Gelmini
0b7d51df3b Fix typos
Change-Id: Ic6415423f46aaee7ba90239a617c318cf92ae222
Reviewed-on: https://gerrit.libreoffice.org/16711
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2015-07-04 10:21:01 +00:00
Noel Grandin
1df4114245 loplugin:loopvartoosmall
Change-Id: I809e408c994222cfa95ba8f56e4db7bd96be7080
2015-06-02 09:45:16 +02:00
Stephan Bergmann
0241519f32 Unwind SotStorageStreamRef typedef
Change-Id: If7652a7c0251b741660365848a717c06954ca419
2015-05-07 11:05:04 +02:00
Stephan Bergmann
dc47b2e513 Unwind SotStorageRef typedef
Change-Id: I8d5363bb2ad813ef29b4078848914f4b0989b9f1
2015-05-07 11:05:04 +02:00
Stephan Bergmann
2aa9110ed0 Remove SvStorageRef alias
Change-Id: Icd1bf88cefac929916ece9a30b9b65c5297ec2a3
2015-05-07 11:05:03 +02:00