Commit Graph
3273 Commits
Author SHA1 Message Date
Mike Kaganski 800e7fd2ff Simplify mutex handling here, use more RAII
That required improving UnusedVariableCheck to honor [[maybe_unused]].

Change-Id: I01f3fd92d78726582f873681c807315b029c4e89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200032
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-02-23 14:38:56 +01:00
Stephan Bergmann 96cc64e29c Fix a loplugin:bufferadd false positive
(which would hit some yet-to-be-committed code)

Change-Id: I101ae4f7d00ece9d48c96764114668484b0fdd5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198660
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-02-04 16:54:59 +01:00
Mike Kaganski d0e23db89a Drop MacrosTest::Resetter, and use comphelper::ScopeGuard
Change-Id: I2214724567a58174b175a17fbabec7a5249e4df8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198482
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-02-01 19:38:44 +01:00
Armin Le Grand (collabora) fde80f0497 SmartArt: Adapt DiagramModel
Up to now with lots of effort ModelData was held at the
svx::diagram::Point to keep a stripped version of Text and
TextAttributes and also a selective (not complete!)
key/value list of attributes for each shape itself
(fill/line/text/...).

These had to be moved to/rescued from oox::Shape that is
used as helper at import to that model after import, set again
at the oox::Shapes when XShapes had to be re-created, you name
it - very complicated and error-prone, and never complete
by definition.

Nonetheless data in OOXML MSO format, so pretty easy to re-
export if necessary /that's what I was looking at last
changes).

That also meant that all changes done to an XShape/SdrObject
*had* to be somehow transfered to that diagram model data,
too. We have no converters for that at all, target would
be data representation as in OOXML files.

What we *have* is import to our model using oox::Shapes and
ccreating XShapes/SdrObjects, and export XShapes snippets
'direct' to MSO ooxml formats.

Thus I thought about to use what we have, for the cost to
split the model: the DiagramModel *has* to be kept to be
able to re-create the Diagram on structural changes, that
is needed. But the attribute & text data can stay at the
associated XShapes that need to exist and get created
anyways.

That needs reliable identification of the XShapes
belonging to the model. It requires to load that Diagram
initially, using the oox::Shapes which have the complete
attribute model data to create the XShapes.
Remember that there is a 2nd import, from the
ReplacementGraphic which (may) be contained in the MSO
file.

From that moment on changes on those XShapes will be
diagram model changes if attributes get changed.
But they will not need to forward changes to the
DiagramModel in another format.

When re-layouting it means to copy that data from old
XShape to new XShape, before these get deleted. There
may be new XShapes that need to be initialized, too.

For export this means that part of that export will have
to use the XShapes as model data as needed.

This also means that the quality of im/export of
Diagrams will in the future rely on the quality of our
existing im/export snippets for XShape/oox::Shape/oox.

These are developed and in use for a while now and
should have reached a good quality. If we have to
improve these that will always improve im/export
and Diagram stuff then, too.

This change does that big change and looks promising,
doing what it is intended to do. I still have to
experiment, so in master it is still deactivated due
to being too dangerous yet, see last SmartArt change
and mention of ACTIVATE_RECREATE_DIAGRAM_DATADOMS and
it's description.

Change-Id: Ife1591b0d3c8974d90a1004d94f3e6799be85a56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198221
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2026-01-28 10:37:40 +01:00
Stephan Bergmann 28951381c6 No more need for ReservedId::isInLokIncludeFile special casing
...after 5bc9425900 "Avoid illegal names also for
the LibreOfficeKitGtk structs" removed the remaining offenders

Change-Id: I274486459dfc109c4d2e103d7ec41b0655657e77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198111
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2026-01-26 08:13:43 +01:00
Tor Lillqvist 5bc9425900 Avoid illegal names also for the LibreOfficeKitGtk structs
Change-Id: If8b5987e0779ece9518384f88a0363a3c596d7ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197937
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-25 22:33:22 +01:00
Tor Lillqvist 3404d99464 Don't use illegal identifiers in LibreOfficeKit
Identifiers with an initial underscore followed by an uppercase letter
are reserved for the C++ implementation.

