summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
AgeCommit message (Collapse)Author
2024-07-09loplugin:unusedenumconstantsNoel Grandin
Change-Id: Ifd22f5cc618137d715f78f0a04550256987752ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170186 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-09loplugin:unnecessaryvirtualNoel Grandin
Change-Id: Ibacb8bd52f5a9838540a68d238c3ed76eff6571b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-09loplugin:unusedenumconstants update for new clang AST nodeNoel Grandin
Change-Id: I5838f4fded09ad0f4eabc2dbf38ac2eb5c60777e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-29Fix "lets" -> "let's"Andrea Gelmini
Change-Id: I01968fc18b093dbbc27213f01c3da38ae151c62c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169748 Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net> Tested-by: Jenkins
2024-06-28Fix "lets" -> "let's"Andrea Gelmini
Change-Id: Ibe6cbbd618aab5c145913235dc90fec3c98cd504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169723 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-28improve lifecycle of SdrItemPoolNoel Grandin
I ran into a problem where this global object would be destroyed and then resurrected during shutdown. Rather than make the existing code more complex, extend the existing vcl::DeleteOnDeinit code and re-use that here. Change-Id: Ib63739f57f489b1131111e9bab1db5fba7fd17bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-26Missing includesStephan Bergmann
Change-Id: I519cdb9b5a1c475a1d36293b77c85c250baf3c3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169520 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-06-20loplugin:unusedfieldsNoel Grandin
Change-Id: I4bc67811e228b4806db9f9b9bf9fb0de0eb36de2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-19Fix typoAndrea Gelmini
Change-Id: Ic19939f0601ec60ca002da9aa02d0974f2db9ca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169216 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2024-06-18NFC cleanup duplicate entry in clang/buriedassign.cxxJustin Luth
amid lots of junk, found by sed -i -f ref.sed */*/*.cxx --------------------ref.sed -------------------- { N; s#\([^\n]*\n\)\1#\1#g; P; D; ------------------------------------------------- Change-Id: I2788c098d91b149a3728fd597ee227078ccfc038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169059 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2024-05-31Avoid --enable-compiler-plugins=debug loplugin:overrideparam TODO warningStephan Bergmann
> cui/source/factory/dlgfact.hxx:531:116: fatal error: TODO: Unexpected 'IdenticalDefaultArgumentsResult::Maybe' [loplugin:overrideparam] > 531 | const OUString& rName, const OUString& rDesc, const OUString& rTitle = u""_ustr) override; > | ^~~~~~~~ > include/svx/svxdlg.hxx:380:116: note: TODO: second argument is here [loplugin:overrideparam] > 380 | const OUString& rName, const OUString& rDesc, const OUString& rTitle = u""_ustr ) = 0; > | ^~~~~~~~ > MaterializeTemporaryExpr 0x1732504d0 'const OUString':'const class rtl::OUString' lvalue > `-ImplicitCastExpr 0x1732504b8 'const OUString':'const class rtl::OUString' <NoOp> > `-CXXBindTemporaryExpr 0x173250498 'OUString':'class rtl::OUString' (CXXTemporary 0x173250498) > `-UserDefinedLiteral 0x173250468 'OUString':'class rtl::OUString' > `-ImplicitCastExpr 0x173250450 'OUString (*)(void)' <FunctionToPointerDecay> > `-DeclRefExpr 0x173250430 'OUString (void)' lvalue Function 0x14a24f188 'operator""_ustr' 'OUString (void)' > MaterializeTemporaryExpr 0x14a250658 'const OUString':'const class rtl::OUString' lvalue > `-ImplicitCastExpr 0x14a250640 'const OUString':'const class rtl::OUString' <NoOp> > `-CXXBindTemporaryExpr 0x14a250620 'OUString':'class rtl::OUString' (CXXTemporary 0x14a250620) > `-UserDefinedLiteral 0x14a2505f0 'OUString':'class rtl::OUString' > `-ImplicitCastExpr 0x14a2505d8 'OUString (*)(void)' <FunctionToPointerDecay> > `-DeclRefExpr 0x14a24f298 'OUString (void)' lvalue Function 0x14a24f188 'operator""_ustr' 'OUString (void)' (Unfortunately, there appears to be no way to get at the actual string literal content here to check it for equality, so keep returning Maybe for now.) Change-Id: I4beac3c7f17a689488a41efe5da0554af7beff65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168246 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
2024-05-27False loplugin:staticmethods with LLVM 19 trunkStephan Bergmann
> In file included from libreofficekit/source/gtk/lokdocview.cxx:26: > In file included from include/vcl/event.hxx:28: > In file included from include/vcl/outdev.hxx:30: > In file included from include/vcl/bitmap.hxx:31: > In file included from include/vcl/region.hxx:26: > In file included from include/basegfx/polygon/b2dpolypolygon.hxx:27: > In file included from include/basegfx/range/b2drange.hxx:27: > In file included from include/basegfx/point/b2dpoint.hxx:27: > include/basegfx/tuple/Size2D.hxx:30:10: error: this member function can be declared static [loplugin:staticmethods] > 30 | TYPE getWidth() const { return Tuple2D<TYPE>::getX(); } > | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/basegfx/tuple/Size2D.hxx:32:10: error: this member function can be declared static [loplugin:staticmethods] > 32 | TYPE getHeight() const { return Tuple2D<TYPE>::getY(); } > | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/basegfx/tuple/Size2D.hxx:34:10: error: this member function can be declared static [loplugin:staticmethods] > 34 | void setWidth(TYPE const& rWidth) { Tuple2D<TYPE>::setX(rWidth); } > | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/basegfx/tuple/Size2D.hxx:36:10: error: this member function can be declared static [loplugin:staticmethods] > 36 | void setHeight(TYPE const& rHeight) { Tuple2D<TYPE>::setY(rHeight); } > | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...but no idea why exactly that started to hit me just now Change-Id: Ibb2b57b54b07461a50375ee64670ff21e4670b8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168082 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-05-21tdf#158803 compilerplugins: remove semicolons; improve membership checksLeonard Sasse
Change-Id: Ifd5fdee23e5adba2b5a667f74c38ba6fb28f54b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165446 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-05-11Drop now unused SdOptionsZoom classGabor Kelemen
Change-Id: I73100a18f9edb37bb93b7612e7e34fdf510a5308 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166630 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2024-05-11Drop now unused SdOptionsLayout, SdOptionsLayoutItem classesGabor Kelemen
Change-Id: I5d4e77f8377eead4581f590a4cc160a3fa97e2a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166601 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-05-09loplugin:mergeclasses updateNoel Grandin
(*) remove some debugging code (*) loosen constraints a little so I can see if there are more interesting opportunities (*) rename some local vars to make it read better (*) strip const/& modifiers from types before comparing (*) ignore vars/fields that are references, they do indicate that a class was instantiated Change-Id: I66014b8f0aa24c2e3ca34af75b75e6cd6c939ea6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167383 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-05Avoid loplugin:noexceptmove failure with recent Clang 19 trunkStephan Bergmann
> CallExpr 0x7fae572c85e0 '<dependent type>' > `-UnresolvedMemberExpr 0x7fae572c8580 '<bound member function type>' lvalue > `-DeclRefExpr 0x7fae572c8560 'WeakReference<reference_type>' lvalue ParmVar 0x7fae572c76d0 'rWeakRef' 'WeakReference<reference_type> &&' > In file included from tools/source/ref/ref.cxx:21: > include/tools/weakbase.hxx:52:5: error: what's up doc? [loplugin:noexceptmove] > 52 | rWeakRef.reset(); > | ^~~~~~~~~~~~~~~~ Change-Id: I5693fda3c4e5afb02e6229bcb8ea952a62f0e363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167157 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-05-04replace createFromAscii with OUString literals in swNoel Grandin
and adjust the loplugin:stringstatic to cope with OUString that is also declared in a header as extern, in which case we cannot mark it as constexpr. Change-Id: I108aa3ff8cb06a9a6d345cd951883b52dd0318f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167106 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-03fix crash in CertificateChooser for GPGMoritz Duge
mvUserData is still needed to keep it's content from being deleted. Revert "Drop unused instance variable." This reverts commit 687ae6ca01177a04f9ea715a1f1cd70f385a0840. Change-Id: I689cfdaf8d4d62a3b53ff7fb318dc8c70b9e1c2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167020 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Tested-by: Jenkins
2024-05-02Drop unused instance variable.Moritz Duge
Change-Id: Iee32e4348526e54e0cc45a54e55eddb6479248e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166968 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2024-04-28Drop CacheConfiguration in favor of officecfgGabor Kelemen
Also the key path was wrong in SlsCacheConfiguration.cxx: MultiPaneGUI/SlideSorter/PreviewCache but in Impress.xcs we have MultiPaneGUI/SlideSorterBar/PreviewCache hierarchy so this may actually now start to work :) Change-Id: I4b552be713e6e157edb45692ba78101429aa1c85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166755 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-23loplugin:singlevalfieldsNoel Grandin
Change-Id: I4d7b38c90d73a00f4dbc8ad7318fe4573328ed46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166503 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-22loplugin:constantparam filter out workdir/ stuff earlierNoel Grandin
Change-Id: I5b90bd855a74b03d534ce64689361b7417293a6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166422 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-19loplugin:constantparamNoel Grandin
Change-Id: I58e31ffdfc87a15e82bce54afd47ff3906159707 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-19loplugin:unusedfields update for new clang AST nodesNoel Grandin
Change-Id: Icc47093ab13123e9cb2866434796c7d6e8eb38d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-19Adapt to Clang 19 trunk isUnnamedBitfield -> isUnnamedBitField renameStephan Bergmann
<github.com/llvm/llvm-project/commit/3d56ea05b6c746a7144f643bef2ebd599f605b8b> "[clang][NFC] Fix FieldDecl::isUnnamedBitfield() capitalization" Change-Id: I198e19c00774ba111a441be2afe0b2a992cd6f0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166268 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-18move writerfilter inside swNoel Grandin
writerfilter wants to convert incoming RTF and OOXML files into writer's document model. But it currently has to do so by manipulating the limited subset that we expose through the UNO API. This is both slower and less accurate than having access to the full document model. So move it inside, and then we can strip out various hacks, and optimise imports. Change-Id: Ie1114d28130ef5f9a786531bc552cb8ee7768015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165953 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-08-Werror,-Wunused-but-set-variableStephan Bergmann
Change-Id: I4e4d3c810e9d37fd4b87d3307c2ba906923aa63b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165882 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-08-Werror,-Wunused-but-set-variableStephan Bergmann
...ever since the code got introduced in 4f5b3e4bd53d6d61df1f65f496f7bc8dc525c8a1 "In O[U]StringBuffer, make string_view params replacements for OUString ones" Change-Id: If2032db027f45c60f7c92b796a0a10d23f26b6e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165881 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-08-Werror,-Wunused-but-set-variableStephan Bergmann
...ever since the code got introduced in 77d083f2cbe496274cdab38a3a34497d1b742d86 "New loplugin:getstr" Change-Id: I3e0c7793c6e19e44d7450156aeb3cead3511faf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165880 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-04loplugin:unusedenumconstantsNoel Grandin
Change-Id: I889b4f63e098fecf22ffd4fb98937d62dbdd70b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-26loplugin:finalmethodsNoel Grandin
create a plugin that finds methods we can mark as final because they are not override in subclasses. Which is useful both as documentation (telling you that you don't need to worry about subclasses changing the implementation under you), and for performance, letting the compiler elide virtual calls in many cases. Apply the results to a subset of stuff in /include Change-Id: I7b5cc893ec2f343bc356bfc338e4cf531ffba1e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165054 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-22improve loplugin:staticmethodsNoel Grandin
Some of the exclusions were too aggressive. Restrict them to only the important classes, which exposes some more places this plugin applies. Change-Id: I1b2d1fb24391adc71ed0984f94168f61a149479f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165154 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-16tdf#142467: restore "final" in CandleStickChartType classKevin Suo
The "final" was removed in commit e06f2bb00137655dbf6f0a8c8c2fc555720f4d3f (tdf#142467 crash on calling 'getInfoHelper' in final class, 2021-05-26) and commit 6cb1745c24c7651050e30216860c539fa13cc0e2 (tdf#142467: Update comments with GCC bug ID, 2021-05-31) due to a bug in gcc <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100797>. Now it has been amost 3 years past and that gcc bug has long been fixed, so it is time to restore the "final". Change-Id: I7db9fe59209cfbae4c04bb3a91cd764db9a38d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163447 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-11Adapt to modified clang::PPCallbacks::InclusionDirectiveStephan Bergmann
...in LLVM 19 trunk <https://github.com/llvm/llvm-project/commit/da95d926f6fce4ed9707c77908ad96624268f134> "[clang][lex] Always pass suggested module to `InclusionDirective()` callback (#81061)" Change-Id: I85a4f60fb3e514d3372118da454402dff6ad45e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163229 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-08lok: calc: fix for rendering issues on in place editingMarco Cecchetti
Our main problem is how to compute the correct output area for the requested tile zoom level. The old solution was using a fine-tuned edit rectangle as output area. An edit rectangle is the rectangle computed according to the range of rows and columns involved in the text editing. Unfortunately in some cases the edit rectangle can be enough larger than the output area. For instance that occurs with centered text. The new proposed solution is able to scale the output area to the requested tile zoom level by a few pixels (0 up to 3) offset/size error. The hope is to reduce the error in some follow-up patch. The new solution is also able to perform painting of text edited by different views in the correct order. The last painted text is the one belonging to the last view where editing occurred. SfxViewShell::maEditViewHistory keeps track of the last 10 editing events per document. Change-Id: I8f1035a730cb2b94b0990f3c8eb6445511b94223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162196 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163031 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-07double operator < is not a strict weak ordering due to NaNStephan Bergmann
...so recent LLVM 19 trunk libc++ in debug mode complained during CppunitTest_chart2_export2 about > ~/llvm/inst/bin/../include/c++/v1/__debug_utils/strict_weak_ordering_check.h:59: assertion __comp(*(__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering at > 5 libsystem_c.dylib 0x0000000183279a40 abort + 180 > 6 libc++.1.0.dylib 0x00000001030f9d98 _ZNSt3__123__cxx_atomic_notify_oneEPVKv + 0 > 7 libchartcorelo.dylib 0x00000002f817f0ec _ZNSt3__135__check_strict_weak_ordering_sortedB8de190000INS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT_SB_RT0_ + 960 > 8 libchartcorelo.dylib 0x00000002f817e6cc _ZNSt3__118__stable_sort_implB8de190000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT0_SC_RT1_ + 268 > 9 libchartcorelo.dylib 0x00000002f8172a90 _ZNSt3__111stable_sortB8de190000INS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT_SB_T0_ + 68 > 10 libchartcorelo.dylib 0x00000002f8172820 _ZN5chart11VDataSeries15doSortByXValuesEv + 508 > 11 libchartcorelo.dylib 0x00000002f8064c44 _ZN5chart9AreaChart12createShapesEv + 1528 > 12 libchartcorelo.dylib 0x00000002f80f2ae0 _ZN5chart9ChartView28impl_createDiagramAndContentERKNS_18CreateShapeParam2DERKN3com3sun4star3awt4SizeE + 4440 > 13 libchartcorelo.dylib 0x00000002f80f77ac _ZN5chart9ChartView14createShapes2DERKN3com3sun4star3awt4SizeE + 2728 > 14 libchartcorelo.dylib 0x00000002f80f58ec _ZN5chart9ChartView12createShapesEv + 692 > 15 libchartcorelo.dylib 0x00000002f80f4598 _ZN5chart9ChartView15impl_updateViewEb + 288 But the introduced use of `std::strong_order(first[0], second[0]) < 0` then triggered a false > lo/core/chart2/source/view/main/VDataSeries.cxx:105:61: error: NullToMemberPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr] > 105 | return std::strong_order(first[0], second[0]) < 0; > | ^ so needed some hack in loplugin:nullptr. And old versions of libc++, still used at least on Android, do not have any implementations of std::strong_order. So detect those cases in configure.ac (checking for std::strong_order for double, which is what is actually being used in the code) and fall back to operator <=> for now, even if that will not provide a strict weak ordering and will thus continue to violate the requirements of std::sort. And then our venerable clang-format 5.0.0 would have broken the token `<=>` into `<= >`, so exclude include/o3tl/compare.hxx from its mis-treatment. Change-Id: I7a64a630eb5f560dce59f3ff9d51ca3d1adc70be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163075 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-02loplugin:unnecessarygetstr fix false +Noel Grandin
spotted in https://gerrit.libreoffice.org/c/core/+/162869 Change-Id: I87d9fdcfed5282f0e94fc8aa95a46054883fdd79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30lok: introduce NotebookBarViewManager and NotebookBarViewDataTomaž Vajngerl
NotebookBarViewManager is a singleton which is responsible to hold NotebookBar view specific data, which is kept in NotebookBarViewData class. The idea is to have one NotebookBarViewData class instance per one view (SfxViewShell instance). This also refactors the existing code and now moves the m_pWeldedWrapper, m_pNotebookBar and the m_pToolbarUnoDispatcher into NotebookBarViewData class. Change-Id: I32f5954fa9f1628acd9f5f9bd5760ac23ca687ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162706 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2024-01-29loplugin:unnecessarymethodsNoel Grandin
Change-Id: I3bc2bde431dc71d4a01f7e314c67be31271be9e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162681 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-21Adapt compilerplugins to Clang 18 trunk isPure -> isPureVirtual renameStephan Bergmann
...<https://github.com/llvm/llvm-project/commit/e90e43fb9cd1d305f7196cd526aa503374e0f616> "[Clang][NFC] Rename CXXMethodDecl::isPure -> is VirtualPure" Change-Id: I27b7cd40c84c71804bef396d0bff4ee2683cb3af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162345 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-16improve loplugin:cow_wrapperNoel Grandin
some stuff was hiding inside templates Change-Id: I89fd1a926dd6bf96e35a74e5028165acae51c60c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162159 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-16loplugin:unusedmethodsNoel Grandin
Change-Id: I24c429c7cb8283a384b72499d1c3f4c2f1457c33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162155 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-16loplugin:unusedfieldsNoel Grandin
Change-Id: Ic53aacfc76cb73902cf5e304153975fa02509da2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162110 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-15loplugin:unnecessaryvirtualNoel Grandin
Change-Id: I14ee125874b6f0f1ff5406a3eafea0b19df1a7f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162082 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-15Fix loplugin:singlevalfields handling of DesignatedInitExprStephan Bergmann
...as seen when building CompilerTest_compilerplugins_clang against recent LLVM 18 trunk libc++, > [CPT] compilerplugins/clang/test/singlevalfields.cxx > DesignatedInitExpr 0x1388bb790 'void' lvalue bitfield > `-MemberExpr 0x1388bb760 'const __alignment':'const enum std::__format_spec::__alignment' lvalue bitfield ->__alignment_ 0x1401d5868 > `-CXXThisExpr 0x1388bb750 'const __parser<_CharT> *' implicit this [...] > error: 'expected-error' diagnostics seen but not expected: > File /Users/stephan/llvm/inst/bin/../include/c++/v1/__format/parser_std_format_spec.h Line 499: oh dear, what can the matter be? [loplugin:singlevalfields] [...] Change-Id: I1cce598780bafc9306c9fbc42a1c98ff1f5450a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162075 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-12ITEM: No longer register Items at PoolArmin Le Grand (allotropia)
The issue is that the flag RegisteredAtPool at the SfxPoolItem is Pool-dependent: It marks that the Item is registeres at *one* Pool/Model. This makes it Pool-dependent. Due to this there is no way to share Items that need to be registered globally/ in multiple Pools/Models what is one of the goals for optimal sharing. We can also not live without having access to all Items associated with the Pool, due to mechanisms in place like the Surrogate stuff. This again is used for two purposes: (1) Access all Items associated with one Pool/Model, at least that is the assumption. This is not valid since it gets corrupted with a single ItemSet/Holder used that does not host model data, e.g. an open Dialog or the Sidebar (or...). But works in principle. (2) Access extra-Items that are held nowhere and are created using DirectPutItemInPool, e.g. infos for a Dialog. These would need a instance/place to host them, the Pool is (ab)used for that. Both are 'compromizes' (to not use a more bad word) and should not exist. (1) should iterate over the Model and do actions. There are even places that use (1) to *change* Items, by casting them to non-const, even RefCounted ones, so having no control over what all might be changed doing so. Since we talk about ca. 100+ places there is no way to get away from this - I can imagine how this happened: The 'poolable' attr traditionally needed for the old binary format was one day 'used' to not need to iterate over the Model, an API was added to access and this usage was copied. Sigh.. It is even used when ODF is loaded: E.g. the FillStyle is imported from XML, interpreted, and put into an ItemSet. Then it gets set at the XShape using UNO API and a *name* -> that name and the Surrogate mechanism is used to find and set the FillStyle at the Model Object. The FillStyle could probably just be set using UNO API and the data directly. The association between Model/Pool and Item is created by the object hosting the Item, these are ItemSets and ItemHolders. Thus it is possible to register these at the Pool. This allows to iterate and collect the Items associated with the Pool and keep the Surrogate mechanism alive. This is the main change done here. It limits the registrations to Items for which (at the Pool) the NeedsPoolRegistration is set, also Item-independent. Speed is okay, I saw no big changes in my tests here. The registration is just pointers, no ownership or RefCounting needed here. The advantage is that Items get closer to be shared office-wide, they can be referenced by multiple ItemSets (RefCnt) associated with different Pools/Models. NOTE: This is not true for SfxSetItems, these are and will stay Pool-dependent due to their need to a Pool in the contained ItemSet. Note that we have ca. six deivations of SfxSetItem, but ca. 500+ Item derivations, so not too bad. For the usages of Surrogates to change existing, RefCounted Items: These can now at least be changed - if they show up to be problematic - to iterate over the registered ItemSets and change Items there the correct way: Set a changed one at the ItemSet. That also allows Objects to *react* on ItemChanges, there is no way to do that with the existing 'compromize'... UnitTests show that this already works well for SC and SD, but SW has still some issues. I will put this to gerrit now, but there will be additional work. A involved problem is the current DefaultItem handling and the state the Pool implementation is in. E.g. StaticDefaults are not really static, Pools hard-delete the DefaultItems (forcing the RefCnt to zero to not have the destructor complain) and other quirks. Looking at that right now, hoping to get this change done without having to change that too much. I thought about adapting PoolItemTest to this, but it is only related to DirectPutItemInPool which is mostly gone and hopefully completely soon. Nonetheless I adapted that mechanism to use a list of SfxPoolItemHolder at the Pool. That makes it safe and abandons the need for indirect garbage collection removal at the Pool. Change-Id: Ib47f21dafa989202930919eace5f7e9c5632ce96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161896 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-03Drop now unused SvtSlideSorterBarOptions classGabor Kelemen
Change-Id: I9db309b15e490c9bd03e767c192ba364a4ffe214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161452 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-12-30SvtAccessibilityOptions no longer loads settingsGabor Kelemen
Change-Id: Ia7404122029b6b7c6fe7ff879bb1143b3419fc32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161239 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-12-24Remove listeners of SvtAccessibilityOptionsGabor Kelemen
This class no longer notifies listeners since 2019 commit 3135d820d0172ef5695a4b97cec505e6ad03d67a so presumably the listeners can be dropped as well. The sd part tried to execute SID commands which seem to be removed since 2004 commit f77ad7f15f53526714518bb3562ba7de4ba0d45e Change-Id: I81d234aabe10b53278c89ffd846240507854d0c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161237 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>