Commit Graph
1039 Commits
Author SHA1 Message Date
Caolán McNamara 56f5a752f2 cid#704107 Unchecked return value
Change-Id: I6fb22b972a19b42787242d98d08fc425f5c0aea9
Reviewed-on: https://gerrit.libreoffice.org/75842
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-18 15:17:03 +02:00
Caolán McNamara 957afd1430 cid#704106 Unchecked return value
Change-Id: Ic0a9d173c24af8962539b00207b8dd24cbbcdbc0
Reviewed-on: https://gerrit.libreoffice.org/75841
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-18 15:16:50 +02:00
Eike Rathke 049189f49d Use LanguageTag::getFallbackStrings() instead of old dumb hard coded stuff
So finding correct offline help will actually work with language
tags containing scripts or variants.

Change-Id: I493041fbfe62dc7cd2e035592fe94ef9fe3c2480
Reviewed-on: https://gerrit.libreoffice.org/74855
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2019-06-28 20:49:29 +02:00
Eike Rathke 41cf4e6604 Fix Help collator loading, processLang() does not return only the language
... but a tag of an installed language, e.g. "en-US".
Adding a country then resulted in "en-US-US", used to load a
collator.

Further inspection of processLang() needed which can't work for
sr-Latn or ca-valencia, for example.

Change-Id: Id587ede738143c506da1ff2822aa605d0e7bee83
Reviewed-on: https://gerrit.libreoffice.org/74847
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2019-06-28 17:01:28 +02:00
Noel Grandin 4583911575 improve loplugin:simplifyconstruct
Change-Id: If863d28c6db470faa0d22273020888d4219e069e
Reviewed-on: https://gerrit.libreoffice.org/74559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25 13:53:21 +02:00
Noel Grandin 2836b78b54 loplugin:logexceptionnicely in xmlhelp..xmlsecurity
Change-Id: Idbf0de3f953b08f98144241346533ad30f49269e
Reviewed-on: https://gerrit.libreoffice.org/74285
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18 20:03:42 +02:00
Arkadiy Illarionov 54afdbd1b4 Simplify Sequence iterations in writerfilter, writerperfect, xmlhelp
Use range-based loops or replace with comphelper or STL functions

Change-Id: I9113e04d15ad84d0abac087afc627969e8ebc354
Reviewed-on: https://gerrit.libreoffice.org/73867
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-13 19:43:13 +02:00
Noel Grandin b52f309f2b improve loplugin simplifyconstruct
to find stuff like
   OUString s = OUString("xxx")

Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04
Reviewed-on: https://gerrit.libreoffice.org/70697
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-15 08:37:54 +02:00
Mike Kaganski 184be2d135 tdf#120703 PVS: remove redundant static casts
V572 It is odd that the object which was created using 'new' operator
     is immediately cast to another type.

