314 Commits
Author SHA1 Message Date
Andrea Gelmini 6a1480506d Fix typos
Change-Id: I9d99aba8500ea31628e4b883974bb60181407647
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210562
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-10 22:08:01 +02:00
kelvin 1c7a8cb769 tdf#145614 Convert #define to constexpr in progressmonitor.hxx
Convert C-style #define constants to modern C++ constexpr for
better type safety and debugging.

Fixed build by using numeric color values instead of Color constructor.
Use sal_Int32 for consistency with usage in implementation.

Change-Id: I5691a2e2fe35da039bcc1f636b2498792d8aab9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193296
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2025-11-05 16:32:41 +01:00
codemaestro 09aa200bf0 tdf#158067: Replace O(U)StringLiterals with custom O(U)String literals
Change-Id: Iaef3a4906479e7b7735168eea5ff05f8497d132b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192687
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
2025-10-24 12:21:36 +02:00
Noel Grandin 30911c1a2b use more concrete UNO classes
Change-Id: I1425886c86f277930ad03c97fcb01fd7546235ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186518
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-06-15 20:32:31 +02:00
Noel Grandin 5a98bee1b8 use more concrete UNO classes
Change-Id: I9551b5739805c16bf3fd5b26812bd85bde7b17ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186517
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-06-15 18:25:32 +02:00
Noel Grandin 890513107e use more concrete UNO classes
Change-Id: I1b0c58a76da08c48fe967d27e34c2cc516d8cd16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186511
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-06-15 13:50:07 +02:00
Gabor Kelemen 681b1e5db9 Remove obsolete fw declarations from UnoControls/ unotools/ unoxml/ uui/
found with bin/find-unneeded-includes --fwdecl

Change-Id: I0cd96494bc3e2bdee4d1ed7ee14762d06b702f8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184007
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2025-05-20 08:10:27 +02:00
Mohamed Zaghloul 1d57a6f7fa tdf#145538 Replace loop with std::find_if
Refactor 'removeControl' method for improved readability and performance
while avoiding use of index-based-for-loop

Change-Id: Ib89e34dc69ff9f6cdfc94e500463163cd2466245
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183190
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2025-03-27 14:05:58 +01:00
Noel Grandin 22f46bd89f use more concrete UNO classes
Change-Id: Id10786bbf7985adbb251224b45f9dabcc84d0a3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182721
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-10 14:18:35 +01:00
Rahul Anand f92a82639a tdf#145759 Use symbolic constants instead of magic numerical constants
Change-Id: I97d63d576527bed7f07ade501a10027129dbf18d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181311
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2025-02-19 09:13:34 +01:00
Mike Kaganski f8aa78379c Simplify ProgressMonitor, StatusIndicator
Change-Id: I1c17fa54e865c2750407783adbb2f73c095dbbfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178094
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-12-08 17:49:59 +01:00
Mike Kaganski 05eb50c396 Simplify unocontrols::BaseControl hierarchy
Change-Id: I7c690cd429b2ac52f8aac602b4c9129bdd774b09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178052
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-07 22:14:59 +01:00
Mike Kaganski dcd7be141f XTopWindowListener is unused here
Change-Id: Ib4c1464d709c41f019d1910000e71075c9f5e037
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176310
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-11-09 19:33:09 +01:00
Mike Kaganski ce310aa33a Use OInterfaceContainerHelper4 per listener class for type safety
Change-Id: I919fef7e981d2dbdd69eb3cce34b3236dd6ed7ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176309
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-09 19:33:03 +01:00
Mike Kaganski 57b6d2d6f1 Make Multiplex do what it claims
Since the initial import, it used to only notify the first listener.
I guess it was just an overlook of using 'if' instead of 'while' in
the macro code, later flattened.

Change-Id: If2b769e71f937271c004a7152da751b26a2e0f24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176293
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-09 06:32:56 +01:00
Mike Kaganski 0f55739a75 Simplify using WeakImplHelper and OMultiTypeInterfaceContainerHelperVar4
Change-Id: Ib83b93d6055d3006eecdb25f1ccd7baf1251a40a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176284
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-11-08 20:41:23 +01:00
Noel Grandin 0c250130e5 remove dead code
since
    commit 9cef1d069a
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Tue Sep 12 13:32:21 2023 +0200
    loplugin:unodispose in UnoControls

