summaryrefslogtreecommitdiff
path: root/sdext
AgeCommit message (Collapse)Author
2019-02-18loplugin:simplifybool, check for !(!a op !b)Noel Grandin
Change-Id: Ic3ee9c05705817580633506498f848aac3ab7ba6 Reviewed-on: https://gerrit.libreoffice.org/67866 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13Indexing is not needed for single getToken() callMatteo Casalin
Change-Id: I38b916d217af05359754925f2ae68351486aa399 Reviewed-on: https://gerrit.libreoffice.org/67639 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-02-13OptimizerDialog: simplify string operations when selecting...Matteo Casalin
... image resolution: introduce local method to: * use indexed getToken * avoid getting all tokens in advance * reduce calls to non-trivial getString method Change-Id: Ib47c2e9bb5788132328fbda1b1dce05e495ad3ed Reviewed-on: https://gerrit.libreoffice.org/67638 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-02-12loplugin:flatten in sdextNoel Grandin
Change-Id: I5a7c2d38ef2e4af54316becd807bffab83d402d0 Reviewed-on: https://gerrit.libreoffice.org/67715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11new loplugin writeonlyvarsNoel Grandin
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-09loplugin:indentation in sdNoel Grandin
Change-Id: I8ce307b8c467ac1e3f19faca1df15a079bc14169 Reviewed-on: https://gerrit.libreoffice.org/67563 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-28o3tl::make_unique -> std::make_unique in sax...svtools (except sc)Gabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I6eea0877eaa1886b64c0cce06a43b8088cbccd8e Reviewed-on: https://gerrit.libreoffice.org/66751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-15poppler: upgrade to release 0.73.0Michael Stahl
Change-Id: If20998f8565b5534a96b3f29ccec572273edca1d Reviewed-on: https://gerrit.libreoffice.org/66306 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-15sdext: fix build with poppler 0.73Michael Stahl
... which has removed Guchar, Gushort, Guint, Gulong... Change-Id: Ia54ad378031f167f6779f6ffe574b85c1e72f26d Reviewed-on: https://gerrit.libreoffice.org/66305 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-08Fix build with poppler-0.72Andreas Sturmlechner
Change-Id: I0664d1b39e97b7555c0a3cba442db52b84f37134 Reviewed-on: https://gerrit.libreoffice.org/65960 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-12-21use unique_ptr in sdextNoel Grandin
Change-Id: I8362cf42dd6a838752b25a4b184da614eb81805e Reviewed-on: https://gerrit.libreoffice.org/65532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11presentation minimizer: warn user about unsaved presentationVasily Melenchuk
If minimizer is used on current presentation without making a copy and it has local modification we should suggest user to save it before, since not all minimization opearions could be reverted later. Change-Id: I12600c9a818698418f3ec957d43b13c6044609d2 Reviewed-on: https://gerrit.libreoffice.org/64261 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-12-10Fix build with poppler 0.71Aleksei Nikiforov
Change-Id: I470ece9dc4766e10e1ccb5e99b25a8d8cc4cbf38 Reviewed-on: https://gerrit.libreoffice.org/63860 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Remove misguided FALLTHROUGH commentsStephan Bergmann
...between adjacent switch labels without any intervening statements Change-Id: Ieb8a0d9f71ea4382b5f7d005cdf7111d06aeb5d0 Reviewed-on: https://gerrit.libreoffice.org/64789 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-07HAVE_BROKEN_CONST_ITERATORS is always false nowStephan Bergmann
...but for safety, leave the configure.ac check in for some longer. Change-Id: Ife94cdfd56696edb113e32d84f563dd805e757e5 Reviewed-on: https://gerrit.libreoffice.org/64769 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-06-Werror,-Wunused-variableStephan Bergmann
Change-Id: I8c59f7aa0cde22468c9451f7d910cf0106138fd7
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-03presentation minimizer: suggest filename for a new presentationVasily Melenchuk
If presentation was never saved suggested filename was empty. Right now it will show filename like "Untitled 1 (minimized)". Change-Id: I0077e6c9f2e86665f9de6d41fa434fd21167c779 Reviewed-on: https://gerrit.libreoffice.org/63876 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-12-03Simplify containers iterations in sdextArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: I760c1aaeae9afc99effee6a2645bb77439260ddf Reviewed-on: https://gerrit.libreoffice.org/64435 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-01tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: I38f3e3243f8cb891c9a0fe2f4c68bc76acd1ef44 Reviewed-on: https://gerrit.libreoffice.org/64020 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-29loplugin:stringconstant look for unnecessary OString constructor useNoel Grandin
and tweak the methods in check.hxx to make them more flexible when called with dc.Class(xxx ? "foo" : "bar") Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1 Reviewed-on: https://gerrit.libreoffice.org/64207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27tdf#42949 Fix IWYU warnings in include/vcl/[f-h]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice2eb8c5994bf2ccb88972332ca4a1d3ed41752a Reviewed-on: https://gerrit.libreoffice.org/63826 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-25tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae Reviewed-on: https://gerrit.libreoffice.org/63981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-22remove unused enums DocumentTextDirection and RendererPaneStyle::SideNoel Grandin
Change-Id: I5409a1b1ea3e7619bd1dc4a430c65987269f6204 Reviewed-on: https://gerrit.libreoffice.org/63753 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-20poppler dropped GBool since 0.71Mike Kaganski
See https://lists.freedesktop.org/archives/libreoffice/2018-November/081410.html Change-Id: I258e08894486a925bed50a3a4232b6e805af6784 Reviewed-on: https://gerrit.libreoffice.org/63625 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-16loplugin:staticmethods improvementNoel Grandin
Change-Id: I8889ce8a7d2309b54454cfe4c6421282e1c6e755 Reviewed-on: https://gerrit.libreoffice.org/63434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08Resolves: rhbz#1647507 try inputted password as both user and owner passwordCaolán McNamara
Change-Id: Ibe1fae39d3153238e85400c9645766c260c9290d Reviewed-on: https://gerrit.libreoffice.org/63080 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-07loplugin:collapseif in sdext..svxNoel Grandin
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f Reviewed-on: https://gerrit.libreoffice.org/62985 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-06presentation minimizer: fixed problem with default filenameVasily Melenchuk
According to code, it is expected that minimized copy of presentation is proposed with ".mini" suffix as default, but this does not works right now. As a solution a new localized prefix "(minimized)" is added to filename. Change-Id: If869c70a5885a9c917fc7254aa8b0d164a6f5a50 Reviewed-on: https://gerrit.libreoffice.org/62781 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-11-05presentation minimizer: use standard error reportingVasily Melenchuk
Insead of custom error dialogs try to use standard LO error reporting & localization Change-Id: I199c7770dd884a6c5d9b22075d22ab9a9f2037a8 Reviewed-on: https://gerrit.libreoffice.org/62779 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-11-01clang-tidy: (WIP) bugprone-too-small-loop-variable findingsTamás Zolnai
Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561 Reviewed-on: https://gerrit.libreoffice.org/62701 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-10-27tdf#120703 PVS: V519 variable is assigned values twice successivelyMike Kaganski
V519 The 'aNewTextBoundingBox.Y2' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 409, 411. I have tried to check if that could possibly be a typo, and X1 was meant, but it seems to be not the case here (doing that, or putting anything to X1 instead of 0, just displaces the notes in the presenter console wrong vertically). Change-Id: Ie686b69bddc193568c1b5c0d18b9b7bf547313d1 Reviewed-on: https://gerrit.libreoffice.org/62410 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-23remove old poppler compat codeNoel Grandin
since we require poppler >= 0.12.0 Change-Id: Ie698ecbe776d12ef21ba8f12ac4dfa0575ed467b Reviewed-on: https://gerrit.libreoffice.org/62223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22pvs-studio: V571 Recurring checkCaolán McNamara
Change-Id: I1ad7bcfa557b38488adf26b434433e6bae259f43 Reviewed-on: https://gerrit.libreoffice.org/62190 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-21tdf#120703 (PVS): redundant nullptr check; unsafe pointer dereferenceMike Kaganski
V668 There is no sense in testing the 'mpTheme' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. V1004 The 'mpFont' pointer was used unsafely after it was verified against nullptr. Check lines: 879, 881. Change-Id: I47627de2cd98d3bb36e1ced7346ebe9177c21e65 Reviewed-on: https://gerrit.libreoffice.org/62141 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-20tdf#120703 (PVS)Mike Kaganski
V1023 A pointer without owner is added to the 'm_aSubElements' container by the 'emplace_back' method. A memory leak will occur in case of an exception. V560 A part of conditional expression is always true: !pNum. V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer '* pOutBuf' is lost. Consider assigning realloc() to a temporary pointer. V586 The 'delete' operator is called twice for deallocation of the same memory space. V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 867, 869. Change-Id: I2832bf7228914b48cf2c5178ed9c0719b53c883c Reviewed-on: https://gerrit.libreoffice.org/62040 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy modernize-redundant-void-argNoel Grandin
Change-Id: Ia25ac2e40f29e5b766a4c5c013fb53274196f656 Reviewed-on: https://gerrit.libreoffice.org/61934 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12drop some unused headersCaolán McNamara
Change-Id: If7cedab43231103f7435ce57a0eb3a4d047becb4 Reviewed-on: https://gerrit.libreoffice.org/61714 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...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-09loplugin:constfields in sdextNoel Grandin
Change-Id: Ief438d98b8117a7759282323e47c8b5283d6762a Reviewed-on: https://gerrit.libreoffice.org/61552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27loplugin:methodcycles more graph theory for the winNoel Grandin
implemeent a reduction approach, which is good at finding virtual methods that only themselves or their virtual partners. The accessibility GetVisArea stuff is dead since commit 891e41fac81fbd8d5cdb277b26639abfd25a7143 Date: Wed Apr 4 11:23:22 2018 +0200 dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5 Reviewed-on: https://gerrit.libreoffice.org/60912 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...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-13new loplugin simplifyconstructNoel Grandin
no need to init smart pointers with nullptr, they all have default constructors that do this already Change-Id: Ief20c060daa0def8c1aa82f1cf8dc4bc696761e9 Reviewed-on: https://gerrit.libreoffice.org/59818 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11loplugin:unusedmethodsNoel Grandin
Change-Id: I34009aabf0befb346470b5c0d96ad8fc476b7c4e Reviewed-on: https://gerrit.libreoffice.org/60300 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-05loplugin:useuniqueptr in PngHelper::createPngNoel Grandin
Change-Id: I55ec28c88a89eab927a46ec666c3698065b151d2 Reviewed-on: https://gerrit.libreoffice.org/59995 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>