diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2022-09-07 16:49:56 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2022-09-08 09:46:26 +0200 |
commit | 392b2cd4889cf944ed47b3473c6dd2cc1f89e7e7 (patch) | |
tree | 4cd708894b0670eaaae13f1e9c7b76f85fc6a653 /svx/source/unodraw | |
parent | 467308d679a3f2b4bbdd117fcc73636d57d66c09 (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>
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 55eabdcd85fc..b1ffa6449007 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -962,10 +962,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 ); |