Change-Id: I36b0bcdeb61dda176ac6778ef1116378d40531f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176264
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-11-08 14:06:38 +01:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Gabor Kelemen a98fd3a9ae tdf#146619 Drop unused 'using namespace' in: UnoControls/
Change-Id: I6739c80a76289b042607a5b50ac04482f65b5a40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165520
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-30 19:54:17 +01:00
Caolán McNamara 60150ef4b8 cid#1560054 use RVO
Change-Id: I04644c9ca78930d42289368b9a596f44a14b7012
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161746
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-08 10:04:05 +01:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...in include files.  This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.

Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-23 11:04:42 +02:00
Stephan Bergmann ce35697469 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: UnoControls
Change-Id: Ib8b380be99ae23f314f226be6c81bc62a08c13b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158141
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19 13:00:38 +02:00
Noel Grandin 9cef1d069a loplugin:unodispose in UnoControls
Change-Id: Id3cc80804b982cec04e288d0709c5d402e69860d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156841
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-12 14:57:24 +02:00
Mike Kaganski 5c1c768e12 Use getXWeak in UnoControls
Change-Id: I4e1deaffb3c6926bf57715cb10fc38bf59f791a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150880
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-27 15:20:51 +02:00
Stephan Bergmann 99ac0876bd Base BaseControl on WeakComponentImplHelper
...rather than on the deprecated OComponentHelper.

Various classes like BaseContainerControl, FrameControl, and ProgressBar, all
deriving from BaseControl, had been found to implement their respective
queryInterface in a way that is incompatible with the XAggregation protocol
inherited via OComponentHelper.  It looks like no code actually made use of the
XAggregation offered by this class hierarchy, so the easiest fix for those
queryInterface implementations appears to switch from OComponentHelper to
WeakComponentImplHelper.

Ideally, BaseControl would derive from WeakComponentImplHelper<XServiceInfo,
XPaintListener, XWindowListener, ...> covering all the UNO interface classes
from which it currently derives manually.  But changing that manual
implementation across the BaseControl class Hierarchy looks tricky, so merely
introduce an "empty" WeakComponentImplHelper<> for now and keep all the manual
stuff, and leave proper clean up for later.

Change-Id: I1aa8b06f78700008f844415818f4a5801daa89b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145902
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-20 17:18:27 +00:00
Gabor Kelemen 2b44f94908 Recheck modules [uU]* with IWYU
See tdf#42949 for motivation

Change-Id: If710445176681de8e0a0b6c65f58ecaca19dbccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132768
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-12 15:20:47 +02:00
VaibhavMalik4187 40bab1e31c tdf#145614 Convert #define to enum or constexpr
Change-Id: Ib6694ec77c275c9a604abfa7d87df6ab262449b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128250
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-01-19 06:55:12 +01:00
Noel Grandin 3152f5a33e use more cppu::BaseMutex
Change-Id: Iddd7438161ead93b27cf8e8058ca5b1eae3d8001
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-19 11:19:12 +01:00
Noel Grandin 6da12ca82d loplugin:stringliteraldefine in various
Change-Id: Ib482e3982128dc47d88a79478d80eef43745d1b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126086
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-30 14:07:26 +01:00
Mike Kaganski 2484de6728 Remove non-const Sequence::begin()/end() in internal code
... to avoid hidden cost of multiple COW checks, because they
call getArray() internally.
This obsoletes [loplugin:sequenceloop].

Also rename toNonConstRange to asNonConstRange, to reflect that
the result is a view of the sequence, not an independent object.

TODO: also drop non-const operator[], but introduce operator[]
in SequenceRange.

Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15 10:36:36 +02:00
Noel Grandin 3a1a448ac4 loplugin:constvars
Change-Id: I9b35d6333afa6b305bf73fc55a7e60c8365674e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122134
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15 12:43:21 +02:00
Noel Grandin 86abf3a682 create comphelper::OMultiTypeInterfaceContainerHelper2 and use it
based on OInterfaceContainerHelper2 which is considerably
faster than the original OInterfaceContainerHelper

Change-Id: I9c8b6d0e5382018824bf7188a26343703abf2d51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120161
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-07 21:34:33 +02:00
Noel Grandin 1597cc5b3e convert #defines to OUStringLiteral
mostly by doing

