summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng24
-rw-r--r--sd/qa/unit/data/odg/glow.odgbin0 -> 8297 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx50
3 files changed, 74 insertions, 0 deletions
diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
index a61f6da11f71..5e1a587fda74 100644
--- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
+++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng
@@ -920,6 +920,30 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
<rng:ref name="boolean"/>
</rng:attribute>
</rng:optional>
+ <!-- TODO: no proposal for loext:glow* -->
+ <rng:optional>
+ <rng:attribute name="loext:glow">
+ <rng:choice>
+ <rng:value>visible</rng:value>
+ <rng:value>hidden</rng:value>
+ </rng:choice>
+ </rng:attribute>
+ </rng:optional>
+ <rng:optional>
+ <rng:attribute name="loext:glow-radius">
+ <rng:ref name="length"/>
+ </rng:attribute>
+ </rng:optional>
+ <rng:optional>
+ <rng:attribute name="loext:glow-color">
+ <rng:ref name="color"/>
+ </rng:attribute>
+ </rng:optional>
+ <rng:optional>
+ <rng:attribute name="loext:glow-transparency">
+ <rng:ref name="zeroToHundredPercent"/>
+ </rng:attribute>
+ </rng:optional>
</rng:interleave>
</rng:define>
diff --git a/sd/qa/unit/data/odg/glow.odg b/sd/qa/unit/data/odg/glow.odg
new file mode 100644
index 000000000000..11d697c491da
--- /dev/null
+++ b/sd/qa/unit/data/odg/glow.odg
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 285294bca8ea..de092590f2cd 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -74,6 +74,7 @@ public:
void testTdf123557();
void testTdf113822();
void testTdf126761();
+ void testGlow();
CPPUNIT_TEST_SUITE(SdExportTest);
@@ -108,6 +109,7 @@ public:
CPPUNIT_TEST(testTdf123557);
CPPUNIT_TEST(testTdf113822);
CPPUNIT_TEST(testTdf126761);
+ CPPUNIT_TEST(testGlow);
CPPUNIT_TEST_SUITE_END();
@@ -1257,6 +1259,54 @@ void SdExportTest::testTdf126761()
xDocShRef->DoClose();
}
+void SdExportTest::testGlow()
+{
+ auto xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odg/glow.odg"), ODG);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), ODG, &tempFile);
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
+
+ // Check glow properties
+ bool bGlowEffect = false;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffect") >>= bGlowEffect);
+ CPPUNIT_ASSERT(bGlowEffect);
+ sal_Int32 nGlowEffectRad = 0;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectRad") >>= nGlowEffectRad);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(190500), nGlowEffectRad); // 15 pt = 190500 EMU
+ sal_Int32 nGlowEffectColor = 0;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectColor") >>= nGlowEffectColor);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF4000), nGlowEffectColor); // "Brick"
+ sal_Int16 nGlowEffectTransparency = 0;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("GlowEffectTransparency") >>= nGlowEffectTransparency);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nGlowEffectTransparency); // 60%
+
+ // Test ODF element
+ xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
+
+ // check that we actually test graphic style
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[2]",
+ "family", "graphic");
+ // check loext graphic attributes
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties",
+ "glow", "visible");
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties",
+ "glow-radius", "190.5cm"); // ???
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties",
+ "glow-color", "#ff4000");
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[2]/style:graphic-properties",
+ "glow-transparency", "60%");
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();