Change-Id: I3eabc8aa3570b17e05259c0d56d3b16246335ffc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196572
Tested-by: Tor Lillqvist <tml@iki.fi>
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197868
2026-01-23 07:28:03 +01:00
Armin Le Grand (collabora) bd047bbb9e SmartArt: Preparations for roundtrip
The DiagramModel uses 4 mandatory and three optional XMLDoms
for it's data. These get imported, but to get to a roundtrip
we will need to be able to create & save these again.

Last changes prepared this by deleting XMLDoms which were no
longer valid dependent of changes done to that DiagramModel.
When exporting the availability of these gets checked and if
all are there, it gets exported as Diagram (in MSO format,
not yet in ODF). If nothing was changed the original Doms
get exported - untouched.

That test will now try - if e.g. the most important XMLDom
OOXData is missing - to re-create this in that action. The 1st
one which I now implemented that is the OOXData which homes
the Point/Connections/BGFill data (and some more).

Due to this needing testing I for now encapsulated this
to a EnvVar called ACTIVATE_RECREATE_DIAGRAM_DATADOMS, so
this will for now only happen when this is set. Anyways all
that stuff is still behind the 'experimental features' wall.
This is and stays experimental for now.

These are already deep changes which need to get tested and
get to master, opening the path to experiment with it and
refine it. Due to the EnvVar gate no real changes should
happen in master, but due to the changes around it this
will need to be checked this way.

Change-Id: Iabba69b19387e45f1028843a25f3bae1fc4f8fe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197676
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2026-01-22 10:59:37 +01:00
Xisco Fauli 5765c5f197 svx: Overlay*BitmapEx -> Overlay*Bitmap
and OverlayBitmapExPrimitive -> OverlayBitmapPrimitive

Change-Id: I0f65f3a6e5270ca0039ba920da8e178cde6f3e74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197588
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-01-20 08:52:03 +01:00
Xisco Fauli 2ea359044c drawinglayer: GeoTexSvxBitmapEx*-> GeoTexSvxBitmap*
After
commit 805ef97f52
Author: Noel Grandin <noelgrandin@gmail.com>
Date:   Tue Aug 12 22:19:45 2025 +0200

    BitmapEx->Bitmap in GeoTexSvx

Change-Id: Ic393ff4de51be0eb8c5859605135695f8f92f472
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197587
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-01-20 08:51:25 +01:00
Noel Grandin 04a2c81e73 loplugin:writeonlyvars update for new AST nodes in newer versions of clang
Change-Id: Ib0e08f8bac4dd2b350e2652de36c323d9b88f2b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196676
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-01-07 19:28:54 +01:00
Gabor Kelemen 8ada5793ce Drop ImplDbgCheckWindow method
Last use of this was removed in 2013 with
commit c0125d64cb

"VCL : Remove usage of DBG_CTOR and DBG_DTOR."

Change-Id: Ibb2f02a1ede6eee2bcc76da22b429e600e347c8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196530
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-06 10:02:55 +01:00
Xisco Fauli 9635351580 bump copyright year to 2026
Change-Id: If9b398d338f0a99b400b58c0f4d095a9b9ca5e4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196417
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-01-02 19:28:56 +01:00
Noel Grandin 482234eee1 loplugin:unnecessaryvirtual filter out more noise
update results and tweak python script to filter out more noise

Change-Id: I0a5ccba356630d9129275bd920582c5d09d15288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196149
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-12-23 10:52:38 +01:00
Stephan Bergmann a1f71ce7aa Fix loplugin:unusedcapturedefault for lambdas in template code
...as found failing at <https://gerrit.libreoffice.org/c/core/+/195869/1>
"tdf#165233 Replaced lambda explicit capture with capture-default".

The lambda class in f3 in compilerplugins/clang/test/unusedcapturedefault.cxx is