$ git grep -l '#define.*\"' -- *.cxx
    | xargs perl -pi -e
's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 =
u\2;/g'

Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02 14:43:58 +02:00
Noel Grandin 1296ded169 fix the mutex locking in impl_searchTopic
you cannot take a pointer to something inside a guard and then use that
data outside the guard.

So remove the broken locking here, and make sure the call sites hold the
lock.

Change-Id: I37cc363ff937243d7965844e8bcda0018085c656
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119370
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-22 18:50:49 +02:00
Noel Grandin d1de326b0b no need to use unique_ptr here
for such a small object

Change-Id: Idbcad7469b3871c05226e90b8d46223fe746cce2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119369
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-22 14:06:02 +02:00
Noel Grandin 159b8fb14f flatten vector in BaseContainerControl
no need to allocate the entries separately

Change-Id: I00c4abe75701685689eb7d09a97c349cb0271f1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119304
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-21 13:39:14 +02:00
Stephan Bergmann 10d29c390d throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewrite
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-02 17:02:28 +02:00
Noel Grandin c7c6f0af6c loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat

Also fix a crash in stringview plugin which
started happening while I working on this.

Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 14:07:56 +02:00
Noel b624b13b3d loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-26 18:02:19 +01:00
Noel 9bd8272706 loplugin:referencecasting in UnoControls..unoxml
Change-Id: I42f216b6115be693a4e57d70f6cbbf11b62ec185
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110998
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16 20:17:39 +01:00
Stephan Bergmann 4b55847b81 Improve loplugin:doubleconvert
(The use of isa_and_nonnull<> instead of isa<> is necessary for cases like

  return (i_styleSettings.*i_getDefaultColor)();

in lcl_getEffectiveColor, svtools/source/table/gridtablerenderer.cxx.)

Change-Id: Iffc59b1146dd4ce13bbd3c8a6f46bd3c78a39344
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109663
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-20 11:27:33 +01:00
Noel bca1b74c07 improve some IllegalArgumentException messages
Change-Id: Id88f2a82bf2651e8b5895aa330f32b71ff5b0e48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109546
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-20 09:03:45 +01:00
Noel 63a68064bb make the Color constructors explicitly specify transparency
to reduce the churn, we leave the existing constructor in place,
and add a clang plugin to detect when the value passed to the
existing constructor may contain transparency/alpha data.

i.e. we leave expressions like Color(0xffffff) alone, but
warn about any non-constant expression, and any expression
like Color(0xff000000)

Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16 10:07:07 +01:00
Noel bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
Noel 8ef6067596 loplugin:stringviewparam check methods too
not just functions

Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17 09:57:35 +01:00
Noel Grandin 33abb535a7 loplugin:flatten in UnoControls
Change-Id: I0702283083297fc956eb8bd5132a1144286e1fcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99968
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-02 22:45:48 +02:00
Noel Grandin 78639945da UnoControl: create instances with uno constructors
See tdf#74608 for motivation.

Change-Id: I3df173e3c7064d3d925d3abe5c652b8cbe6c8ea5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97892
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-04 08:32:56 +02:00
Noel Grandin d6c32cffb5 loplugin:simplifybool extend to expression like !(a < b || c > d)
mostly to catch stuff from the flatten work, but I think this looks good
in general

Change-Id: I7be5b7bcf1f3d9f980c748ba20793965cef957e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92493
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-30 10:49:51 +02:00
Gabor Kelemen e12fa18c69 tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/
Turns out we can save about 500Mb of preprocessor input if we use
rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper
rtl::math::approxEqual from rtl/math.hxx

and manage the fallout accordingly.

Before:
bin/includebloat.awk | head
sum total bytes included (excluding system headers): 19017296671

After:
$ bin/includebloat.awk | head
sum total bytes included (excluding system headers): 18535432672

Change-Id: I1691171f3a309405a7099882ad9989d147f59118
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-22 15:36:50 +02:00
Noel Grandin d9e4783302 loplugin:finalclasses in xmlsecurity..UnoControls
Change-Id: I8e942bf37c9173a01bef6e1403ca21f579e7f608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91612
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-03 11:37:53 +02:00