Change-Id: I54976062dc3f62eaaa79f89eff54454f0b24ac2c
Reviewed-on: https://gerrit.libreoffice.org/69989
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-31 07:27:24 +02:00
Noel Grandin 6ed5464a69 loplugin:unusedfields in xmlhelp,xmlsecurity
Change-Id: Id3858365a54e6ae96bf9e6c3e27a777441ab56ae
Reviewed-on: https://gerrit.libreoffice.org/68133
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-21 12:04:47 +01:00
Noel Grandin 0d1253c232 new loplugin writeonlyvars
largely based on the relevant portion of the unusedfields loplugin, but
adapted for local vars

Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1
Reviewed-on: https://gerrit.libreoffice.org/66835
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11 13:25:31 +01:00
Noel Grandin 743d5604c2 loplugin:indentation in writerfilter..xmloff
Change-Id: Ibda157508e92ab5fb222daf79a38941c30a8057e
Reviewed-on: https://gerrit.libreoffice.org/67611
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11 07:01:24 +01:00
Gabor Kelemen 43635b474c o3tl::make_unique -> std::make_unique in tools..xmloff
Since it is now possible to use C++14, it's time to replace
the temporary solution with the standard one

Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26
Reviewed-on: https://gerrit.libreoffice.org/67474
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-08 12:30:06 +01:00
Noel Grandin 6239993d0d loplugin:constparams in ucb..xmlhelp
Change-Id: I3c1e0bfbba1a1849075500882133aac3899de5c8
Reviewed-on: https://gerrit.libreoffice.org/66834
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-24 13:02:31 +01:00
Noel Grandin eef4268f05 use unique_ptr in xmlhelp
Change-Id: Ic49bb1bc6591735562b0b23d821202bab00ceba2
Reviewed-on: https://gerrit.libreoffice.org/65533
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21 18:51:34 +01:00
Noel Grandin e4472d3c13 loplugin:unnecessaryparen include more assignments
Change-Id: I9fb8366634b31230b732dd38a98f800075529714
Reviewed-on: https://gerrit.libreoffice.org/64510
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05 07:49:30 +01:00
Noel Grandin dac1ff8b23 convert treeview::TVDom::Kind to scoped enum
Change-Id: Ia505df60f5758d40dd55bc5b24886fd8aec327ce
Reviewed-on: https://gerrit.libreoffice.org/64092
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27 14:42:02 +01:00
Noel Grandin 20831ee1c0 loplugin:useuniqueptr in ResultSetForQuery
Change-Id: Ie375f7fded2592cd1e926f14be0216608c2695d6
Reviewed-on: https://gerrit.libreoffice.org/63130
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-09 06:41:26 +01:00
Caolán McNamara 5145882f8f pvs-studio: The 'aIndexFolderResultVector' variable is used after it was moved
Change-Id: I565f22594a371188c4a6eff5f405946ec1e04d95
Reviewed-on: https://gerrit.libreoffice.org/62061
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-20 19:51:00 +02:00
Damjan Jovanovic 99c59c594f Set up our own libxslt security context in xmlhelp, as per #i117643.
Patch by: me

(cherry picked from commit ae1f34be5c9a49fae1eacdb3c1e5267acea53441)

Change-Id: I0e5277b17243f6b8f5f4303206cf446b10dd0aef
Reviewed-on: https://gerrit.libreoffice.org/61597
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Tested-by: Michael Stahl <Michael.Stahl@cib.de>
2018-10-10 10:30:57 +02:00
Stephan Bergmann 7ceee0f1ec Extend loplugin:redundantinline to catch inline functions w/o external linkage
...where "inline" (in its meaning of "this function can be defined in multiple
translation units") thus doesn't make much sense.  (As discussed in
compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions
in include files for now.)

All the rewriting has been done automatically by the plugin, except for one
instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus
some subsequent solenv/clang-format/reformat-formatted-files.

Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224
Reviewed-on: https://gerrit.libreoffice.org/61573
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-09 14:47:17 +02:00
Noel Grandin 52d0aca586 loplugin:useuniqueptr in TVChildTarget
Change-Id: I5d51df50a0c2279c52273254c451f3f21eaafbfb
Reviewed-on: https://gerrit.libreoffice.org/61112
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-01 08:16:46 +02:00
Noel Grandin 70c0c3b615 loplugin:useuniqueptr in xmlhelp::Databases
Change-Id: Idaf73fd5d12badbee58861c6ca3b087c16946b9c
Reviewed-on: https://gerrit.libreoffice.org/60615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18 11:52:24 +02:00
Stephan Bergmann 206b5b2661 New loplugin:external
...warning about (for now only) functions and variables with external linkage
that likely don't need it.

The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

returns 1, both moving just the struct S2 into an nunnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    namespace { struct S2: S1 { int f() { return 1; } }; }
    int f(S2 s) { return s.f(); }
  }
  int main() { return f(N::S2()); }

as well as moving just the function f overload into an unnamed namespace,

  struct S1 { int f() { return 0; } };
  int f(S1 s) { return s.f(); }
  namespace N {
    struct S2: S1 { int f() { return 1; } };
    namespace { int f(S2 s) { return s.f(); } }
  }
  int main() { return f(N::S2()); }

would each change the program to return 0 instead.

Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17 09:05:38 +02:00
Arkadiy Illarionov 87b24ddbba Simplify containers iterations in xmlhelp, xmlreader, xmlscript, xmlsecurity
Use range-based loop or replace with functions from std algorithm.

