Commit Graph
405 Commits
Author SHA1 Message Date
Caolán McNamara 36b3eb054b add a recursion depth to ReadRegionNode
Change-Id: I6e17304405af5e6260ebe9c78ff344101a7c0060
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/762
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 4cebc4ad8b977959430829223b10309df8601d1c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206667
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-06-16 07:50:11 +02:00
Andras Timar 783914b216 emfio: fill each EmfPlusFillRects rect independently
The handler accumulated every rect from one EmfPlusFillRects
record into a single B2DPolyPolygon and emitted a single
PolyPolygonColorPrimitive2D, which drawinglayer fills under the
even-odd rule. With overlapping rects, even-odd cancels pairwise
overlaps - three south-east-shifted gray squares rendered as
filled-then-hollow-then-filled stripes (the triple-overlap centre
came back as filled because three crossings is again odd).

Per MS-EMFPLUS each rect in EmfPlusFillRects fills its interior
independently; there is no fill-rule choice. Emit one fill
primitive per rect inside the loop and keep the polypolygon path
only for EmfPlusDrawRects, where stroking is independent of fill
rule so the existing single-call shape stays correct.

Tests: testEmfPlusFillRectsOverlap with three 300x300 squares
shifted south-east by 100px each (extracted from the tdf#107034
sample EMF) asserts three separate polypolygoncolor primitives
rather than one combined.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I567e6a06d103684a723f513297684c66f700587a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2314
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 679c654a5b9a5f4a1cd787e5fa2d2380eb5574fb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205087
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-12 16:21:49 +02:00
Andras Timar f8084808c2 emfio: render EMF+ PathGradient brushes
Replace the previous SvgRadialGradientPrimitive2D approximation of
PathGradientBrush with a bitmap-textured polypolygongraphic fill,
where the bitmap content is computed by a per-triangle Gouraud
shading of the brush boundary.

The old approximation positioned the gradient centre via
Map(brush->firstPoint), which typically landed far outside the
polygon's unit-coordinate range because the brush's path lives in
its own coordinate space; with SpreadMethod::Pad the gradient then
degenerated into a flat boundary-colour fill - the "orange square
instead of tiled gradient circles" of tdf#143031.

The bitmap is allocated with the brush bbox's aspect ratio
(longest side 256 px) and anchored to aBrushBounds.getMinX/MinY in
raw EMF coords, so when maMapTransform sends it to world space it
lines up with the fill polygon. wrapMode != WrapModeClamp routes
it through the existing texture-tiling path so larger fill polygons
repeat the bitmap.

Per-pixel content (Gouraud sweep):
- Partition the brush boundary into N triangles formed by (centre,
  V_i, V_{i+1}) and Gouraud-shade each one with vertex colours
  (centerColor, surround[i], surround[(i+1) % nSurround]). Inside a
  triangle the pixel colour is the barycentric blend of the three
  vertex colours; this reproduces multi-surround-colour brushes
  (e.g. the libUEMF 5-pointed star with red/blue/red/blue/magenta
  outer points and green inner indents on a black centre) and
  collapses to a smooth radial gradient when all surround colours
  are equal.
- The brush's BlendFactors curve (sampleFactor) remaps the
  centre/edge parameter t before mixing centre and per-segment
  edge colour. PresetColors / ColorBlend (sampleColor), when
  present, override the centre/edge mix entirely with a sampled
  stop colour. Both fall back to a linear centre-to-edge mix when
  the brush carries no curve.

Rasterization is done per-triangle: Pass 1 walks each fan
triangle's pixel-space AABB (clipped to the bitmap) and writes
only the pixels that fall inside, so total work is O(sum of
triangle AABB areas) rather than O(bitmap area * triangle count).
Structurally this is what cairo's mesh-pattern rasterizer
(cairo-mesh-pattern-rasterizer.c) does for PDF type-7 shadings -
each patch paints into its own pixel range rather than every
pixel testing every patch. With N up to ~512 boundary segments
after Bezier flattening, that turns a 256x256-pixel bitmap from
a ~30M pixel-tests-triangle loop into ~50k AABB iterations
(per-pixel arithmetic is unchanged so the rendered colours match
bit-for-bit).

Boundary handling:
- BrushDataPath set: take the brush's path polygon and flatten
  Bezier segments via adaptiveSubdivideByDistance with bound =
  bbox/512 so the boundary closely follows the curve.
