From 623eb17d6b699a280e6d096fb1be4d543cf9f064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 12 Sep 2024 13:06:53 +0100 Subject: [PATCH] tdf#155488 svg export "peek-ahead" didn't see MapMode changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit normal 'playback' case is ok, but during the peek-ahead to get text positions then the MapMode was skipped over so the rotate values were created with the wrong MapMode. Change-Id: I2b51dbc1b15e8d0d24b00b2bd4decb4c71772208 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173260 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- filter/qa/unit/data/YAxis.odg | Bin 0 -> 41942 bytes filter/qa/unit/svg.cxx | 28 +++++++++++++++++++++++++ filter/source/svg/svgwriter.cxx | 36 ++++++++++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 filter/qa/unit/data/YAxis.odg diff --git a/filter/qa/unit/data/YAxis.odg b/filter/qa/unit/data/YAxis.odg new file mode 100644 index 0000000000000000000000000000000000000000..1d01ec508b6517afe29c1b1827c2413e527df29a GIT binary patch literal 41942 zcmeEv1z1+g*6^kjL_m}hkrG6t5d@J&Iz+lty1PRVkQ52&Qo50nE)i*v1_?n#>F)Sv z>+v41_uTWP_y5j)oacSt*?VfuthHv%T5D#%TUs0m83%$;A;`s=RyhfY{uK=bLGTwO zL1so~dbUoMdfJwjrbfEjwni4_4EE;t=`FNvjBMyFEcMLqTj<)E>6zQo8(3>w8XD=^ zNdH}fppCx;0&pc@VXkjvU}ycMDH~=6P}NRH+nV8@*CPCbT9y`;c9w9}KdDFbNA;{N z46OBRZ2lbLANAAL!ou{=YyD9_ZEUq|?fx6k^i3_aZT0@ESb_U!sco)j`X^W+`2(yN znQ0s7*)Z@M*_vrv+Wbl7KSHUtuCAV`9-ybix9*~%qJH5e0O@bx47jqfbu!hnp?5Sh z9akF*8+(cE)~%RXQtC7l+OH=h!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rNSrcZuqNQDHXXVWn*6u(+1ZoS%(qjW2)7T4rDA>O?#pmqV)`WRLj6Ou>O3~X1RH7Zc$ zp_0_D>>RNTx*3)4kn8A`-=30u637!oUgu|HK)vJ<~Oa>b?f#uEzmmH zp>|Z|YNVRQg?UciQN2yo+%qQ#TzmSg#(YAh=HW>@lbcRB$A4FJ(296*PF1C2>Qa$C zrY?S3N8j=k>@S@o9VW-Ry@TiD#;aPwJI&W_={+&I=C$a$+sES)?uARRZGWe8(9DT{ z!#X+L%uCHF+3xFRo>*OK&r*J`L3MKB@0h-feY;&g|E$|~-1m0Tty$;IPJ>s9$%xW zwnTN^ZoAzRRDXWuj;dt_^>nTr@vuz=_H_1wdpe9vBEbC)48U$KsOLMMS?>sFmJ@_Q zJzrFin+fa*R~DoOc%$kM&UIFc(4u<0Igg>cTGW2etJ=AaWNqmq5A757L!Wy^K%H9g6c1Q zU@V}!r?@1sq?AP0q+>BBEhj&*B$bpZ-s=9MDA(2;c)W zsko#vClx&I4oiG6efKo2znuaO25kjyLjr0?0GfVhW}amSZ?r4a8O` zGcbTK=>8`JPylADfXw8QQeg7ZHw0Y+WnciIj7(i2JX2FQ6LU8UCqr}400O$v=vPZ2 zj1~s2PJ|mx%tcc$qha1f9{U1KNg#k(7wQBBx=!SA64Vmnc|T&L45kYfO6X%K2>ZTH p#66+{GX>^q^B{u|5IzJJc=zXlcmUD7mfHXT literal 0 HcmV?d00001 diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx index a7b055c8dbe8..63b914eb9b7b 100644 --- a/filter/qa/unit/svg.cxx +++ b/filter/qa/unit/svg.cxx @@ -341,6 +341,34 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentTextBullet) 0); } +CPPUNIT_TEST_FIXTURE(SvgFilterTest, testMapModeText) +{ + loadFromFile(u"YAxis.odg"); + + // Export to SVG. + save(u"draw_svg_Export"_ustr); + + xmlDocUniquePtr pXmlDoc = parseExportedFile(); + + OUString sTransform + = getXPath(pXmlDoc, "(//svg:text[@class='SVGTextShape'])[last()]"_ostr, "transform"_ostr); + + OUString aTextPositionX + = getXPath(pXmlDoc, "(//svg:tspan[@class='TextPosition'])[last()]"_ostr, "x"_ostr); + OUString aTextPositionY + = getXPath(pXmlDoc, "(//svg:tspan[@class='TextPosition'])[last()]"_ostr, "y"_ostr); + + OUString sExpectedTransform("rotate(-90 " + aTextPositionX + " " + aTextPositionY + ")"); + + // We expect the rotate point of the rotated text to match the start position of the text + CPPUNIT_ASSERT_EQUAL(sExpectedTransform, sTransform); + // Without the accompanying fix, this test would have failed with: + // - Expected: rotate(-90 3386 14754) + // - Actual : rotate(-90 -1651 14488) + // Because the (local) MapMode wasn't taken into account for the text position when peeking + // ahead to get the rotation. +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 92825412250a..c3aa21599512 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -601,6 +601,11 @@ sal_Int32 SVGTextWriter::setTextPosition(const GDIMetaFile& rMtf, size_t& nCurAc bool bConfigured = false; bool bEmpty = true; + // similar to OutputDevice::Push, but we may conditionally not restore these + MapMode aOrigMapMode = mpVDev->GetMapMode(); + bool bOrigMapMapModeEnabled = mpVDev->IsMapModeEnabled(); + int nPopsNeeded = 0; + size_t nActionIndex = nCurAction + 1; for( ; nActionIndex < nCount; ++nActionIndex ) { @@ -717,6 +722,23 @@ sal_Int32 SVGTextWriter::setTextPosition(const GDIMetaFile& rMtf, size_t& nCurAc } } break; + + case MetaActionType::PUSH: + const_cast(pAction)->Execute(mpVDev); + ++nPopsNeeded; + break; + case MetaActionType::POP: + const_cast(pAction)->Execute(mpVDev); + --nPopsNeeded; + break; + case MetaActionType::MAPMODE: + { + // keep MapMode up to date + const_cast(pAction)->Execute(mpVDev); + break; + } + break; + default: break; } if( bConfigured || bEOL || bEOP || bETS ) break; @@ -725,13 +747,23 @@ sal_Int32 SVGTextWriter::setTextPosition(const GDIMetaFile& rMtf, size_t& nCurAc if( bEmpty ) { + // If we fast-forward to this nActionIndex, then leave + // the OutputDevice state as it is. nCurAction = nActionIndex; return ( bEOL ? -2 : ( bEOP ? -1 : 0 ) ); } - else + + // If we are leaving nCurAction untouched, then restore the OutputDevice + // to its original state + while (nPopsNeeded > 0) { - return 1; + mpVDev->Pop(); + --nPopsNeeded; } + + mpVDev->SetMapMode(aOrigMapMode); + mpVDev->EnableMapMode(bOrigMapMapModeEnabled); + return 1; }