Change-Id: I5b1859da37c2a6c6e5e70602287bfc2ada951893
Reviewed-on: https://gerrit.libreoffice.org/60463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-15 09:06:38 +02:00
Noel Grandin 04e9a4c012 loplugin:constfields in xmlhelp
Change-Id: Ia8eda3075b0387ec3a5ed6267f1dfcfb3a8cf782
Reviewed-on: https://gerrit.libreoffice.org/60426
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13 14:37:36 +02:00
Gabor Kelemen 9784934cb9 tdf#42949 Fix IWYU warnings in include/ucbhelper/*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I7bfeef47abaf94cfb355db95c0fdb928ce36c0a6
Reviewed-on: https://gerrit.libreoffice.org/60232
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-13 09:04:55 +02:00
Noel Grandin 5cd976bdef loplugin:simplifyconstruct in writerfilter..xmlsecurity
Change-Id: Ic2d901ca0dbc2d6fa96611d260c1572da8a783c0
Reviewed-on: https://gerrit.libreoffice.org/60398
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13 08:30:22 +02:00
Noel Grandin cbf8f81156 loplugin:useuniqueptr in xmlhelp
Change-Id: I8a407e0492adf61e1d815cadd5da0a1623c2b23b
Reviewed-on: https://gerrit.libreoffice.org/60191
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-08 17:50:13 +02:00
Noel Grandin 5cb74685ba loplugin:useuniqueptr in chelp::DynamicResultSet
Change-Id: If9ffa025ba0ce9a1c97c89ec50e71e7f90c5435b
Reviewed-on: https://gerrit.libreoffice.org/59436
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22 13:24:24 +02:00
Noel Grandin d5415561e3 loplugin:stringloop in various
Change-Id: Ia400e67108e622ae63a8d59667eae96c858f22dc
Reviewed-on: https://gerrit.libreoffice.org/58463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-02 10:13:12 +02:00
Andrea Gelmini 7a3e7ee1c7 Fix typos
Change-Id: Iaa00d65b518b3e638c2d31912e247cb91bdd0950
Reviewed-on: https://gerrit.libreoffice.org/58347
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-07-31 09:56:01 +02:00
Gabor Kelemen 0132f27d4e Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories w* x*

Change-Id: I27bff44da3d34d24262031c7489e755311599bc5
Reviewed-on: https://gerrit.libreoffice.org/57307
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-12 10:40:25 +02:00
Noel Grandin 00850e3fa7 clean up UNO available() implementations
There seems to be some confusion here. available() is actually the
number of bytes that can be read without blocking, but most
implementations seems to be just returning the number of bytes remaining
in the stream. Since we're doing that, let's do it properly.

(*) some of them were just casting, instead of clamping, which will
return wrong values sometimes.
(*) FileStreamWrapper_Impl/OInputStreamWrapper/OTempFileService were
doing unnecessary work, instead of just asking the underlying SvStream
for it's remaining size

