102 Commits

Author SHA1 Message Date
Andrea Gelmini
e44c188a73 Fix typos
Change-Id: I879a52820d78d9151ef64dd21612379f617f66e2
Reviewed-on: https://gerrit.libreoffice.org/42726
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2017-09-25 12:20:56 +02:00
Noel Grandin
9fb742489b move deadclass plugin to store
<sberg> noelgrandin, and is loplugin:deadclass even sound?

    struct B { B(B const &) {} }; struct D: B { D(): B(*this) {} };

Change-Id: Idadd379b925aa6f9de6c625bffa8560ec4192ac7
2017-08-16 13:17:07 +02:00
Noel Grandin
742f030d67 update constantfunction loplugin
didn't find anything useful, so just updating the exclusion lists

Change-Id: I66d37aee185290f454e5ac0baeafd1f67bfaf106
Reviewed-on: https://gerrit.libreoffice.org/39254
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-26 11:00:32 +02:00
Noel Grandin
9c2b43e86f improve oncevar loplugin
we look for any kind of scalar variable now that deserves to be inlined,
and we check for variables that cannot be inlined because they are being
passed by reference, or modified, or have their address taken

Change-Id: Ia744a180e91d1516140a1555d4514f6fa4de1c0b
Reviewed-on: https://gerrit.libreoffice.org/38966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-20 07:49:45 +02:00
Stephan Bergmann
1e3a00f0c7 Make SfxItemSet ranges correct by construction: Fix static cases
...with the aid of an extended compilerplugins/clang/store/sfxitemsetrewrite.cxx
(which in turn needed a small addition to compilerplugins/clang/check.hxx).

Enable svl::detail::validGap check for the static case, but keep it disabled for
now for the dynamic case.

Change-Id: I4846ba8e99aff94a86518e2cb5044e575093386e
2017-06-19 09:38:05 +02:00
Stephan Bergmann
13bb5a4b09 Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
sorted, and join adjacent ones".  While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.

And in many cases the ranges are statically known, so that the checking can
happen at compile time.  Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking.  The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert).  Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.

(At least some of the uses of the existing SfxItemSet overload taking a

  const sal_uInt16* pWhichPairTable

can probably also be strengthened, but that is left for another day.)

This commit is the first in a series of two.  Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap).  That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.

There were three cases of necessary manual intervention:

* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.

* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.

* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).

A few uses of the variadic form erroneously used nullptr instead of 0 for
termination.  But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits.  Similarly,
some uses made the harmless error of using 0L instead of 0.

Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 17:28:41 +02:00
Maxim Monastirsky
8ac571d470 sc: Remove some dead slots
Change-Id: I92cfd5043c084d64fdfba3a1df817ee035388797
2017-05-05 11:23:51 +03:00
Chris Sherlock
da64d198ec tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 09:31:31 +02:00
Noel Grandin
0d199688fb fixes for some loplugins
ran the ones in store/ just for fun, but didn't find anything useful

Change-Id: I2bb251e8d99b5d88e11b2ca74e99672d75f0a1fd
2017-03-28 13:40:25 +02:00
Noel Grandin
994e38e336 loplugin: use TypeCheck instead of getQualifiedNameAsString
since the latter is rather slow

Change-Id: Ib73cdb923585580777c2265b561c1808e93b2baa
Reviewed-on: https://gerrit.libreoffice.org/33585
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 12:49:42 +00:00
Stephan Bergmann
1dc43e24b3 Generalize vector/deque ctor checks to work with MSVCRT
Change-Id: I2d493a36b8c2e3abe69964c04b46f08d67ef8a48
2016-12-22 09:23:19 +01:00
Noel Grandin
8955c3fde6 loplugin:oncevar
Change-Id: I44fb6858eeff14fcbd9fdfbbb0aabd1433b6a27d
Reviewed-on: https://gerrit.libreoffice.org/30668
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08 06:11:51 +00:00
Eike Rathke
8e38964c32 move loplugin:defaultparams to store/
As per IRC 2016-11-04 12:21

Change-Id: Ic4cc7f67fb31be80a966c652cb30bb859f874a8b
2016-11-04 12:28:57 +01:00
Tor Lillqvist
3be8c4c2bb The badvectorinit plug-in probably can be retired
Let's hope it only catches false positives now.

noelgrandin agrees.

