[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/qa
Marco Cecchetti (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 20 10:05:52 UTC 2021
sd/qa/unit/SVGExportTests.cxx | 32 ++++++++++++++++++++++++++++++--
sd/qa/unit/data/odp/text-fields.odp |binary
2 files changed, 30 insertions(+), 2 deletions(-)
New commits:
commit abfc973318a7432e0b95c232cf6c9326408f51d0
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Mon Jan 18 12:36:42 2021 +0100
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Wed Jan 20 11:05:20 2021 +0100
filter: svg: js engine: text fields support: unit test
Change-Id: I80a7e7906fb2a82d955562a137b208497d4c0d9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109543
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Marco Cecchetti <marco.cecchetti at collabora.com>
diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index 3ed2ab2de02d..ab9b55658f23 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -125,7 +125,7 @@ public:
1);
}
- void testSVGExporSlidetCustomBackground()
+ void testSVGExportSlideCustomBackground()
{
executeExport("slide-custom-background.odp");
@@ -135,10 +135,38 @@ public:
assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_DEFS ), "class", "SlideBackground");
}
+ void testSVGExportTextFieldsInMasterPage()
+ {
+ executeExport("text-fields.odp");
+
+ xmlDocPtr svgDoc = parseXml(maTempFile);
+ CPPUNIT_ASSERT(svgDoc);
+
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2] ), "class", "Master_Slide");
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2] ), "class", "BackgroundObjects");
+ // Current Date Field
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4] ), "class", "com.sun.star.drawing.TextShape");
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText");
+ assertXPathContent(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[4]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "<date>");
+ // Current Time Field
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5] ), "class", "com.sun.star.drawing.TextShape");
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText");
+ assertXPathContent(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[5]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "<time>");
+ // Slide Name Field
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6] ), "class", "com.sun.star.drawing.TextShape");
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText");
+ assertXPathContent(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[6]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "<slide-name>");
+ // Slide Number Field
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7] ), "class", "com.sun.star.drawing.TextShape");
+ assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "class", "PlaceholderText");
+ assertXPathContent(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "<number>");
+ }
+
CPPUNIT_TEST_SUITE(SdSVGFilterTest);
CPPUNIT_TEST(testSVGExportTextDecorations);
CPPUNIT_TEST(testSVGExportJavascriptURL);
- CPPUNIT_TEST(testSVGExporSlidetCustomBackground);
+ CPPUNIT_TEST(testSVGExportSlideCustomBackground);
+ CPPUNIT_TEST(testSVGExportTextFieldsInMasterPage);
CPPUNIT_TEST_SUITE_END();
};
diff --git a/sd/qa/unit/data/odp/text-fields.odp b/sd/qa/unit/data/odp/text-fields.odp
new file mode 100644
index 000000000000..3c5d057ba2f0
Binary files /dev/null and b/sd/qa/unit/data/odp/text-fields.odp differ
More information about the Libreoffice-commits
mailing list