Kaydet (Commit) 9a7d2e0f authored tarafından Yifan J's avatar Yifan J Kaydeden (comit) Miklos Vajna

ooxmlimport line numbering check

Change-Id: Ifa9d4cb45950a378dd0d82d4d262ffd9511d7f44
üst 19802872
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment