summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2024-08-21 17:34:23 +0200
committerBalazs Varga <balazs.varga.extern@allotropia.de>2024-08-29 19:59:24 +0200
commit3eac847927a0cdfa40c3fea38c473ed2ad7faecc (patch)
treed1e26675fb6aca7d8751426c010b0b9e33d5c7e3 /sd/qa/unit
parent786aed3a35a50c0e147e15d29c88987aaf523775 (diff)
tdf#161826 - Add uniform Glow effect for texts in shapes
- Add new text Glow effect properties for shapes - Using TextGlowPrimitive for rendering uniform text glow in shapes - Add/allow new UI Glow Effect for texts in shapes on sidebar (Only for Impress/Draw and Calc) - Import/Export ooxml files with Glow effect on texts in shapes (Only PPTX/XLSX) - Import/Export odf files with Glow effect on texts in shapes - Add unit test for glow text attributes in ODF - Add uni tests for OOXML import/export Note: Also this patch effects on tdf#144061 - Effects: Allow GLOW to apply to Text (as we have for shapes) Change-Id: I16586c01654f197f532129e4e06aa2ef9f214395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172216 Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de> Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd/qa/unit')
-rw-r--r--sd/qa/unit/data/odp/shape-text-glow-effect.odpbin0 -> 28028 bytes
-rw-r--r--sd/qa/unit/data/pptx/shape-text-glow-effect.pptxbin0 -> 34693 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml4.cxx16
-rw-r--r--sd/qa/unit/export-tests.cxx41
-rw-r--r--sd/qa/unit/import-tests2.cxx16
5 files changed, 73 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/shape-text-glow-effect.odp b/sd/qa/unit/data/odp/shape-text-glow-effect.odp
new file mode 100644
index 000000000000..944d281cf99d
--- /dev/null
+++ b/sd/qa/unit/data/odp/shape-text-glow-effect.odp
Binary files differ
diff --git a/sd/qa/unit/data/pptx/shape-text-glow-effect.pptx b/sd/qa/unit/data/pptx/shape-text-glow-effect.pptx
new file mode 100644
index 000000000000..945c9baf5374
--- /dev/null
+++ b/sd/qa/unit/data/pptx/shape-text-glow-effect.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx
index 054e2232107a..38afc68be086 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -474,6 +474,22 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeGlowEffect)
CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency);
}
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeTextGlowEffect)
+{
+ createSdImpressDoc("pptx/shape-text-glow-effect.pptx");
+ saveAndReload(u"Impress Office Open XML"_ustr);
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
+ sal_Int32 nRadius = -1;
+ xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nRadius;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(706), nRadius); // 20 pt = 706 mm/100
+ Color nColor;
+ xShape->getPropertyValue(u"GlowTextEffectColor"_ustr) >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(Color(0x4EA72E), nColor);
+ sal_Int16 nTransparency;
+ xShape->getPropertyValue(u"GlowTextEffectTransparency"_ustr) >>= nTransparency;
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(5), nTransparency);
+}
+
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testUnderline)
{
createSdImpressDoc("underline.fodp");
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 04ce872ffe10..c5630158f0d7 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1534,6 +1534,47 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testGlow)
"glow-transparency"_ostr, u"60%"_ustr);
}
+CPPUNIT_TEST_FIXTURE(SdExportTest, testGlowTextInShape)
+{
+ createSdImpressDoc("odp/shape-text-glow-effect.odp");
+ saveAndReload(u"impress8"_ustr);
+
+ uno::Reference<drawing::XDrawPage> xDP(getPage(0));
+ uno::Reference<beans::XPropertySet> xShape(xDP->getByIndex(0), uno::UNO_QUERY);
+
+ // Check glow text properties in shapes
+ sal_Int32 nGlowEffectRad = 0;
+ CPPUNIT_ASSERT(xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nGlowEffectRad);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(706), nGlowEffectRad); // 20 pt = 706 mm/100
+ Color nGlowEffectColor;
+ CPPUNIT_ASSERT(xShape->getPropertyValue(u"GlowTextEffectColor"_ustr) >>= nGlowEffectColor);
+ CPPUNIT_ASSERT_EQUAL(Color(0x4EA72E), nGlowEffectColor);
+ sal_Int16 nGlowEffectTransparency = 0;
+ CPPUNIT_ASSERT(xShape->getPropertyValue(u"GlowTextEffectTransparency"_ustr)
+ >>= nGlowEffectTransparency);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(5), nGlowEffectTransparency);
+
+ // Test ODF element
+ xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
+
+ // check that we actually test graphic style
+ assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[3]"_ostr,
+ "family"_ostr, u"graphic"_ustr);
+ // check loext graphic attributes for th
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[3]/style:graphic-properties"_ostr,
+ "glow-text-radius"_ostr, u"0.706cm"_ustr);
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[3]/style:graphic-properties"_ostr,
+ "glow-text-color"_ostr, u"#4ea72e"_ustr);
+ assertXPath(
+ pXmlDoc,
+ "/office:document-content/office:automatic-styles/style:style[3]/style:graphic-properties"_ostr,
+ "glow-text-transparency"_ostr, u"5%"_ustr);
+}
+
CPPUNIT_TEST_FIXTURE(SdExportTest, testSoftEdges)
{
createSdDrawDoc("odg/softedges.odg");
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index d66e12a52663..a39bc847c784 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1664,6 +1664,22 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeGlowEffectPPTXImpoer)
CPPUNIT_ASSERT_EQUAL(sal_Int16(60), nTransparency);
}
+CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeTextGlowEffectPPTXImport)
+{
+ createSdImpressDoc("pptx/shape-text-glow-effect.pptx");
+
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
+ sal_Int32 nRadius = -1;
+ xShape->getPropertyValue(u"GlowTextEffectRadius"_ustr) >>= nRadius;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(706), nRadius); // 20 pt = 706 mm/100
+ Color nColor;
+ xShape->getPropertyValue(u"GlowTextEffectColor"_ustr) >>= nColor;
+ CPPUNIT_ASSERT_EQUAL(Color(0x4EA72E), nColor);
+ sal_Int16 nTransparency;
+ xShape->getPropertyValue(u"GlowTextEffectTransparency"_ustr) >>= nTransparency;
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(5), nTransparency);
+}
+
CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeBlurPPTXImport)
{
createSdImpressDoc("pptx/shape-blur-effect.pptx");