- BrushDataPath unset: use a new EMFPPath::GetRawPointsPolygon()
  helper that builds a polygon directly from the boundary points.
  GetPolygon() can't be used here because the trailing bytes of
  boundary-only brush data don't encode valid path-point types and
  produce a degenerate polygon.

Pixels outside every fan triangle (in the bitmap bbox but not in
the boundary) are handled per wrapMode in a second pass:
- Tile / TileFlipX / TileFlipY / TileFlipXY: left transparent so
  adjacent tiles in the fill polygon stay visually separate. Pass
  2 is skipped entirely for these wrap modes.
- Clamp: extended using the closest triangle's edge colour
  (smallest-negative-margin barycentric weights), eliminating
  sub-pixel transparent jaggies along smooth Bezier fill polygons
  that extend slightly past the flattened boundary.

Tests: testEmfPlusBrushPathGradientWithBlendColors expectations
updated to assert the new polypolygongraphic-with-bitmap structure
(single bitmap copy fills the polygon when bitmap and polygon bbox
coincide). New testEmfPlusBrushPathGradientMultiSurroundColor
with a hand-extracted libUEMF 5-pointed-star EMF exercises the
boundary-only / multi-surround-colour path. testEmfPlusBrushPath-
GradientTiled covers the texture-tiling case where the brush
gradient is repeated across a larger fill polygon.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I92aa6d90ef6d2106f1d8d1cad97a3bb83594bd23
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2209
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit fa76144b9cf130e232465c2480a5a7127bb282ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205086
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-12 16:21:43 +02:00
Andras Timar 05f4321345 emfio: honour Winding fill mode on EMF+ FillClosedCurve
The fill-mode bit (0x2000) of EMF+ FillClosedCurve records was
logged but ignored, so a self-intersecting closed curve drawn with
WINDING semantics rendered the same as ALTERNATE - the centre of a
pentagram fill came out as a hole instead of being filled. Convert
the polypolygon at parse time the same way the pre-existing
EMR_SETPOLYFILLMODE path does (solveCrossovers +
stripNeutralPolygons + mergeToSinglePolyPolygon for single self-
intersecting polygons, createNonzeroConform for nested poly-
polygons) so the resulting even-odd fill of primitive2d primitives
matches the intended winding-fill visual.

Add a unit test with a minimal EMF+ FillClosedCurve drawing a
self-intersecting pentagram in winding mode.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ic02048aae223527dca0f556f0171f117baf147c0
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2313
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit fd018f6203f61aaf0c8c781c11a93578bf1eaf6b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205085
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-12 16:21:36 +02:00
Andras Timar 60c4f98cee tdf#143056 EMF+: honor StringFormat tracking when drawing strings
The tracking field was parsed but ignored, so DrawString always
used the font's natural character advances. Now build a DX-array
by multiplying each cumulative width by tracking, and pass it to
the text primitive. Also use the stretched width for alignment
math so center/far positioning stays correct.

testDrawStringTracking loads an EMF+ with tracking == 1.5 and checks
that the resulting textsimpleportion carries a stretched DX-array.

testDrawStringAlign turned out to use a file with tracking == 1.03 and
its expected x positions were based on the old buggy behavior (tracking
silently ignored).  Update the centered/right-aligned expectations to
match the corrected text width.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ica93f6ba11d2d951688ee18230e5993d97a34db6
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1986
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 1a9cce32f7408aab06289295c63b3e24146472a0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204839
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-06 09:36:55 +02:00
Xisco Fauli cfd3309a5d loplugin:unusedmethods
Check existing ones that can be removed

Change-Id: I6ee6fc1772c620ac5d12fea915681b094b7c3bfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204583
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-30 08:54:45 +02:00
Caolán McNamara e79df8ba0e zero init drawinglayer emf locals
Change-Id: Idc7cf752ae8b0290cc2da6bae24771966406aa6d
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/997
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203756
Tested-by: Jenkins
2026-04-20 10:27:56 +02:00
Caolán McNamara 04219d54c4 check for a short stream
and zero init locals

