summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2014-11-08 07:45:16 -0800
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-09 22:42:20 +0100
commit1a0f494be698dbb20ff7c7eb66fc84db498cfa45 (patch)
tree10619fecaa4ce8353f03e9a915d05282a663aa04 /sw/qa
parente24ed4e3a0bf603f2ea359b10542477ddd654564 (diff)
CJK Numbered list test cases for ooxmlimport and ww8import.
Reviewed on: https://gerrit.libreoffice.org/12319 Change-Id: I8c23aa97a16feae32071cb2f71f1b63d771c467c
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/cjklist30.docxbin0 -> 13395 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/cjklist31.docxbin0 -> 13406 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/cjklist34.docxbin0 -> 13414 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/cjklist35.docxbin0 -> 13394 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx52
-rw-r--r--sw/qa/extras/ww8export/data/cjklist30.docbin0 -> 27648 bytes
-rw-r--r--sw/qa/extras/ww8export/data/cjklist31.docbin0 -> 27648 bytes
-rw-r--r--sw/qa/extras/ww8export/data/cjklist34.docbin0 -> 27648 bytes
-rw-r--r--sw/qa/extras/ww8export/data/cjklist35.docbin0 -> 23552 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx52
10 files changed, 104 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/cjklist30.docx b/sw/qa/extras/ooxmlexport/data/cjklist30.docx
new file mode 100644
index 000000000000..b2efbb995d5f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/cjklist30.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/cjklist31.docx b/sw/qa/extras/ooxmlexport/data/cjklist31.docx
new file mode 100644
index 000000000000..95d4c9aeba16
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/cjklist31.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/cjklist34.docx b/sw/qa/extras/ooxmlexport/data/cjklist34.docx
new file mode 100644
index 000000000000..c09615aa2b41
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/cjklist34.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/cjklist35.docx b/sw/qa/extras/ooxmlexport/data/cjklist35.docx
new file mode 100644
index 000000000000..85aa24fc2089
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/cjklist35.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c06ed65c54c9..851d72efaaa9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -41,6 +41,30 @@ protected:
// If the testcase is stored in some other format, it's pointless to test.
return (OString(filename).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end());
}
+protected:
+ bool CjkNumberedListTestHelper(sal_Int16 &nValue)
+ {
+ bool isNumber;
+ uno::Reference<text::XTextRange> xPara(getParagraph(1));
+ uno::Reference< beans::XPropertySet > properties( xPara, uno::UNO_QUERY);
+ properties->getPropertyValue("NumberingIsNumber") >>= isNumber;
+ if (!isNumber)
+ return false;
+ uno::Reference<container::XIndexAccess> xLevels( properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+ uno::Sequence< beans::PropertyValue > aPropertyValue;
+ xLevels->getByIndex(0) >>= aPropertyValue;
+ for( int j = 0 ; j< aPropertyValue.getLength() ; ++j)
+ {
+ beans::PropertyValue aProp= aPropertyValue[j];
+ if (aProp.Name == "NumberingType")
+ {
+ nValue = aProp.Value.get<sal_Int16>();
+ return true;
+ }
+ }
+ return false;
+
+ }
};
DECLARE_OOXMLEXPORT_TEST(testfdo81381, "fdo81381.docx")
@@ -513,6 +537,34 @@ DECLARE_OOXMLEXPORT_TEST(testTableRtl, "table-rtl.docx")
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
}
+DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist30, "cjklist30.docx")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::TIAN_GAN_ZH, numFormat);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist31, "cjklist31.docx")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::DI_ZI_ZH, numFormat);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist34, "cjklist34.docx")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH_TW, numFormat);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist35, "cjklist35.docx")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ww8export/data/cjklist30.doc b/sw/qa/extras/ww8export/data/cjklist30.doc
new file mode 100644
index 000000000000..48f22cf79a35
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/cjklist30.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/cjklist31.doc b/sw/qa/extras/ww8export/data/cjklist31.doc
new file mode 100644
index 000000000000..4a7d3e7e1360
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/cjklist31.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/cjklist34.doc b/sw/qa/extras/ww8export/data/cjklist34.doc
new file mode 100644
index 000000000000..551fc89527c9
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/cjklist34.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/data/cjklist35.doc b/sw/qa/extras/ww8export/data/cjklist35.doc
new file mode 100644
index 000000000000..33d247029ad9
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/cjklist35.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index c1e6ca681a20..019c87b24eb9 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -28,6 +28,29 @@ public:
// If the testcase is stored in some other format, it's pointless to test.
return OString(filename).endsWith(".doc");
}
+protected:
+ bool CjkNumberedListTestHelper(sal_Int16 &nValue)
+ {
+ bool isNumber;
+ uno::Reference<text::XTextRange> xPara(getParagraph(1));
+ uno::Reference< beans::XPropertySet > properties( xPara, uno::UNO_QUERY);
+ properties->getPropertyValue("NumberingIsNumber") >>= isNumber;
+ if (!isNumber)
+ return false;
+ uno::Reference<container::XIndexAccess> xLevels( properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+ uno::Sequence< beans::PropertyValue > aPropertyValue;
+ xLevels->getByIndex(0) >>= aPropertyValue;
+ for( int j = 0 ; j< aPropertyValue.getLength() ; ++j)
+ {
+ beans::PropertyValue aProp= aPropertyValue[j];
+ if (aProp.Name == "NumberingType")
+ {
+ nValue = aProp.Value.get<sal_Int16>();
+ return true;
+ }
+ }
+ return false;
+ }
};
DECLARE_WW8EXPORT_TEST(testN325936, "n325936.doc")
@@ -388,6 +411,35 @@ DECLARE_WW8EXPORT_TEST(testBnc636128, "bnc636128.doc")
CPPUNIT_ASSERT_EQUAL(OUString("5"), xParameters->getByName("MaxLength").get<OUString>());
}
+
+DECLARE_WW8EXPORT_TEST(testWw8Cjklist30, "cjklist30.doc")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::TIAN_GAN_ZH, numFormat);
+}
+
+DECLARE_WW8EXPORT_TEST(testWw8Cjklist31, "cjklist31.doc")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::DI_ZI_ZH, numFormat);
+}
+
+DECLARE_WW8EXPORT_TEST(testWw8Cjklist34, "cjklist34.doc")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH_TW, numFormat);
+}
+
+DECLARE_WW8EXPORT_TEST(testWw8Cjklist35, "cjklist35.doc")
+{
+ sal_Int16 numFormat;
+ CPPUNIT_ASSERT(CjkNumberedListTestHelper(numFormat));
+ CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_LOWER_ZH, numFormat);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */