187 Commits
Author SHA1 Message Date
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
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
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 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
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
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 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
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
Gabor Kelemen d3e1ada454 Remove unused using declarations in oox...xmlsecurity
Found by:
run-clang-tidy-10 -checks=-*,misc-unused-using-decls

Change-Id: I3e95791e223ef01e140a6217e29a9efae428a784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90876
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-25 09:13:27 +01:00
nienzu d8fe52d759 tdf#42982 add detail exception reason for UnoControls
Change-Id: Ia62a0015d68fe819113322e27b93054d38d98aea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88996
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-19 12:31:30 +01:00
Stephan Bergmann 314f15bff0 Extend loplugin:external to warn about enums
To mitigate the dangers of silently breaking ADL when moving enums into unnamed
namespaces (see the commit message of 206b5b2661
"New loplugin:external"), note all functions that are affected.  (The plan is to
extend loplugin:external further to also warn about classes and class templates,
and the code to identify affected functions already takes that into account, so
some parts of that code are not actually relevant for enums.)

But it appears that none of the functions that are actually affected by the
changes in this commit relied on being found through ADL, so no adaptions were
necessary for them.

(clang::DeclContext::collectAllContexts is non-const, which recursively means
that External's Visit... functions must take non-const Decl*.  Which required
compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support
such Visit... functions with non-const Decl* parameters.)

Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd
Reviewed-on: https://gerrit.libreoffice.org/83001
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-17 00:28:17 +01:00
Noel Grandin 8e2e03b1c3 loplugin:duplicate-defines in UnoControls
these are only used by internal code, so move inside the relevant .cxx
file

Change-Id: If7cdf17a49ff3089ad2100961092dd2747523a8d
Reviewed-on: https://gerrit.libreoffice.org/79830
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-30 13:12:43 +02:00
Noel Grandin 0bb521f4f9 loplugin:returnconstval in UnoControls
Change-Id: I6e855ee6dc2075334e92803d87e660f389b54d53
Reviewed-on: https://gerrit.libreoffice.org/78055
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-24 16:12:11 +02:00
Stephan Bergmann 40c250cae0 Improved loplugin:stringconstant (now that GCC 7 supports it): UnoControls
Change-Id: I4f24cb6e5c44b27dc0fc85ddadedb7a93b4e5eb4
Reviewed-on: https://gerrit.libreoffice.org/76701
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31 13:01:42 +02:00
Noel Grandin 01782ecd9f loplugin:referencecasting in various
Change-Id: Id4e3d9d1bbfd47181299568afec45e996eb1eed5
Reviewed-on: https://gerrit.libreoffice.org/76071
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-21 16:04:20 +02:00
Gabor Kelemen 55961e110f tdf#42949 Fix IWYU warnings in UnoControls/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Id088a2c8a91c2fe7c8ff9e05d910d5b5e9383b7c
Reviewed-on: https://gerrit.libreoffice.org/72095
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-17 09:21:49 +02:00
Mike Kaganski f3fc127dc0 Use osl_atomic_increment/osl_atomic_decrement to change m_refCount
Change-Id: Ia24441d3671102fdeeb797547396c25ee2a6ffd3
Reviewed-on: https://gerrit.libreoffice.org/70382
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-08 05:32:56 +02:00
Mike Kaganski 5a824268df Don't use resettable/clearable guard where plain guard is enough
Also use scope where possible. This allows to limit guard scope at
language level; visualises the scope clearly; and helps avoiding
errors like fixed in commit 61e4437c85.

Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41
Reviewed-on: https://gerrit.libreoffice.org/70376
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-07 17:53:04 +02:00
Andrea Gelmini d1496ca658 Fix typo
Change-Id: I7831896b8898f0cb20589fbd241b97fcc21db366
Reviewed-on: https://gerrit.libreoffice.org/70108
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-03 07:51:12 +02:00
Andrea Gelmini 94ac464dd5 Fix typo
Change-Id: I546735f427a47d9ada1589e1861d0cf696788b05
Reviewed-on: https://gerrit.libreoffice.org/70107
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-03 07:49:47 +02:00
Andrea Gelmini 11c40f5b75 Fix typo
Change-Id: I907b28c98133162a31835ebaeae6244dc8735752
Reviewed-on: https://gerrit.libreoffice.org/70106
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-03 07:47:44 +02:00
Andrea Gelmini 4852ca0f86 Fix typo
Change-Id: I794be89bed433e813feaecffce9464d087ddde61
Reviewed-on: https://gerrit.libreoffice.org/70105
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-03 07:07:13 +02:00
Noel Grandin 74ed61e793 loplugin:indentation in UnoControls..accessibility
Change-Id: Ib58ac1c7171331eac543eba7b5f7bae8fa04ae4d
Reviewed-on: https://gerrit.libreoffice.org/67524
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08 10:02:05 +01:00
Noel Grandin b3c449b74f loplugin:useuniqueptr in impl_getWindowDescriptor
return by value, the usual C++ optimisations will make this efficient

Change-Id: I7f9634b9663605504c69e0381a6ebc9c76061048
Reviewed-on: https://gerrit.libreoffice.org/62645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-31 07:30:39 +01:00
Noel Grandin c8fa03b1f5 new loplugin:stringloop, and applied in various
look for OUString being appended to in a loop, better to use
OUStringBuffer to accumulate the results.

Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b
Reviewed-on: https://gerrit.libreoffice.org/58092
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27 11:15:46 +02:00
Noel Grandin 2e0cf81467 loplugin:useuniqueptr in ProgressMonitor
Change-Id: Ic66e49037c04501a2c39a69f3f8a2a03cb10b5fc
Reviewed-on: https://gerrit.libreoffice.org/52884
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16 08:22:07 +02:00
Stephan Bergmann 604df2f608 [API CHANGE] Fix typo in prop implemented by stardiv.UnoControls.FrameControl
There is exactly one implementation of css.frame.FrameControl (which demands a
property named "ComponentUrl" not "ComponentURL"), and exactly one place where
that property is used.  So switch those two places to use the spelling of the
property name as documented in the UNOIDL service.  (Even though that can be
considered an incompatible change, in the unlikely case that 3rd party code
expects to be able to access the given implementation's property with the mis-
spelled name.)

Change-Id: I4fa3f21851b61079c09deea1a24aac22bc96f36f
Reviewed-on: https://gerrit.libreoffice.org/51766
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-03-23 13:02:45 +01:00