Change-Id: Ie9c94df35ce2adba5609b5e144b8ae7fe8d56a9d
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/952
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 6f517b5081823681e46f3f1a681db2351cb48cb8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203616
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-17 09:38:28 +02:00
Caolán McNamara f150ccb805 zero init drawinglayer emf locals
Change-Id: If9099f1d0edf2f69cbc4b02e7ccf9716bdc15ef1
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/949
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 83c235e3383a4967e8d1aebbffae10f446a47133)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203615
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-16 17:13:31 +02:00
Caolán McNamara de9281c087 check that the file can provide the claimed data
and make sure we initialize these locals

Change-Id: I3bd17f1b815ceb363ef6f7616556cc93475a25ff
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/947
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit b9b3cd8507532ea876706d3ef24460ee3505e803)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203614
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-16 17:13:27 +02:00
Caolán McNamara 617fab7a68 check that the file can provide the claimed data
and make sure we initialize these locals

Change-Id: I94317301368780761c0c6550add3e3e5ab63cf5f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/723
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203582
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-15 12:40:05 +02:00
Caolán McNamara 29ff09023a tidy up emfppath.cxx edge cases
Change-Id: Iff40c21867c77216903ca72ef53001448046e6c9
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/721
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203581
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-15 12:39:58 +02:00
Caolán McNamara 0e2682488b check that the file can provide the claimed data
and make sure we initialize these locals

Change-Id: Ifa899e36f678216574364e5206037ab57b2d19d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203577
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-15 12:39:33 +02:00
Khaled Hosny 1a571fde09 tdf#118792: Add support for font-variation-settings in SVG import
Change-Id: Iaae0426667a3d9357a3c714c6c63f52f79f06706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203286
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-08 10:09:39 +02:00
Khaled Hosny 8672c952eb tdf#171624: Carry font variations through drawinglayer text primitives
Change-Id: I6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203248
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-06 17:13:36 +02:00
Noel Grandin e77b23fa1c Fraction->double in MapMode
Change-Id: I865fe1c2b0377eebda6f9f19e163928cbe7c9056
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202631
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-26 13:23:37 +01:00
Bartosz Kosiorek c1fb4c337d tdf59814 tdf168886 EMF+ Use Frame size and DPI instead Bound
Previously, nested EMF images were sized based on rclBounds, which
only encompasses the drawn objects. This caused incorrect scaling
and offsets when the drawing did not fill the entire logical canvas.

Changes:
- Switched from rclBounds to rclFrame for logical canvas dimensions.
- Implemented DPI calculation using szlDevice and szlMillimeters
  from the EMF header.
- Correctly mapped rclFrame (0.01mm units) to image pixel
  coordinates (x, y, width, height).

Change-Id: I32f6679bedb26e86b069abd6b4d270a385ca7e89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201586
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Tested-by: Jenkins
2026-03-13 11:44:54 +01:00
Samuel Mehrbrodt 341a1e34a6 tdf#168135 Fix text highlight for superscript/subscript
Text highlight for superscript/subscript now has the same size
as 'normal' text

Change-Id: If2bce2abd1cc1188f542a7de8c7b55d27c2cecc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201010
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201543
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
Tested-by: Jenkins
2026-03-13 08:45:54 +01:00
Noel Grandin 8459f0be51 XmlWriter::attribute(double) should actually write a double value
And not truncate it to an integer value.

Add additional overload for attribute that takes an enumerated type, otherwise
the compiler will complain about ambiguous conversion because it cannot
choose between the attribute that takes a integral value and the one that
takes a double value.

Change-Id: I9eae22817ec3b26da7b9468d1c8b5e6f3e900538
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201193
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2026-03-10 15:49:17 +01:00
Bartosz Kosiorek 4dccec254c tdf166084 tdf138087 tdf59814 EMF+ Fix scale and trans DrawImagePoints Metafile
This commit fixes the incorrect positioning and scaling of Metafiles
rendered via EMF+ DrawImagePoints.

Key changes:
- Implemented a normalization matrix for Metafiles to properly map
  source coordinates (SrcRect) to the destination.
- Updated EMFPImage to parse and store bounds from nested EMF headers,
  ensuring correct dimensions (x, y, width, height) are available.

Change-Id: I07b4d99c334611a10e7faff42b76699f04fa1520
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201084
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2026-03-06 22:13:37 +01:00
Khaled Hosny 5825e9cfdb tdf#153368: Support optical size for variable fonts, part 8
Channel optical sizing option through drawing layer, otherwise it
doesn’t work in Draw/Impress.

