sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 37 ++++++++++++++++ 2 files changed, 37 insertions(+)
New commits: commit 9a7d2e0f5e7adb791fff6a52acd7425b31c11f61 Author: Yifan J <[email protected]> Date: Wed Mar 20 17:48:07 2013 +0800 ooxmlimport line numbering check Change-Id: Ifa9d4cb45950a378dd0d82d4d262ffd9511d7f44 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 0000000..8fb2668 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tools-line-numbering.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 5094e79..94c934d 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(); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
