summaryrefslogtreecommitdiff
path: root/xmlhelp
AgeCommit message (Collapse)AuthorFilesLines
2019-10-28loplugin:stringadd improve detectionNoel Grandin1-5/+5
if one side of the expression is a compile-time-constant, we don't need to worry about side-effects on the other side Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b Reviewed-on: https://gerrit.libreoffice.org/81589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-24Introduce OStringCharStephan Bergmann1-14/+14
...similar to OUStringChar, to be used in string concatenation expressions. And enable the corresponding loplugin:stringadd check, and fix its findings. Change-Id: I35ebb2253ba82bda6c98ae6ebd2ad4f27cf9abf9 Reviewed-on: https://gerrit.libreoffice.org/81456 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remove some memset callsMike Kaganski2-2/+1
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remaining loplugin:bufferaddStephan Bergmann1-6/+1
...that had been missing because the plugin didn't implement postRun, so it didn't report anything when run as part of the shared plugin. (But did report the expected warnings when run as a standalone plugin during CompilerTest_compilerplugins_clang.) Most fixes are straightforward. A noteworthy one is PreparedStatement::setBytes in connectivity/source/drivers/postgresql/pq_preparedstatement.cxx: The old preallocation of a 20 character OStringBuffer might have prevented buf.append( reinterpret_cast<char *>(escapedString), len -1 ); from potentially throwing std::bad_alloc, which would have caused escapedString to be leaked. Even though that 20-character preallocation was likely just random junk and not meant to address the potential leak, lets address it now. Change-Id: Ib506332d061684a22a74e5e39e591539fd2c4900 Reviewed-on: https://gerrit.libreoffice.org/80925 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remove code that is deadStephan Bergmann1-9/+1
...ever since 8f55fe4c6c73f110b1c72903c209399ff2527ea5 "INTEGRATION: CWS help2" dropped p->application and "/" from strBuff. Change-Id: I48aa9271daac4caf23d932741a5c75cb00ad7ee9 Reviewed-on: https://gerrit.libreoffice.org/80924 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-16loplugin:stringadd look through a couple more known-good methodsNoel Grandin1-6/+4
Change-Id: Ifbdb3e41eae665f7dcaf5301aaba2b6e4662cf48 Reviewed-on: https://gerrit.libreoffice.org/80855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-11simplify "a = a +" to "a +="Noel Grandin1-1/+1
mostly so that my stringadd loplugin can point out places to improve Change-Id: I9920ee1c99cdb6b811ba67ff9d8e32aa261884b5 Reviewed-on: https://gerrit.libreoffice.org/80618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-29constmethod for accessor-type methodsNoel Grandin3-6/+6
Apply the constmethod plugin, but only to accessor-type methods, e.g. IsFoo(), GetBar(), etc, where we can be sure of that constifying is a reasonable thing to do. Change-Id: Ibc97f5f359a0992dd1ce2d66f0189f8a0a43d98a Reviewed-on: https://gerrit.libreoffice.org/74269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-27tdf#42949 Fix IWYU warnings in xmlhelp/Gabor Kelemen22-61/+16
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I266367d4f9e2b9bf637fc103a5e4876bd6b1d2b9 Reviewed-on: https://gerrit.libreoffice.org/79261 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-09-26add property name when throwing css::uno::UnknownPropertyExceptionNoel Grandin1-5/+5
Change-Id: I17f06c9415b9d43b6d8896360e07216c2856367a Reviewed-on: https://gerrit.libreoffice.org/79627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin1-2/+1
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-18tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet1-4/+1
in uui, xmlhelp Change-Id: I588ed4154e6b21e178f2466c58abc08562eddf80 Reviewed-on: https://gerrit.libreoffice.org/77663 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-17tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet2-7/+2
in ucb, xmlhelp Change-Id: I79f6378cff14c71987f77e0c08e0107bd4b3eefb Reviewed-on: https://gerrit.libreoffice.org/77623 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-15loplugin:sequenceloop in writerfilter..xmlhelpNoel Grandin2-2/+2
Change-Id: I7c9c911aa6b051eeab46344f25ea2919605de645 Reviewed-on: https://gerrit.libreoffice.org/77534 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-09Fix typosAndrea Gelmini1-1/+1
Change-Id: I545154bddfd29194630d744b4aa4f5c385321531 Reviewed-on: https://gerrit.libreoffice.org/77138 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): xmlhelpStephan Bergmann3-4/+4
Change-Id: Idd6533cce6e8710c245940b08a7d5fc0abfef84f Reviewed-on: https://gerrit.libreoffice.org/76624 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-28loplugin:oncevarNoel Grandin1-3/+1
Change-Id: I3c014f53607a849c743a2fd1aa47d03d5af978fb Reviewed-on: https://gerrit.libreoffice.org/76495 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-21loplugin:referencecasting in writerfilter..xmlhelpNoel Grandin2-4/+4
Change-Id: I84954e35f285d968e3a83591c476b3c814c2a13f Reviewed-on: https://gerrit.libreoffice.org/76033 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-18cid#704107 Unchecked return valueCaolán McNamara1-1/+1
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-18cid#704106 Unchecked return valueCaolán McNamara1-1/+1
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-06-28Use LanguageTag::getFallbackStrings() instead of old dumb hard coded stuffEike Rathke1-15/+15
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-28Fix Help collator loading, processLang() does not return only the languageEike Rathke2-26/+13
... 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-25improve loplugin:simplifyconstructNoel Grandin1-1/+1
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18loplugin:logexceptionnicely in xmlhelp..xmlsecurityNoel Grandin2-2/+4
Change-Id: Idbf0de3f953b08f98144241346533ad30f49269e Reviewed-on: https://gerrit.libreoffice.org/74285 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-13Simplify Sequence iterations in writerfilter, writerperfect, xmlhelpArkadiy Illarionov5-52/+36
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-04-15improve loplugin simplifyconstructNoel Grandin1-2/+1
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-03-31tdf#120703 PVS: remove redundant static castsMike Kaganski2-3/+3
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-02-21loplugin:unusedfields in xmlhelp,xmlsecurityNoel Grandin2-2/+1
Change-Id: Id3858365a54e6ae96bf9e6c3e27a777441ab56ae Reviewed-on: https://gerrit.libreoffice.org/68133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11new loplugin writeonlyvarsNoel Grandin1-3/+0
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-11loplugin:indentation in writerfilter..xmloffNoel Grandin3-20/+20
Change-Id: Ibda157508e92ab5fb222daf79a38941c30a8057e Reviewed-on: https://gerrit.libreoffice.org/67611 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen1-3/+2
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-01-24loplugin:constparams in ucb..xmlhelpNoel Grandin2-2/+2
Change-Id: I3c1e0bfbba1a1849075500882133aac3899de5c8 Reviewed-on: https://gerrit.libreoffice.org/66834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21use unique_ptr in xmlhelpNoel Grandin1-3/+3
Change-Id: Ic49bb1bc6591735562b0b23d821202bab00ceba2 Reviewed-on: https://gerrit.libreoffice.org/65533 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin1-1/+1
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27convert treeview::TVDom::Kind to scoped enumNoel Grandin1-5/+5
Change-Id: Ia505df60f5758d40dd55bc5b24886fd8aec327ce Reviewed-on: https://gerrit.libreoffice.org/64092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-09loplugin:useuniqueptr in ResultSetForQueryNoel Grandin1-7/+4
Change-Id: Ie375f7fded2592cd1e926f14be0216608c2695d6 Reviewed-on: https://gerrit.libreoffice.org/63130 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-20pvs-studio: The 'aIndexFolderResultVector' variable is used after it was movedCaolán McNamara1-1/+0
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-10Set up our own libxslt security context in xmlhelp, as per #i117643.Damjan Jovanovic1-7/+23
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-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann2-2/+2
...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-01loplugin:useuniqueptr in TVChildTargetNoel Grandin1-4/+3
Change-Id: I5d51df50a0c2279c52273254c451f3f21eaafbfb Reviewed-on: https://gerrit.libreoffice.org/61112 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18loplugin:useuniqueptr in xmlhelp::DatabasesNoel Grandin2-28/+19
Change-Id: Idaf73fd5d12badbee58861c6ca3b087c16946b9c Reviewed-on: https://gerrit.libreoffice.org/60615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann2-5/+9
...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-15Simplify containers iterations in xmlhelp, xmlreader, xmlscript, xmlsecurityArkadiy Illarionov2-24/+10
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-13loplugin:constfields in xmlhelpNoel Grandin9-19/+17
Change-Id: Ia8eda3075b0387ec3a5ed6267f1dfcfb3a8cf782 Reviewed-on: https://gerrit.libreoffice.org/60426 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13tdf#42949 Fix IWYU warnings in include/ucbhelper/*Gabor Kelemen4-0/+7
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-13loplugin:simplifyconstruct in writerfilter..xmlsecurityNoel Grandin3-9/+2
Change-Id: Ic2d901ca0dbc2d6fa96611d260c1572da8a783c0 Reviewed-on: https://gerrit.libreoffice.org/60398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-08loplugin:useuniqueptr in xmlhelpNoel Grandin2-14/+9
Change-Id: I8a407e0492adf61e1d815cadd5da0a1623c2b23b Reviewed-on: https://gerrit.libreoffice.org/60191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22loplugin:useuniqueptr in chelp::DynamicResultSetNoel Grandin3-5/+6
Change-Id: If9ffa025ba0ce9a1c97c89ec50e71e7f90c5435b Reviewed-on: https://gerrit.libreoffice.org/59436 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-02loplugin:stringloop in variousNoel Grandin1-2/+2
Change-Id: Ia400e67108e622ae63a8d59667eae96c858f22dc Reviewed-on: https://gerrit.libreoffice.org/58463 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-31Fix typosAndrea Gelmini1-1/+1
Change-Id: Iaa00d65b518b3e638c2d31912e247cb91bdd0950 Reviewed-on: https://gerrit.libreoffice.org/58347 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>