summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-05-09 11:56:35 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2017-05-10 11:17:09 +0200
commita470d16208a78ae6893d199b3b6bc77a8559b06a (patch)
treebdfd6070cb742be3d4bda7204c8fe731ecace202 /sw/qa
parent4c0fb07f342d4bd0101fd5764f101f0adfc3001e (diff)
AutoText: add only real AutoText entries
* add only autoTxT gallery type * new test with other types of entries Change-Id: Ibf7751c73dcf3b6ebd69eec5f4931dbeaaf098c8 Reviewed-on: https://gerrit.libreoffice.org/37425 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/data/autotext-gallery.dotxbin0 -> 18550 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/autotext-gallery.dotx b/sw/qa/extras/uiwriter/data/autotext-gallery.dotx
new file mode 100644
index 000000000000..827ec60c29f4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/autotext-gallery.dotx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 57e41ebf5765..0d40ae1829a1 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -124,6 +124,7 @@ public:
void testDOCXAutoTextEmpty();
void testDOCXAutoTextMultiple();
void testDOTMAutoText();
+ void testDOCXAutoTextGallery();
void testTdf67238();
void testFdo75110();
void testFdo75898();
@@ -255,6 +256,7 @@ public:
CPPUNIT_TEST(testDOCXAutoTextEmpty);
CPPUNIT_TEST(testDOCXAutoTextMultiple);
CPPUNIT_TEST(testDOTMAutoText);
+ CPPUNIT_TEST(testDOCXAutoTextGallery);
CPPUNIT_TEST(testTdf67238);
CPPUNIT_TEST(testFdo75110);
CPPUNIT_TEST(testFdo75898);
@@ -825,6 +827,22 @@ void SwUiWriterTest::testDOTMAutoText()
CPPUNIT_ASSERT_EQUAL(OUString("paragraph"), rNode.GetTextNode()->GetText());
}
+void SwUiWriterTest::testDOCXAutoTextGallery()
+{
+ // this file contains one AutoText entry and other
+ // entries which are not AutoText (have different "gallery" value)
+ std::unique_ptr<SwTextBlocks> pGlossary = readDOCXAutotext("autotext-gallery.dotx");
+
+ SwDoc* pDoc = pGlossary->GetDoc();
+ CPPUNIT_ASSERT(pDoc != nullptr);
+
+ // check entries count
+ CPPUNIT_ASSERT_EQUAL((sal_uInt16)1, pGlossary->GetCount());
+
+ // check entry name (if not contains gallery type)
+ CPPUNIT_ASSERT_EQUAL(OUString("Multiple"), pGlossary->GetLongName(0));
+}
+
void SwUiWriterTest::testFdo74981()
{
// create a document with an input field