From a640676e06bdab3471f5c9f04dd9403bc66ddc22 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 7 May 2020 15:40:57 +0300 Subject: tdf#101181: store glow radius in 100ths of mm instead of EMUs ... as we do for all metric values. This fixes storing values like "190.5cm" in ODF for 15 pt (should be "0.529cm"). Change-Id: I382756af56464424dcb24ed8801d0a4203658c11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93640 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sw/qa') diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index e52e250046a4..a799d69ddf6e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -246,9 +246,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testShapeEffectPreservation, "shape-effect-p 0 ); // should not be present // 7th shape with several effects: glow, inner shadow and reflection - assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" - "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow", - "rad", "63500"); + // We import glow radius (in EMU in OOXML) into integral mm100 internal representation, then + // export back into EMUs. This results in inaccuracies. + OUString rad = getXPath(pXmlDoc, + "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" + "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow", + "rad"); + CPPUNIT_ASSERT_DOUBLES_EQUAL(63500, rad.toInt64(), 150); // actually, it returns 63360 assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:glow/a:srgbClr", "val", "eb2722"); -- cgit