Change-Id: Ibd8310c31897aa6835bd6aaf90a49b5cd8f92948
2016-10-21 14:18:20 +03:00
Noel Grandin
40fd53a238 loplugins: extract some common functionality
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
2016-10-18 08:51:07 +02:00
Noel Grandin
5c84f40ea2 loplugin:constantfunction
update the plugin similarly to
    commit 3ee3b36ae0c064fb5c81268d8d63444309d1b970
    Author: Stephan Bergmann <sbergman@redhat.com>
    Date:   Fri Oct 7 12:05:49 2016 +0200
    loplugin:staticmethods: Don't be fooled by decls starting with macros

Change-Id: I98ac3216d5acf89a49a26feb089ae2fd34e6e510
Reviewed-on: https://gerrit.libreoffice.org/29665
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-11 06:15:21 +00:00
Maxim Monastirsky
671ac3a922 Looks like the menu highlight handler is now unused
Change-Id: I75ff4bce35e7940e07b760f672e08ffe0dd208f8
Reviewed-on: https://gerrit.libreoffice.org/28580
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2016-09-01 09:39:52 +00:00
Stephan Bergmann
fb21736979 Move loplugin:returnbyref to store
...it complains about

  SbxValues * data() { return &aData; }

(include/basic/sbxvar.hxx) returning by pointer rather than reference, but I see
nothing wrong with that.

Change-Id: I1e65ed47322d3b52d0e34a8233f146af86e209f3
2016-08-21 21:20:40 +02:00
Noel Grandin
602647c241 loplugin:unnecessaryvirtual
Change-Id: If25d9307efda5f57b0f80a0cf5c2c5cab6a752d6
Reviewed-on: https://gerrit.libreoffice.org/27981
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08 13:06:58 +00:00
Stephan Bergmann
733198de1b Remove support for Clang < 3.4
Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
2016-06-29 09:15:25 +02:00
Stephan Bergmann
1ce7176ba1 Remove support for Clang < 3.3
Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
2016-06-29 08:55:27 +02:00
Miklos Vajna
7ab4f31b6e compilerplugins: move oncevar into store
As suggested by Stephan and agreed by Noel -- as its warnings are not
useful in all cases.

