diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-07 15:40:57 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-07 23:07:45 +0200 |
commit | a640676e06bdab3471f5c9f04dd9403bc66ddc22 (patch) | |
tree | 9b85d9b3a2edeb84f689b193e186daed56423183 /sd | |
parent | dcd1795c4934e66378d4b88c914f8e9bb1678ba7 (diff) |
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odg/glow.odg | bin | 8297 -> 8873 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 8 | ||||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 4 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sd/qa/unit/data/odg/glow.odg b/sd/qa/unit/data/odg/glow.odg Binary files differindex 11d697c491da..9020f663b92c 100644 --- a/sd/qa/unit/data/odg/glow.odg +++ b/sd/qa/unit/data/odg/glow.odg diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index a530631761a4..6bb672641d56 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -2855,15 +2855,15 @@ void SdOOXMLExportTest2::testShapeGlowEffect() bool bHasGlow = false; xShape->getPropertyValue("GlowEffect") >>= bHasGlow; CPPUNIT_ASSERT(bHasGlow); - sal_Int64 nRadius = -1; + sal_Int32 nRadius = -1; xShape->getPropertyValue("GlowEffectRad") >>= nRadius; - CPPUNIT_ASSERT_EQUAL(sal_Int64(139700l), nRadius); + CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRadius); // 139700 EMU = 388.0556 mm/100 Color nColor; xShape->getPropertyValue("GlowEffectColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0xFFC000), nColor); - sal_uInt16 nTransparency; + sal_Int16 nTransparency; xShape->getPropertyValue("GlowEffectTransparency") >>= nTransparency; - CPPUNIT_ASSERT_EQUAL(sal_uInt16(60), nTransparency); + CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency); } void SdOOXMLExportTest2::testTdf119087() diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 2f8dd6056a8e..516eaf6df3c9 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -1272,7 +1272,7 @@ void SdExportTest::testGlow() CPPUNIT_ASSERT(bGlowEffect); sal_Int32 nGlowEffectRad = 0; CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectRad") >>= nGlowEffectRad); - CPPUNIT_ASSERT_EQUAL(sal_Int32(190500), nGlowEffectRad); // 15 pt = 190500 EMU + CPPUNIT_ASSERT_EQUAL(sal_Int32(529), nGlowEffectRad); // 15 pt = 529.166... mm/100 sal_Int32 nGlowEffectColor = 0; CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectColor") >>= nGlowEffectColor); CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF4000), nGlowEffectColor); // "Brick" @@ -1294,7 +1294,7 @@ void SdExportTest::testGlow() assertXPath( pXmlDoc, "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties", - "glow-radius", "190.5cm"); // ??? + "glow-radius", "0.529cm"); assertXPath( pXmlDoc, "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties", diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index e0a20087308a..591ec734c77c 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -3115,15 +3115,15 @@ void SdImportTest::testShapeGlowEffectPPTXImpoer() bool bHasGlow = false; xShape->getPropertyValue("GlowEffect") >>= bHasGlow; CPPUNIT_ASSERT(bHasGlow); - sal_Int64 nRadius = -1; + sal_Int32 nRadius = -1; xShape->getPropertyValue("GlowEffectRad") >>= nRadius; - CPPUNIT_ASSERT_EQUAL(sal_Int64(139700l), nRadius); + CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRadius); // 139700 EMU = 388.0556 mm/100 Color nColor; xShape->getPropertyValue("GlowEffectColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0xFFC000), nColor); - sal_uInt16 nTransparency; + sal_Int16 nTransparency; xShape->getPropertyValue("GlowEffectTransparency") >>= nTransparency; - CPPUNIT_ASSERT_EQUAL(sal_uInt16(60), nTransparency); + CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency); } CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); |