summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorYifan J <yfjiang@suse.com>2013-03-20 17:48:07 +0800
committerMiklos Vajna <vmiklos@suse.cz>2013-03-20 12:08:19 +0100
commit9a7d2e0f5e7adb791fff6a52acd7425b31c11f61 (patch)
tree00f4889a27e9b0e20607d8bf8ca2fafd6c2d97e9 /sw/qa/extras
parent19802872052aaed9d3deff02b882b2043239a406 (diff)
ooxmlimport line numbering check
Change-Id: Ifa9d4cb45950a378dd0d82d4d262ffd9511d7f44
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tools-line-numbering.docxbin0 -> 15052 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx b/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx
new file mode 100644
index 000000000000..8fb2668b327e
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 5094e79551a8..94c934dbbf22 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -120,6 +120,7 @@ public:
void testFdo53985();
void testFdo59638();
void testFdo61343();
+ void testToolsLineNumbering();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -191,6 +192,7 @@ void Test::run()
{"fdo53985.docx", &Test::testFdo53985},
{"fdo59638.docx", &Test::testFdo59638},
{"fdo61343.docx", &Test::testFdo61343},
+ {"tools-line-numbering.docx", &Test::testToolsLineNumbering},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1243,6 +1245,41 @@ void Test::testFdo61343()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
}
+void Test::testToolsLineNumbering()
+{
+ /*
+ * Test the line numbering feature import (Tools->Line Numbering ...)
+ *
+ * xray ThisComponent.getLineNumberingProperties().IsOn == True
+ * xray ThisComponent.getLineNumberingProperties().CountEmptyLines == True
+ * xray ThisComponent.getLineNumberingProperties().NumberPosition == 0
+ * xray ThisComponent.getLineNumberingProperties().NumberingType == 4
+ * xray ThisComponent.getLineNumberingProperties().SeparatorInterval == 3
+ */
+
+ sal_Bool bValue = sal_False;
+ sal_Int32 nValue = -1;
+
+ uno::Reference< text::XTextDocument > xtextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference< text::XLineNumberingProperties > xLineProperties( xtextDocument, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xPropertySet = xLineProperties->getLineNumberingProperties();
+
+ xPropertySet->getPropertyValue("IsOn") >>= bValue;
+ CPPUNIT_ASSERT_EQUAL(sal_True, bValue);
+
+ xPropertySet->getPropertyValue("CountEmptyLines") >>= bValue;
+ CPPUNIT_ASSERT_EQUAL(sal_True, bValue);
+
+ xPropertySet->getPropertyValue("NumberPosition") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue);
+
+ xPropertySet->getPropertyValue("NumberingType") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4), nValue);
+
+ xPropertySet->getPropertyValue("SeparatorInterval") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();