summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
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-03-13tdf#160180: bump copyright year to 2024Julien Nabet
Change-Id: I466b8f86e8a53a238ed2ce2d2b053dc519ff8eed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164794 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Julien Nabet <serval2412@yahoo.fr>
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>
2023-12-18-Werror,-Wdeprecated-declarationsStephan Bergmann
> compilerplugins/clang/casttovoid.cxx:452:18: error: 'endswith' is deprecated: Use ends_with instead [-Werror,-Wdeprecated-declarations] > .endswith(".h")); > ^~~~~~~~ > ends_with > ~/llvm/inst/include/llvm/ADT/StringRef.h:276:19: note: 'endswith' has been explicitly marked deprecated here > [[nodiscard]] LLVM_DEPRECATED( > ^ etc. after <https://github.com/llvm/llvm-project/commit/5ac12951b4e9bbfcc5791282d0961ec2b65575e9> "[ADT] Deprecate StringRef::{starts,ends}with (#75491)" on Clang 18 trunk, where <https://github.com/llvm/llvm-project/commit/1b97645e56bf321b06d1353024339958b64fd242> "[ADT] Introduce StringRef::{starts,ends}_width{,_insensitive}" had been added towards Clang 16 Change-Id: Icb3e43b7d6be6f877815285913d846f766eddebf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160919 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-13loplugin:unusedfieldsNoel Grandin
The sPassword field in SvtHistoryOptions became redundant after commit c0fffdc36df687fe8e4eff49e5a00d3a3c1eb370 Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Mon Oct 2 12:35:21 2023 +0200 [API CHANGE] Remove deprecated Password config item Change-Id: Ie0c4597da5cd510f405400c215110c1e357cb497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-13loplugin:unusedmethodsNoel Grandin
Change-Id: Id0aed0077ed121fdaef574248427a3425248e7d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-11-Werror,-Wdeprecated-declarationsStephan Bergmann
> compilerplugins/clang/pluginhandler.cxx:67:71: error: 'getName' is deprecated: Use FileEntryRef::getName() instead. [-Werror,-Wdeprecated-declarations] > 67 | compiler.getASTContext().getSourceManager().getMainFileID())->getName()); > | ^ > ~/llvm/inst/include/clang/Basic/FileEntry.h:331:3: note: 'getName' has been explicitly marked deprecated here > 331 | LLVM_DEPRECATED("Use FileEntryRef::getName() instead.", "") > | ^ > ~/llvm/inst/include/llvm/Support/Compiler.h:155:50: note: expanded from macro 'LLVM_DEPRECATED' > 155 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX))) > | ^ > compilerplugins/clang/pluginhandler.cxx:355:35: error: 'getName' is deprecated: Use FileEntryRef::getName() instead. [-Werror,-Wdeprecated-declarations] > 355 | StringRef const name = e->getName(); > | ^ > ~/llvm/inst/include/clang/Basic/FileEntry.h:331:3: note: 'getName' has been explicitly marked deprecated here > 331 | LLVM_DEPRECATED("Use FileEntryRef::getName() instead.", "") > | ^ > ~/llvm/inst/include/llvm/Support/Compiler.h:155:50: note: expanded from macro 'LLVM_DEPRECATED' > 155 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX))) > | ^ since <https://github.com/llvm/llvm-project/commit/d1f86c3d03b7549eb0153c62550ef0f513ff50e8> "[clang] NFC: Deprecate `FileEntry::getName()` (#68157)" on LLVM 18 trunk. (clang::SourceManager::getFileEntryRefForID exists since <https://github.com/llvm/llvm-project/commit/4dc5573acc0d2e7c59d8bac2543eb25cb4b32984> "Introduce FileEntryRef and use it when handling includes to report correct dependencies when the FileManager is reused across invocations" towards Clang 10, even when it changed its return type from Optional<FileEntryRef> to OptionalFileEntryRef along the way.) Change-Id: Ie37ba20c18f5ec33bab9ca2a96a9bcf722558c7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160561 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-30Extended loplugin:ostrStephan Bergmann
Change-Id: I987d6d60ca2d1e8ed8b8cde1e0c7996c0fff71b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160006 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-25loplugin:fieldcast in DomainMapper_ImplNoel Grandin
Change-Id: I1d734e1d30b91b84d42067b9cc621581ad744a40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-25loplugin:fieldcast in SwOneExampleFrameNoel Grandin
Change-Id: Ic00ad388b2c18d90075db8e8d0d6b114ed13841a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-24loplugin:fieldcast in ScXMLImportNoel Grandin
Change-Id: I0820427504d0cb9e14b54bb92a2e383bf0137121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-24loplugin:fieldcast in oox::xls::PivotTableNoel Grandin
Change-Id: Ie50626b2e24bba2ee67827afcdf42c1c0ed2c9d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159870 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23loplugin:fieldcast in DbGridControlNoel Grandin
Change-Id: I87b1aa0326cbd4270ca54831b3388a5da9c9416d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159842 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23loplugin:fieldcast in LayoutManagerNoel Grandin
Change-Id: I3fc7a2c690344ee6934111cdffc0b23ff2537b44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159841 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23loplugin:fieldcast in LayoutManagerNoel Grandin
Change-Id: Ib0b56703cd6782d850ab5960a7fa53d15eb443a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23loplugin:fieldcast in BindingNoel Grandin
Change-Id: Ia4bb341dba0c853b53c42a36fcb472e5948f1708 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159839 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-22loplugin:fieldcast in SwTransferableNoel Grandin
Change-Id: I8e9f157a399f1b305d2e6b6e63da837f0090fd8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-15Extend a loplugin:ostr check from OUString to OStringStephan Bergmann
Change-Id: I0776ab0ab376d6181461d2c144a4107b06233829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159470 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-15Add back test for struct initializationStephan Bergmann
...that had been removed as part of f99bee8103ad82dac2e53e114527399c4af5485c "Delete OUString UTF-16 string literal ctor/assignment op" Change-Id: I22423306ab35dcb580ecc90daea3219b6c1578b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159446 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-15loplugin:unusedmethodsNoel Grandin
Change-Id: I1e125bbd388953491b3f869641484fea737d39ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159423 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-14loplugin:unusedfieldsNoel Grandin
Change-Id: I5869e9974c37b1b525d316367f1dc5051d8aa197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159404 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-14Adapt compilerplugins/clang/test/fieldcast.cxx to clang-clStephan Bergmann
...where loplugin:locking2 is disabled Change-Id: Id58cbedab191c59b901ef1a0e0dd82b8f8438c4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159400 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-11loplugin:fieldcast improvementsNoel Grandin
reduce false positives, and also check reinterpret_cast Change-Id: Ia6f214393f28451d18c16b764a3c2b149d29ba8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-09Fix typoAndrea Gelmini
Change-Id: I3933be04cacda3dd271c20b2248561da85a069b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159190 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-08Adapt expected diagnostic output to clang-cl and the MSVC standard libraryStephan Bergmann
Change-Id: Ie416e4170280b9f05ecac359655e71f65a525592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159131 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08Adapt compilerplugins/clang/test/locking2.cxx to clang-clStephan Bergmann
...where loplugin:locking2 is disabled Change-Id: Ie6a241ac49670e47001cba67c7af9996623a23ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159109 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08Adapt loplugin:stringconcatliterals to clang-clStephan Bergmann
...whose handling of PredefinedExpr (representing `__func__`) deliberately differs in IgnoreParens and IgnoreParenImpCasts, see the comment in StringConcatLiterals::isStringLiteral Change-Id: I8b001d65369adc3d2a2c47e0cf32578a72ef4eec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159111 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08new loplugin:fieldcastNoel Grandin
new plugin to look for class fields that are always cast to some subtype, which indicates that they should probably just be declared to be that subtype. Perform one of the suggested improvements in xmlsecurity/ Change-Id: Ia68df422c37f05cbcf9c02ba5d0853f8eca4f120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159063 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-06Adapt to various Clang 18 trunk enum reworkStephan Bergmann
<https://github.com/llvm/llvm-project/commit/a9070f22a29e28f7d6f83c24a8dd88f3a94969ae> "[clang][NFC] Refactor `CXXConstructExpr::ConstructionKind`", <https://github.com/llvm/llvm-project/commit/c23aaa410358b9f9c364ddaaeb6b2069b185a99b> "[clang][NFC] Refactor `CharacterLiteral::CharacterKind`", <https://github.com/llvm/llvm-project/commit/3e6ce58701a3a8463b53fb3fd2023c02b4e90554> "[clang][NFC] Refactor `StringLiteral::StringKind`", <https://github.com/llvm/llvm-project/commit/edd690b02e16e991393bf7f67631196942369aed> "[clang][NFC] Refactor `TagTypeKind` (#71160)" Change-Id: Ice802f6d662494781ad22fcf11ea5006de918254 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158983 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-06lok: notebookbar: handle multiple sessionsSzymon Kłos
This fixes regression from commit db5a78c8ab1eae30e442151f07b0dc4dcd017550 lok: notebookbar: don't recreate toolbars too often When we had 2 sessions with notebookbar and one of them switched to compact mode - other session's notebookbar didn't work. Before previous change we recreated notebookbar and its welded wrapper on every StateMethod call for LOK case. So when it become destroyed we made it working again. But now we need to introduce better management and not rely on single instence we get from SystemWindow. Also it's bad idea to rely 100% on SfxNotebookBar::IsActive in LOK case as when other view will turn notebookbar off, but QueryState will be trigerred in our session - we will think that it should be destroyed (it reads config state which is shared between views). So trust only "true" value (it happens after calling SID_TOOLBAR_MODE), but destroy notebookbar only after explicit call of SfxNotebookBar::CloseMethod. It seems to have good result when tested with multiple views in Online. Maybe we can track Notebookbar state per view later to make things simpler in LOK case. Change-Id: Ie739c6441ca05884b0ef20bff23751467706b562 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158936 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-11-05loplugin:ostr: Warn about literals that could be string_viewStephan Bergmann
...inspired by d4f4a401861e7c908b6ab7f72563d5ab911edcf0 "This function takes a string view - no need in OUString literal", but this found no further cases Change-Id: I1429950afdb6fff8ed1d28f5fbb4c445fb6bfb12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158954 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-04Adapt to Clang 18 trunk Linkage reworkStephan Bergmann
<https://github.com/llvm/llvm-project/commit/8775947633bf189e1847707932b1015f04640ea0> "[clang][NFC] Refactor clang::Linkage" Change-Id: I35e3a3c7e3de29e4f3b9ee8dfc34e39ba2aa1c70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158919 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-03Suppress loplugin:redundantfcast also around C++20 CXXParenListInitExprStephan Bergmann
...which is used by <https://github.com/llvm/llvm-project/commit/95a4c0c83554c025ef709a6805e67233d0dedba0> "[clang] Reland parenthesized aggregate init patches" for the __cpp_aggregate_paren_init feature implemented since Clang 16, and which had caused bogus warnings in patch set 1 of <https://gerrit.libreoffice.org/c/core/+/158838/1> "tdf#157028 vcl: PDF export: inline OBJR dictionaries" Change-Id: Id4118ce8d53902388ca3a80ad03f12b59e3a35e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158842 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>