> CXXRecordDecl 0x42964240 </home/sberg/lo/core/compilerplugins/clang/test/unusedcapturedefault.cxx:25:12> col:12 implicit class definition
> |-DefinitionData lambda empty standard_layout trivially_copyable literal can_const_default_init
> | |-DefaultConstructor defaulted_is_constexpr
> | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param
> | |-MoveConstructor exists simple trivial needs_implicit
> | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param
> | |-MoveAssignment
> | `-Destructor simple irrelevant trivial constexpr needs_implicit
> `-CXXMethodDecl 0x42964380 <col:16, col:30> col:12 operator() 'auto () const' inline
>   `-CompoundStmt 0x429644f0 <col:18, col:30>
>     `-ReturnStmt 0x429644e0 <col:20, col:27>
>       `-DeclRefExpr 0x429644c0 <col:27> 'const T' lvalue ParmVar 0x42963ec8 'x' 'T' refers_to_enclosing_variable_or_capture

without any FieldDecls.

Change-Id: I57bbb8ae3e052d3e00644228b83612e06ab37a0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195879
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-12-19 13:04:13 +01:00
Stephan Bergmann 3289b1609e Adapt compilerplugins to Clang baseline bump
...as of e8fd52037a "Update README.md after Clang
bump to 18"

Change-Id: I2512205aa22ade1da17c414066a4f9e3d82bc99e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195099
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-07 16:46:58 +01:00
Stephan Bergmann fab0a9be45 Remove unused included
...that d1a2b80b9d "Bump compiler plugins Clang
baseline to 12.0.1" forgot

Change-Id: I87f2282ea076e66cb211b097dca4f0b86aecce68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195098
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-12-07 16:46:46 +01:00
Noel Grandin 4e2b089020 loplugin:stringloop
resurrect the plugin and run it over the codebase

Change-Id: I443a75961124aabd1e62b3c4bc166d52e4621b52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194870
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-12-01 14:25:01 +01:00
Noel Grandin c2a0e06b63 new loplugin:stringplusequal
which simplifies O[U]String expressions like
   A = A + foo
into
   A += foo

mostly because then they get spotted by other string plugins.

Change-Id: I2b81b701144acdf18743b52cb0befa7f90fd9528
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194191
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-11-20 07:26:33 +01:00
Christopher Sherlock 955ac3cc32 vcl: extract PDFPage and utility functions to own files
This should whittle down this absolutely massive file and make it easier
to read and understand.

Change-Id: If2246b0b06ca5d1e9e92d45df2c8b3cfc1628178
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190883
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-11-06 14:26:54 +01:00
Noel Grandin 82f055e5cb new loplugin:narrow
inspired by
    commit 4888f6f3f5
    Author: Neil Roberts <bpeeluk@yahoo.co.uk>
    Date:   Sun Oct 26 16:26:47 2025 +0100
    tdf#166488 Fix local variable used to store char from SvxCharacterMap

Look for places narrowing a sal_UCS4 value and thus losing information.

I dont actually fix anything here, just change some types to use the sal_UCS4 typedef,
and add some TODO comments.

Change-Id: Iaea7ba647889efcdaafe5138d4e4806849514f02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193384
Tested-by: Jenkins
Reviewed-by: Neil Roberts <bpeeluk@yahoo.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-11-05 15:02:41 +01:00
Caolán McNamara 8d6dc45416 cid#1659813 Division or modulo by float zero
in unused code, so lets just remove it

Change-Id: I95b3441dd9ae2efcc5fe3d93c37f3062c1bc8edb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193008
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-10-27 11:00:32 +01:00
Stephan Bergmann 390f378723 Remove atticized compilerplugins and their accompanying tests
(see the discussion starting in the comments at
<https://gerrit.libreoffice.org/c/core/+/136841/3#message-2d2ff562ccd80cf776f0b2068f028dd22a40e4e9>
"move old/unused plugins to store")

Change-Id: I9582e934c3224dd0a4c25d0574b47f9ee49ed611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192554
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-17 08:00:14 +02:00
Stephan Bergmann c1ab75b146 compilerplugins: Rename getOriginalDecl back to getDecl
...to match
<https://github.com/llvm/llvm-project/commit/b516dcc998d06c97d874af543489887f7e5a680c>
"[clang] NFC: rename TagType::getOriginalDecl back to getDecl (#163271)"

Change-Id: I11a6a261660cd3786dbb03acdf5e610e165a880e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192553
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-10-17 07:58:58 +02:00
Noel Grandin 48531fbeb2 loplugin:unusedfields fix crash on assert
ignore AST that will trigger an assert inside clang

Change-Id: I6b5b1e91ac34fb54e152e007af0390e5e3affca7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191594
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-29 14:14:32 +02:00
Christopher Sherlock c4c93d1a3e vcl: pdfwriter_impl1.cxx and pdfwriter_impl2.cxx from gdi/ to pdf/ directory
Update clang plugin.

Change-Id: I0d862e8c08ef829d4f452108fec6176532af3ecb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190712
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2025-09-29 09:36:45 +02:00
Mike Kaganski 641e8b1875 Drop loplugin:stringadd exclusion for pyuno_runtime.cxx
Change-Id: I362f4322fd0948b83272234e4fe52a957aea5f9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191578
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-09-28 19:03:11 +02:00
Mike Kaganski 7ff6d60175 Drop loplugin:stringadd exclusion for svxacorr.cxx
Change-Id: I5fe854267738a9ab873c493effbac6bcfe70820c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191577
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-28 14:11:10 +02:00
Stephan Bergmann c5c8e28959 Avoid some lopluign:unusedmember false positives
Change-Id: Iad8ff67ed9df8d242ff996b8a1082ad85b2e6dea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191322
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-09-22 16:53:44 +02:00
Stephan Bergmann 0278766c5c Fix treatment of suppressedWarning in loplugin:unusedmember
Change-Id: I47af9f5e041abf850ad88908a74f1a1241e51d50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191314
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-09-22 14:59:04 +02:00
Mike Kaganski daded1002c Encapsulate buffer management in stringToDouble
Use a struct for that, and its 'insert' method, to avoid repeating code,
and make the logic more transparent.

Change-Id: I90fd4879e1b680ededc3aa4692fb6f59eeb5916c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191144
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-09-20 12:44:28 +02:00
Stephan Bergmann b8a10164dc Adapt loplugin::nullptr to recent libstdc++ 16 trunk change
...<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d9a4c7158a70896c5d4281f42310e88c987acb3e>
"libstdc++: Rename __cmp_cat::__unspec to __cmp_cat::__literal_zero."

Change-Id: I8cac78bcfd9cf9c8a68f028d4b8ebc6ee7263129
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190685
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-09-09 21:49:10 +02:00
Noel Grandin 6d0e5ddede remove BitmapEx
all use-sites have been converted to Bitmap

Change-Id: I1a8842217a266eef100bd387ab013b004e532256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190618
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-09-05 19:45:45 +02:00
Stephan Bergmann 1e2977894f Adapt compilerplugins to recent LLVM 22 trunk change
...<https://github.com/llvm/llvm-project/commit/88438ba1f37fa4e0c2db203cd5556e52c9c34c08>
"[clang] AST: fix getAs canonicalization of leaf types (#155028)", which started
to cause

> [CPT] compilerplugins/clang/test/redundantfcast.cxx
> error: 'expected-error' diagnostics expected but not seen:
>   File compilerplugins/clang/test/redundantfcast.cxx Line 77 (directive at compilerplugins/clang/test/redundantfcast.cxx:78): redundant functional cast from 'const tools::Polygon' to 'tools::Polygon' in construct expression [loplugin:redundantfcast]
> error: 'expected-error' diagnostics seen but not expected:
>   File compilerplugins/clang/test/redundantfcast.cxx Line 77: redundant functional cast from 'const tools::Polygon' to 'tools::Polygon' [loplugin:redundantfcast]
>   File compilerplugins/clang/test/redundantfcast.cxx Line 221: redundant functional cast from 'const Primitive2DContainer' to 'Primitive2DContainer' [loplugin:redundantfcast]
> error: 'expected-note' diagnostics expected but not seen:
>   File compilerplugins/clang/test/redundantfcast.cxx Line 20: in call to method here [loplugin:redundantfcast]
>   File compilerplugins/clang/test/redundantfcast.cxx Line 27: in call to method here [loplugin:redundantfcast]
>   File compilerplugins/clang/test/redundantfcast.cxx Line 38: in call to method here [loplugin:redundantfcast]
> 6 errors generated.
> make[1]: *** [solenv/gbuild/LinkTarget.mk:338: workdir/CxxObject/compilerplugins/clang/test/redundantfcast.o] Error 1

Change-Id: I2538d419b7921d5617b03de646c83973184ee1ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190527
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-09-03 08:21:08 +02:00
Xisco Fauli 451745896d merge SdrUIObject with ImpressSdrObject
Change-Id: I30fa8ccb627f1cd083906bef3f787ac331896272
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190003
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-08-21 18:55:43 +02:00
Mike Kaganski a4072e2764 sd::tools -> sdtools
At least some IDEs are confused by our multitude of `tools` namespaces,
and show errors like `namespace "tools" is ambiguous`.
This removes one such namespace. The idea is to drop all but the one
in /tools (that has tools::Long and tools::Rectangle).

Change-Id: I338b995a29fcfa7142933c195750292593a364ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189959
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-20 15:23:53 +02:00
Mike Kaganski e5968decd4 sc::tools -> sctools
At least some IDEs are confused by our multitude of `tools` namespaces,
and show errors like `namespace "tools" is ambiguous`.
This removes one such namespace. The idea is to drop all but the one
in /tools (that has tools::Long and tools::Rectangle).

Change-Id: Ib404ba7c66085a01861cd62507a479e91aa68e49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189953
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-08-20 15:23:35 +02:00
Mike Kaganski 37e71212c7 vclcanvas::tools -> vclcanvastools
At least some IDEs are confused by our multitude of `tools` namespaces,
and show errors like `namespace "tools" is ambiguous`.
This removes one such namespace. The idea is to drop all but the one
in /tools (that has tools::Long and tools::Rectangle).

Change-Id: I75fc4835ec76dca698be1983dbc0a935b3f765eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189949
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-20 15:23:18 +02:00
Mike Kaganski f9c16559a8 canvas::tools -> canvastools
At least some IDEs are confused by our multitude of `tools` namespaces,
and show errors like `namespace "tools" is ambiguous`.
This removes one such namespace. The idea is to drop all but the one
in /tools (that has tools::Long and tools::Rectangle).

Change-Id: I6077f50ad0fcc49abfadc75d9948ab63df829ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189948
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-08-20 15:23:07 +02:00
Caolán McNamara be6015e3c4 cid#1659971 silence Overflowed return value
and

cid#1659699 Overflowed return value
cid#1659759 Overflowed return value
cid#1659922 Overflowed return value
cid#1660190 Overflowed return value
cid#1660286 Overflowed return value
cid#1660457 Overflowed return value

Change-Id: Ie9fffe4994b10ed3d4feb14eaf7950e3f01714ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189927
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2025-08-20 15:08:44 +02:00
Stephan Bergmann 060c1b69ef Adapt compilerplugins to recent LLVM 22 trunk change
...<https://github.com/llvm/llvm-project/commit/91cdd35008e9ab32dffb7e401cdd7313b3461892>
"[clang] Improve nested name specifier AST representation (#147835)".

For one, clang::TypeDecl::getTypeForDecl no longer works for TagDecls, so the
loplugin::TypeCheck ctor taking a TypeDecl started to fail at runtime.  So heed
the advice given in the comment to clang::TypeDecl::getTypeForDecl and instead
"ckeck out ASTContext::getTypeDeclType or one of...", which means that we now
need to transport a clang::ASTContext to all those places that want to create
such a loplugin::TypeCheck.

For another, clang::TagType::getDecl ("renamed to `getOriginalDecl`" for now) no
longer returns one dedicated Decl per type (so its results could be compared for
equality), so wrap that in compat::getDecl to do an additional getCanonicalDecl.
(But note how that requires an additional compat::getDefinitionOrSelf across the
various loplugins' isWarnUnusedType implementations, to check for any attributes
on the actual definitions rather than on whatever first declarations happen to
be considered the canonical decls.)

And the visitor's TraverseDecltypeTypeLoc takes an additional bool
TraverseQualifier parameter now, so adapt the sharedvisitor machinery
accordingly.

Plus some bespoke fixes across various loplugins.

loplugin:indentation is hit by
<https://github.com/llvm/llvm-project/issues/153540> "Clang getBeginLoc of some
CXXConstructExpr has moved past namespace prefix" (which would cause false

> core/dbaccess/source/core/recovery/subcomponentrecovery.cxx:546:18: error: statement mis-aligned compared to neighbours  [loplugin:indentation]
>   546 |             rtl::Reference( new SubComponentLoader( xController, xDocDefinition ) );
>       |                  ^
> core/dbaccess/source/core/recovery/subcomponentrecovery.cxx:545:13: note: measured against this one [loplugin:indentation]
>   545 |             Reference< XController > xController( m_xDocumentUI, UNO_QUERY_THROW );
>       |             ^

etc.), so is disabled for Clang 22 for now, until that bug is fixed.

(Various diagnostics are slightly different now, leading to some more
expected-error-re variation in the tests.  And loplugin::refcounting no longer
duplicates its warnings, which is probably a feature and not a bug.)

Change-Id: I9fe152e47ee571ad57c7c57f0eaa9c10e620f03e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189694
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-08-17 19:42:56 +02:00
Stephan Bergmann 6970bded4e Reduce loplugin:stringstatic false positives
(This was meant to address the

>     // [-loplugin:stringstatic] false positive: the initializer is not a constant expression
>     static const OUString path = comphelper::LibreOfficeKit::isActive()
>                                      ? utl::CreateTempURL(nullptr, true)
>                                      : GetStandardEmbeddedFontsRoot();

from 49509ba522 "LOK: Set up directory for
temporary embedded font files", but which has meanwhile been removed with
d5b0462581 "LOK: make sure to have trailing slash
in GetEmbeddedFontsRoot()", anyway.)

Change-Id: I97aa0f20502caa1ab4f6074a2b403e25add489a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189671
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-08-15 16:39:02 +02:00
Mike Kaganski 49509ba522 LOK: Set up directory for temporary embedded font files
User profile is read-only in LOK.

Change-Id: Ie424cdfed36525a293226c601ed7bf349e0856b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189641
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-08-15 07:28:05 +02:00
Mike Kaganski e8d0ab587b EmbeddedFontsHelper -> EmbeddedFontsManager
It is not just a helper anymore, the rename reflects its function better.

Change-Id: I11bf130eb34ba90841b550ab2a1fd1b3d9831b72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189350
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-08-12 14:14:45 +02:00
Mike Kaganski 5c7000ac12 Deduplicate some code
Change-Id: I1e432c607563f26c8a0bc2a89201accdae263288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188137
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-07-22 16:30:38 +02:00
Stephan Bergmann d0a492c296 Adapt to Clang 21 trunk isInjectedClassName change
<https://github.com/llvm/llvm-project/commit/c4cc3573d144831d2815433646ffcab62cc9ea40>
"[Clang][AST][NFC] (`RecordDecl` -> `CXXRecordDecl`)`::isInjectedClassName`
(#148195)"

Change-Id: I2807a9ca402e856d55e1803997c86821f5a69bfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187839
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2025-07-14 13:57:22 +02:00
Caolán McNamara c64c74b287 ensure aHTMLOptionTab is sorted at compile time
static_assert that its sorted instead of sorting at load time.

them it can be made constexpr

Change-Id: I85970c5db2cb3f1998449875d5837935b61ee3f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187786
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-13 11:28:43 +02:00
Gabor Kelemen 314a36c21b [API CHANGE] Remove VCL/Settings, VCL/ConfigurableSettings
in order to simplify code.

The flexibility provided by the ConfigurableSettings template
is not really necessary for the simple settings VCL has

Drop this now that keys that actually used them are migrated
to VCL/VCLSettings

Change-Id: I39609cd5f0ccda7f451bc6457a42b05b585b9b10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187007
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-06-27 11:00:12 +02:00
Noel Grandin 43314d13e1 loplugin:singlevalfields update for new nodes in clang
Change-Id: Ie0619411097aab08507ed6addefca640da89f6e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187040
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-06-26 16:28:46 +02:00
Michael Weghorn e7e3a51c32 a11y: Rename OAccessible source and header file
Rename files accordingly after the class
was renamed in previous commit

    Change-Id: I33210b47cda5f71820a3c0fa657e4c3548d45732
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Jun 25 10:15:23 2025 +0200

        a11y: Rename OAccessibleComponentHelper to OAccessible

Change-Id: I1d38d124af685960c0170601e930da516ce2ead3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186953
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-06-26 13:09:50 +02:00