Change-Id: I96cd3177dcf816b5c1e065663d4a8c90f187704f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200765
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-03-02 21:46:13 +01:00
Bartosz Kosiorek 6c05a6339c tdf#129342 tdf#170985 EMF+ Implement BrushTypeTextureFill for bitmaps
This patch implements the missing TextureFill brush support for EMF+
records. Previously, texture fills were ignored, resulting in missing
backgrounds or shapes.

Change-Id: I61f80a9851f3929651f54b68d6d4d21e65720aa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200547
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2026-02-28 08:04:39 +01:00
Gabor Kelemen eb087d25b3 tdf#146619 Use more forward declarations in include/drawinglayer
Change-Id: I5911dfb1cfc2bfd291758334b69123cfbce559a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199387
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-22 12:08:33 +01:00
Bartosz Kosiorek 8b002437fb tdf#168227 EMF+ Fix implementation of SetPageTransform
The implementation of SetPageTransform was incorrectly overwriting mnMmX and mnMmY
with calculated pixel values.

These variables represent the Reference Device size from the EMF+ header and should
remain constant. Overwriting them causes mappingChanged() to calculate an incorrect
transformation matrix, as it relies on the original ratio between reference
millimeters and pixels. This led to incorrect scaling and cumulative errors
if multiple SetPageTransform records were present in the document.

This patch ensures that header constants are preserved and the Page Scale
is applied as a separate step in the transformation pipeline.

Change-Id: I7a957f57894cc079292e8f93c119dd0fdb456fb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199380
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2026-02-15 12:21:53 +01:00
Gabor Kelemen 49cb3077fb tdf#146619 Use more forward declarations in include/vcl/outdev.hxx
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>
2026-01-23 21:27:08 +01:00
Gabor Kelemen 47fe1cce1b tdf#146619 Use more forward declarations in include/vcl/[h-p]*
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[n-p]*

Change-Id: If6436f3ef8300693c3869c2521e2fa2aa8a4edc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196397
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-14 10:19:31 +01:00
Gabor Kelemen b63115f3fa tdf#146619 Use more forward declarations in include/vcl/[d-g]*
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[d-g]*

This shaves off about 150M input

Change-Id: I2b15257451d4b392dca3e5d07f4a443ee653b04c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196395
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-11 21:38:37 +01:00
Gabor Kelemen c0b14ab9aa tdf#146619 Use more forward declarations in include/vcl/[A-Z]*
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
2026-01-05 11:10:28 +01:00
Tomaž Vajngerl 959decdcda basegfx: BColorStops shouldn't derive from std::vector
Change-Id: I9f246c0d9a5ddc7f8cf428bf7fc8c8957e8584b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158710
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-12-08 13:40:28 +01:00
Tomaž Vajngerl 94ec45e069 drawinglayer: add glow primitive to xml dump
Change-Id: I51ea2871a24b9d1923722588fbecd8aa93c1ad78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194449
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Code-Style: Tomaž Vajngerl <quikee@gmail.com>
2025-11-25 09:53:56 +01:00
Caolán McNamara 2eee25476f cid#1667045 silence Division or modulo by float zero
Change-Id: I16a62003be4a5cc09afa2a21f89251da6dec46c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194308
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-11-21 13:36:23 +01:00
Mike Kaganski 6f051a8525 Simplify and optimize a bit
Use attributeDouble instead of OUString::number
Use O(U)StringBuffer
Do not use u"" literals where "" is better

Change-Id: I73f74777dfab77509c3926702c3a94b2a0b2e653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194188
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-11-19 10:51:00 +01:00
Tomaž Vajngerl 4fa74cefc3 tools: use string_view instead of OString in XmlWriter
Change-Id: I55dd06fc432d9686b370274a4621d61c035a99dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193997
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-11-19 07:33:37 +01:00
Gabor Kelemen fd2e467ba3 tdf#146619 Run IWYU in fw decl mode on include/[a-c]*
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>
2025-11-08 09:37:19 +01:00
Caolán McNamara cc6ccbed6a cid#1667045 Division or modulo by float zero
Change-Id: I05fd65a9412aab71cd453e2e4737046fb15059b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193299
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-11-02 15:43:24 +01:00
Khaled Hosny 1dce54d8fb tdf#168884: Restore missing transparency in EMF files
Revert unrelated changes from:

