these were skipped in previous runs, since they contain some code behind #if
After inspecting these, it seems like the removals should not cause trouble.
This also shaves off some 140M input
Change-Id: Ie1f57174dd6fec3ba5b0b91eb0688acdc1a8143d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197494
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[A-Z]*
This shaves off about 100M input, not bad for such a small amount
of files checked
This time --headersfwd skips files that contain #if defs,
in hope of not breaking builds that are not checked by CI
(...except for include/vcl/BitmapTools.hxx - this was cleaned accidentally,
due to a bug in the bin/find-unneeded-includes script that is fixed
by the previous commit 930ff2b830
- but let's keep this anyway, it seems fine)
Change-Id: Ia8e49d94f6adb3cdbedbc40ffa56dbf846c9b6e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196235
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
After recent commit 851fb75779
recheck these directories in include/ again
to test drive the new --headersfwd mode of bin/find-unneeded-includes
Change-Id: I0ede437c4f9958cd98210ed1760a5b98ea8bd1ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192377
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
The three places that call GetLocalizedChar were all functions that were
doing the same thing, ie, localizing the digits in a string. Instead of
having three separate copies of this similar code, this patch stops
exporting GetLocalizedChar and instead exports a utility function that
operates on a string.
One of the three versions of the code avoided allocating a new string if
nothing changes. This new consolidated helper uses the same approach
so that the other two places can take advantage of this very likely
optimisation.
The main motivation to do this was to avoid truncating the sal_UCS4
returned by GetLocalizedChar into a sal_Unicode. The consolidated
implementation adds the converted characters with appendUtf32 instead so
that if GetLocalizedChar ever returns characters outside of the BMP then
it would work. In practice this doesn’t currently happen so it’s not an
actual problem. However the commit below makes the compiler warn when
sal_UCS4 is truncated, so this patch fixes a truncation that was marked
as a TODO in that commit.
commit 82f055e5cb
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Tue Nov 4 10:12:18 2025 +0200
new loplugin:narrow
Change-Id: I628a29520a0896cd0f4c7c2ff131ac763e07925b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193460
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>
now that Bitmap supports transparency
Disable part of the redaction test. I have
verified that the visual result of auto-image redaction
is the same before and after this change, but we
seem to end up with more rectangles than before.
Probably something weird inside the EMF/WMF machinery.
(see the fixMetaFile function).
Change-Id: I85f308ae66ddf7592e41fde1ab9e49f9c882146e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
now that Bitmap supports transparency
Note that the SVM unit test changed because we no longer
store some bitmaps as an 8-bit palette color layer and an
8-bit alpha layer. When those pass through Bitmap, they
get converted to a 32-bit bitmap.
Change-Id: Icbb30e291a7ed5c53319876637ae25e88a97d90d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190330
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
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: I7ae7452618bdad919cc01d9f5c08cbc44cb5339d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189950
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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>
When a user enables 'mouse as pen' before starting the slideshow, then
his paintings are saved as persistent shapes when he exits slideshow.
These shapes were then converted back to paintings when the user starts
the slideshow again, so that they are visible againg.
But these old paintings were treated as new paintings when the user
exits slideshow and were then saved again as shape to the page although
the page contains these shapes already. Thus with every new start and
exit of the slideshow the shapes were duplicated. Because the duplicates
are at exactly the same place as the originals, you do not notice it
immediately. But you can see the duplicates in the Navigator and notice
it in the file size.
The fix introduces a flag that is set at the paintings from the existing
shapes when the slideshow is started. This flag is then used to skip those
paintings from converting to shapes when slideshow is finished.
Change-Id: I93324d157b1b802d7b8e24858034d2fdc5d71b45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188364
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
and
cid#1659624 Variable copied when it could be moved
cid#1659632 Variable copied when it could be moved
cid#1659637 Variable copied when it could be moved
cid#1659656 Variable copied when it could be moved
cid#1659662 Variable copied when it could be moved
Change-Id: I20179a4ff699af546694b8a4796ab2f0cfae1903
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188708
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
and
cid#1660561 Variable copied when it could be moved
cid#1660555 Variable copied when it could be moved
cid#1660552 Variable copied when it could be moved
cid#1660549 Variable copied when it could be moved
cid#1660548 Variable copied when it could be moved
cid#1660444 Variable copied when it could be moved
cid#1659838 Variable copied when it could be moved
cid#1659835 Variable copied when it could be moved
cid#1555526 Variable copied when it could be moved
Change-Id: Ic3f69bc789861d06d33a7b23e7ed0d519df94ab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188589
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
as part of the project of removing BitmapEx in favour of Bitmap, now that we can store RGBA data in Bitmap.
This mostly just moves the Bitmap->BitmapEx from inside OutputDevice to the various call sites,
from where I can make further improvements.
Change-Id: Id5366c1eb5ebca98fee7c974737552f4a09a5c2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188341
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
which allows us to eliminate a bunch of rounding at various layers, and
consequently maintain a lot more precision
Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
During slideshow, the combination outline text mode, and highlight
background color never worked. Adding cppcanvas code to handle it.
Change-Id: I9abb45fca4c89d206ebb431ff5675288e5deab43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174872
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
avoid doing some extra Invert() operations by creating an AlphaMask
instead of a Bitmap to pass to the BitmapEx constructor.
Change-Id: I1af3a5e65010b346fa0d0c56836d567e51c9b58b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158106
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
which warns against using the 'operator bool' conversion of
std::optional<bool> which can lead to interesting bugs
The bugs that this plugin have been submitted independantly,
so this change is just using has_value() in relevant places.
Change-Id: I259b837feeecddcb8cd1d7e5db1e85bf505907cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155978
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Even when drawing to a VirtualDevice where antialiasing
is disabled, text will still be drawn with some
antialiased pixels on HiDPI displays. So, expand the
size of the VirtualDevice slightly to capture any of
the pixles drawn past the edges of the destination
bounds.
Change-Id: Ibcba8234708d8784c12f984289ec0a8fcad6694e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156098
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Patrick Luby <plubius@neooffice.org>
(Second attempt at landing this)
Image formats and graphics APIs use alpha, not transparency,
so change our internal formats and data structures to work directly
with alpha, so we don't need to modify data before we push it to
graphics APIs.
Add a couple of new Color constants to make the intention
of the vcl code clearer.
Notes
(*) On macOS, tweaking the logic in CreateWithSalBitmapAndMask
to more accurately reflect the requirements of the
CGImageCreateWithMask function seems to fix some
tests.
(*) The vcl code does not properly support gradients
with transparency. So the previous code was wrong, and this
change is going to result in slightly different wrongness.
Change-Id: I9e21c2e98d88ecfdc5f75db13bd1ffff7c38db98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114168
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This was missed in:
commit 3901e029bd
Author: Khaled Hosny <khaled@aliftype.com>
Date: Mon Aug 8 22:08:37 2022 +0200
tdf#104921: Cleanup Kashida insertion logic
The width adjustment passed through, but Kashida insertion positions
didn’t, leaving gaps in place of Kashidas when canvas is used
(apparently canvas is only used for slideshow).
Change-Id: I25ff30f10cc46a5c87bda2f3936df26b2fc926b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153234
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
(a) It is not obvious what DeviceFormat::DEFAULT means
(b) There are two parameters (each with two states), but only really 2
possible overall states
So
(1) use more useful names
(2) combine the two parameters into one enum
Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
on modern hardware, these are less efficient than regular alpha
channels.
Also, this greatly simplies the range of stuff that vcl needs to deal
with, which will make the upcoming transparency->alpha patch easier to
deal with.
Enhance vcl::CreateFromData to convert incoming 1-bit data to 8-bit
image.
Change-Id: I35829da750029fe373d0d2911a669d10bab6ad23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now. Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)
Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
and
cid#1504665 Big parameter passed by value
cid#1505368 Big parameter passed by value
revert the clang-tidy modernize-pass-by-value changes that coverity
warns about
Change-Id: Id92fdc8d1caeed9eaf7ff1e9e745938e5a971a34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135803
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>