Change-Id: I3ef26e0363e989ed3e00be0fdb993e1cdeb7819f
Reviewed-on: https://gerrit.libreoffice.org/57264
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-11 12:55:47 +02:00
Arkadiy Illarionov 20c4a9ce69 tdf#96099 Remove some trivial container iterator typedefs
Change-Id: Ifec98748d55ff6aca64c425c50c2cf2650f61591
Reviewed-on: https://gerrit.libreoffice.org/56422
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-26 09:29:25 +02:00
Abhyudaya Sharma 251cb2a7b8 tdf#96099 Remove std::vector typedefs
Change-Id: Ic7e1cecaecadf3f9ebfa183727d61046dd87e473
Reviewed-on: https://gerrit.libreoffice.org/55260
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-06-07 07:28:54 +02:00
Noel Grandin 9ffdf7adc0 loplugin:unusedfields in tools..xmlhelp
Change-Id: I5e909a8def86ce9ad150440e6c6ad304e855cc69
Reviewed-on: https://gerrit.libreoffice.org/54415
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-17 08:39:51 +02:00
Noel Grandin 6a017237e0 loplugin:useuniqueptr in helpdatafileproxy::Hdf
Change-Id: I4324a290b826d76f89319f556aededb30d921f8d
Reviewed-on: https://gerrit.libreoffice.org/54166
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-14 11:09:58 +02:00
Jochen Nitschke 9401c7c28a remove unused processfactory.hxx includes
and fix fallout

Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee
Reviewed-on: https://gerrit.libreoffice.org/52206
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-01 12:11:26 +02:00
Noel Grandin 2f5868c430 loplugin:redundantfcast look for redundant copies in return statements
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008
Reviewed-on: https://gerrit.libreoffice.org/50996
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-12 07:37:24 +01:00
Noel Grandin 1fa230f73c loplugin:useuniqueptr in chelp::ResultSetBase
Change-Id: I6e8541837a07c8cf2e001289e0804d7e4e7ba3b1
Reviewed-on: https://gerrit.libreoffice.org/50658
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-05 07:27:00 +01:00
Mike Kaganski c7f1a8a872 xmlhelp: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I211a6f95f7146d7ffaa0c44af786c4474abc73f4
Reviewed-on: https://gerrit.libreoffice.org/49058
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-02 13:13:02 +01:00
Stephan Bergmann 5e3a76a830 More loplugin:cstylecast: xmlhelp
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: Ieee6d6e7246ac03e06a10455c8ad0aaf7caa48a9
2018-01-12 20:11:35 +01:00
Noel Grandin f14b9d3029 convert (a>b?a:b) to std::max(a,b)
with something like:
   git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2'

Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413
Reviewed-on: https://gerrit.libreoffice.org/47602
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-11 07:35:43 +01:00
Noel Grandin 21e0d8162a loplugin:unusedfields
fix the ReturnStmt check

Change-Id: I95076076bd1313d23798c4615ea12910c86ed9a8
Reviewed-on: https://gerrit.libreoffice.org/47309
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-04 07:17:23 +01:00
Noel Grandin e21ae87458 loplugin:passstuffbyref improved return in xmlhelp,slideshow
Change-Id: I57e235ecec733f1b5dd03f95f4e022769a369ae2
Reviewed-on: https://gerrit.libreoffice.org/47165
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-29 10:55:41 +01:00
Stephan Bergmann 6f4f5677ac No need to keep these whitelisted functions decorated with SAL_CALL
The only effect SAL_CALL effectively has on LO-internal code is to change non-
static member functions from __thiscall to __cdecl in MSVC (where all other
functions are __cdecl by default, anyway).  (For 3rd-party code, it could be
argued that SAL_CALL is useful on function declarations in the URE stable
interface other than non-static member functions, too, in case 3rd-party code
uses a compiler switch to change the default calling convention to something
other than __cdecl.  But loplugin:salcall exempts the URE stable interface,
anyway.)

One could argue that SAL_CALL, even if today it effectively only affects non-
static member functions in MSVC, could be extended in the future to affect more
functions on more platforms.  However, the current code would already not
support that.  For example, 3af500580b
"loplugin:salcall fix functions" changed FrameControl_createInstance in
UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even
though its address (in ctl_component_getFacrory, in the same file) is passed to
cppuhelper::createSingleFactory as an argument of type
cppu::ComponentInstantiation, which is a pointer to SAL_CALL function.

Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6
Reviewed-on: https://gerrit.libreoffice.org/46436
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14 13:03:06 +01:00
Eike Rathke 4094f9baf6 Attempt to blind fix build breaker
Change-Id: Ic20cc65b7fa78729d432fbf5e15fabe0e25cf627
2017-12-11 22:34:21 +01:00
Michael Stahl 8a3bb93562 tdf#114242 xmlhelp: fix crash in TVChildTarget::Check()
The ... idiomatic C++ code in TVChildTarget::Check() and
SearchAndInsert() handles ownership in non-obvious ways,
so it's not surprising that it took offense at the recent
conversion to std::unique_ptr.  Let's at least try to
prevent it from crashing so quickly.

(regression from 4b69497e36)

Change-Id: I0981707a61aee1733e727b1c00346d8ec524362e
2017-12-11 20:39:33 +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