commit 1bdf1e2d52
Author: Khaled Hosny <khaled@aliftype.com>
Date:   Thu Sep 25 16:33:09 2025 +0300

    tdf#168371: Disable ligatures in Impress/Draw with character spacing

I added a new parameter to TextSimplePortionPrimitive2D constructor, and
rTextFillColor that previously was using the default value had now to be
explicitly set, but I should have used COL_TRANSPARENT as that is the
default.

Change-Id: Ie51e8f3f4c68a9539eb3f6cc77fb1e6cf44f673f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192779
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2025-10-21 14:16:39 +02:00
Noel Grandin 40e5bc6e68 lets have just one getB2DRange function/method
Change-Id: I5081abca177c6fb8bd21d971d93dc115d57de294
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192589
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-10-19 12:13:53 +02:00
Khaled Hosny 1bdf1e2d52 tdf#168371: Disable ligatures in Impress/Draw with character spacing
This is follow up to commit:

commit b9f0caad5d
Author: Khaled Hosny <khaled@aliftype.com>
Date:   Tue Aug 23 04:13:28 2022 +0200

    tdf#66819: Disable ligatures with character spacing

Even though editengine was applying letter spacing, when drawing with
drawinglayer, letter spacing was not propagated which caused VCL to not
disable the ligature features.

Change-Id: Ia8bf2231478720262484a757e16fe5afec3cd28e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191512
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2025-09-25 18:52:49 +02:00
Xisco Fauli f127f708f6 tdf#168452: support unicode-bidi in svg
Before this change, getBiDiStrong() was never used
to manipulate the text

Change-Id: I9d6a2e8b79d27126902f2be84174c641ec71c28c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191123
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-18 16:34:18 +02:00
Gabor Kelemen cf1403343d tdf#146619 Run IWYU on drawinglayer/
Change-Id: I0cdefb89bedfbe4d733edb89c9ed2e7a9b37c947
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190907
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2025-09-17 19:23:05 +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
Noel Grandin 50fafaeeda BitmapEx->Bitmap in Primitive2dXmlDump
now that Bitmap supports transparency

Change-Id: I3d755c87107dbf644b53b4dbbcbeb12248b171b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190482
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-01 22:27:38 +02:00
Noel Grandin 7c0163e0cb BitmapEx->Bitmap in some comments
leftover from earlier conversion

Change-Id: I8d2f5a79709ef0975c444697f67e762a4cc9b28d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190484
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-01 22:26:49 +02:00
Noel Grandin 89e1a9c95d BitmapEx->Bitmap in implInterpretMetafile
now that Bitmap supports transparency

Change-Id: Ic11bea05f76566aa96b722c13581f9d4ef0225fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190481
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-01 18:22:54 +02:00
Noel Grandin c0afb3514f add new Bitmap constructors
to move the logic of constructing a new Bitmap from an existing Bitmap and an AlphaMask,
into vcl, where it can later be optimised

Change-Id: I2af1c6d1a35d968abdd07546448f7e211772e70b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190366
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-29 17:53:22 +02:00
Noel Grandin 232d7631e8 BitmapEx->Bitmap in MetaBmpExScalePartAction
now that Bitmap can handle transparency

Change-Id: Idbbfe20aff2ff40f19b6cb30ece678bf282a6698
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190365
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-29 17:53:10 +02:00
Noel Grandin 3ab47e263e BitmapEx->Bitmap in MetaBmpExScaleAction
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>
2025-08-29 17:52:53 +02:00
Noel Grandin 0680ba0258 BitmapEx->Bitmap in MetaBmpExAction
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
2025-08-28 18:21:42 +02:00
Noel Grandin 4c85558251 BitmapEx->Bitmap in drawinglayer
now that Bitmap supports transparency

Change-Id: I1894a0187d6f661ad10aa631c55fc3ea66ff1d3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190224
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-26 17:33:59 +02:00
Noel Grandin f3522ba36c use Bitmap in extractBitmapFromBaseProcessor2D
now that Bitmap supports transparency

Change-Id: Ia4e15cfee6b4d223d3fd4324c6c8f7a9186cd4ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189597
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-14 18:06:26 +02:00