Change-Id: I3c6034ae9d3c74aeb089a67dc48c1f91a3ea3a21
2016-06-23 09:44:19 +02:00
Andrea Gelmini
d3c96c9f82 Fix typos
Change-Id: Ic3efae53430fbb2c1eb7962c3cf69bf99315e55b
Reviewed-on: https://gerrit.libreoffice.org/26202
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-13 06:04:07 +00:00
Bryan Quigley
71cf1aefca Remove unneeded Pane code in Presenter Console
This code hasn't been touched (on purpose) in years, it appears
to have been used to resize part of the console. (It's prefed off)

Change-Id: Iaaeaa8a95c71ae91299bbeeea24869bf2a237b6b
Reviewed-on: https://gerrit.libreoffice.org/24663
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-06-06 05:55:03 +00:00
Noel Grandin
2e2781d054 move stylepolice back to store
recent updates did not meet with universal approval

Change-Id: Ic059729797049361c7a8a4ae000cd39a5993f6af
2016-04-28 15:39:29 +02:00
Noel Grandin
e8fd5a07ec update loplugin stylepolice to check local pointers vars
are actually pointer vars.

Also convert from regex to normal code, so we can enable this
plugin all the time.

Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1
Reviewed-on: https://gerrit.libreoffice.org/24391
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26 10:55:58 +00:00
Noel Grandin
7b65087eab move stylepolice plugin into store/
seems std::regex is not too well supported yet, at least in
libstdc++-4.8

Change-Id: Ib9feb33d2f197d40fc67dc93468aa2f7dae05bac
2016-04-21 10:05:54 +02:00
Stephan Bergmann
dde79dd504 Rename OfficeIPCThread to RequestHandler
Change-Id: I2076d903e83a0b8eb3aa0ce2413630e2c5415b15
2016-03-29 14:54:20 +02:00
Wastack
9a13cff647 tdf#97966: Remove 'static' keywords
Change-Id: Id991cead4f01830eafd9cf8dd63b519ef07c9451
Reviewed-on: https://gerrit.libreoffice.org/23134
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-11 08:57:51 +00:00
Maxim Monastirsky
21b92f386c MenuDispatcher::m_pMenuManager is always nullptr
... as shown by 7da15debe39b50255cc08b3fef7ae38185a9174f.
Which means that MenuManager is unused, and MenuDispatcher
does nothing useful.

Change-Id: Ic85619531054a573d971d38b52609e1cbcaf780c
Reviewed-on: https://gerrit.libreoffice.org/23117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-03-10 15:23:31 +00:00
Maxim Monastirsky
7affe26a12 Kill sfx2 menu support
Change-Id: I340a066881b1962a4bcd5a2b7d9a0425d8b9557c
2016-02-28 09:10:19 +02:00
Stephan Bergmann
75e24386af Missed CLANG_VERSION for compilerplugins/clang/store/rtlconstasciimacro.cxx
Change-Id: I24d2dc570070a55f39dcd708eb7c47cd71dc0d02
2016-02-26 14:46:23 +01:00
Stephan Bergmann
01f3b95884 These version checks are about the Clang the plugins are built /against/
...not the (Clang) compiler they are being built /with/.  (Also simplifies the
checking #if code.)

Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
2016-02-26 14:34:29 +01: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
Stephan Bergmann
6bffbf100e Enable loplugin:nullptr
I had it locally enabled for like a month now, and it did not produce any more
noise than any of the other plugins.

Change-Id: I94dab702c537969cf32922f6e88b4f5b503cd3f5
2016-01-06 16:48:15 +01:00
Stephan Bergmann
593f3b703c Re-enable loplugin:sallogareas
I had it locally enabled for like a month now, and it did not produce any more
noise than any of the other plugins, but quite some amount of malformed area
designators had been introduced over time.

Change-Id: I642591496bb9338246ba43a3d988481930c087fb
2016-01-06 16:48:15 +01:00
Noel Grandin
00ea9e5e4e update constantfunction loplugin
Change-Id: I7917e5e17e88868a5e315bce11099d32a07ca39e
2015-12-15 10:40:50 +02:00
Stephan Bergmann
4a1edf626a More loplugin:nullptr automatic rewrite (within templates)
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
2015-12-10 17:34:31 +01:00
Stephan Bergmann
fb8a3fac5d loplugin:nullptr: More NULL -> nullptr automatic rewrite
Change-Id: Ie83819e2bcdc5fa160b39296b005ca9a5ff74b1d
2015-12-10 08:06:06 +01:00
Stephan Bergmann
b0339005b8 loplugin:sallogareas
Change-Id: I2220ab194384fb397716bf3227d38716ba54f537
2015-11-19 16:05:35 +01:00
Noel Grandin
d9e6270392 loplugin:unnecessaryvirtual
update the plugin with lessons learned from the mergeclasses plugin and
re-run it

Change-Id: I9d622eb3d05fceaf8fa764c533c8fa5dfb4c7711
Reviewed-on: https://gerrit.libreoffice.org/20015
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-17 12:26:32 +00:00
Samuel Mehrbrodt
40fa83871e Move CommandInfoProvider to vcl and use it from there
Change-Id: If7e3ef81cad8974bc54f359096e3ecc700fa62d6
Reviewed-on: https://gerrit.libreoffice.org/19984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-11-16 14:48:47 +00:00
Samuel Mehrbrodt
099f1016fa Cleanup: Consolidate the different ways to get command labels/tooltips
Change-Id: Ieab809a3122c9d592894b84ec2e68195a4e02dde
2015-11-16 08:08:09 +01:00
Oliver Specht
fa91dd31f3 5th step to remove tools/rtti.hxx
tools/rtti.hxx removed
completed the interface of some Sdr.*  Items
and removed pseudo items

Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a
Reviewed-on: https://gerrit.libreoffice.org/19837
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-11-11 10:49:30 +00:00
Stephan Bergmann
986c495052 Missing isInLokIncludeFile check
Change-Id: I6577987f3f3717337e6607ffbe38397f229978f0
2015-11-10 11:26:03 +01:00
Stephan Bergmann
1cd6e2e08e Keep LibreOfficeKit.hxx compatible with C++03
Change-Id: Ic2f123c9b341dbb421b766c3bba1fc56c1bfb41d
2015-11-10 11:08:30 +01:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Noel Grandin
382eb1a23c remove untyped Link<>
Change-Id: I809f9e10309ceadda0a82c3818277323b34ec61b
Reviewed-on: https://gerrit.libreoffice.org/19491
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-21 07:44:43 +00:00
Stephan Bergmann
bff4c13475 Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY code
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-10-12 17:52:26 +02:00
Stephan Bergmann
f94d4952dc Commit loplugin:returnunique to store/, for reference
Change-Id: I359d8ab47276e5c801522251d5e141946d94ca5d
2015-10-06 12:44:37 +02:00