summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2022-09-07 16:49:56 +0200
committerAndras Timar <andras.timar@collabora.com>2023-02-06 15:46:59 +0000
commiteeb77c2c05f04b51f0655aa9e3fe5c3a27ef114b (patch)
tree0041a69c1df4b290020e955f7fba7a10b3ed8916 /svx
parent196079fe57de17ee5e635064f6eb9be30b6efb09 (diff)
tdf#150102 Correct PrefSize for UNO API Metafile exporter
Checked that in aBound is indeed the size - 1 (probably due to old integer stuff using Size()/Rectangle() and getWidth()/GetWidth() with the old one-less paradigm somewhere), so just correct to the correct size. Be aware that checking of tdf#126319 is needed, but looks good in my tests. Still: Changing the central UNO API Metafile export is always a risky thing, so it will have to show if this will not influence something else. Adapted a unit test to take into account that the exported object as PNG no longer has an empty column at the right and lo longer an empty row at the bottom. That test testTdf126319 uses now the same test-indexing as the test testTdf105998 already used. This shows a more correct PNG conversion, it was curious anyways that two identical exports of objects with a light-red border from dfferent apps had that difference at all. Change-Id: I8513688dc062025c5d931b75602f4fdbd924a32a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139596 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit 392b2cd4889cf944ed47b3473c6dd2cc1f89e7e7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146561 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index b807154f9d67..e7e6b34d0d72 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -927,10 +927,16 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
aMtf.WindStart();
// tdf#126319 Immediately add needed size to target's PrefSize
+ // tdf#150102 Checked that in aBound is indeed the size - 1 (probably
+ // due to old integer stuff using Size()/Rectangle() and getWidth()/GetWidth()
+ // with the old one-less paradigm somewhere), so just correct to the
+ // correct size. Be aware that checking of tdf#126319 is needed, but
+ // looks good in my tests. Still: Changing the central UNO API Metafile
+ // export is always a risky thing, so it will have to show if this will
+ // not influence something else.
const Size aBoundSize(
- basegfx::fround(aBound.getWidth() + aHalfPixelInMtf.getWidth()),
- basegfx::fround(aBound.getHeight() + aHalfPixelInMtf.getHeight()));
-
+ basegfx::fround(aBound.getWidth() + 1),
+ basegfx::fround(aBound.getHeight() + 1));
aMtf.SetPrefMapMode( aMap );
aMtf.SetPrefSize( aBoundSize );