diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-06-17 15:31:11 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-06-19 11:14:01 +0200 |
commit | c23408aeafc1f2ce3f7dde685d0b519d8e2daff7 (patch) | |
tree | 93d0669bb6c3fa907bb5f3dcb9e62e6fe31d5ca3 /sw/qa | |
parent | 37cd5bd4fdf2317709882c933844c4cc67e4cee4 (diff) |
indexing: indexing shapes/text boxes for the IndexingExport
Adds handling of shapes and text boxes to the IndexingExport with
exporting the the name, alt text, description and paragraphs of
the inner shape text to the indexing xml.
Change-Id: I3db68078b7e793cab552b4f7f8e8ddf9bfd1a6f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117359
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/indexing/IndexingExportTest.cxx | 30 | ||||
-rw-r--r-- | sw/qa/extras/indexing/data/IndexingExport_Shapes.odt | bin | 0 -> 11209 bytes |
2 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/indexing/IndexingExportTest.cxx b/sw/qa/extras/indexing/IndexingExportTest.cxx index 807f84ab6934..350e75c3d49f 100644 --- a/sw/qa/extras/indexing/IndexingExportTest.cxx +++ b/sw/qa/extras/indexing/IndexingExportTest.cxx @@ -29,11 +29,13 @@ public: void testIndexingExport_Paragraphs(); void testIndexingExport_Images(); void testIndexingExport_OLE(); + void testIndexingExport_Shapes(); CPPUNIT_TEST_SUITE(IndexingExportTest); CPPUNIT_TEST(testIndexingExport_Paragraphs); CPPUNIT_TEST(testIndexingExport_Images); CPPUNIT_TEST(testIndexingExport_OLE); + CPPUNIT_TEST(testIndexingExport_Shapes); CPPUNIT_TEST_SUITE_END(); }; @@ -120,6 +122,34 @@ void IndexingExportTest::testIndexingExport_OLE() assertXPath(pXmlDoc, "/indexing/ole[1]", "alt", "Alt Text"); } +void IndexingExportTest::testIndexingExport_Shapes() +{ + SwDoc* pDoc = createDoc("IndexingExport_Shapes.odt"); + CPPUNIT_ASSERT(pDoc); + + SvMemoryStream aMemoryStream; + sw::IndexingExport aIndexingExport(aMemoryStream, pDoc); + aIndexingExport.runExport(); + aMemoryStream.Seek(0); + + xmlDocUniquePtr pXmlDoc = parseXmlStream(&aMemoryStream); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/indexing"); + + assertXPath(pXmlDoc, "/indexing/shape[1]", "name", "Circle"); + assertXPathContent(pXmlDoc, "/indexing/shape[1]/paragraph[1]", "This is a circle"); + assertXPathContent(pXmlDoc, "/indexing/shape[1]/paragraph[2]", "This is a second paragraph"); + + assertXPath(pXmlDoc, "/indexing/shape[2]", "name", "Diamond"); + assertXPathContent(pXmlDoc, "/indexing/shape[2]/paragraph[1]", "This is a diamond"); + + assertXPath(pXmlDoc, "/indexing/shape[3]", "name", "Text Frame 1"); + assertXPathContent(pXmlDoc, "/indexing/shape[3]/paragraph[1]", "This is a TextBox - Para1"); + assertXPathContent(pXmlDoc, "/indexing/shape[3]/paragraph[2]", "Para2"); + assertXPathContent(pXmlDoc, "/indexing/shape[3]/paragraph[3]", "Para3"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(IndexingExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/indexing/data/IndexingExport_Shapes.odt b/sw/qa/extras/indexing/data/IndexingExport_Shapes.odt Binary files differnew file mode 100644 index 000000000000..8d37145ea30a --- /dev/null +++ b/sw/qa/extras/indexing/data/IndexingExport_Shapes.odt |