testcase for fdo#45543

This commit is contained in:
Miklos Vajna
2012-02-13 21:54:18 +01:00
parent 2fce337212
commit c26d9befba
2 changed files with 31 additions and 0 deletions

View File

@@ -49,11 +49,13 @@ public:
virtual void tearDown();
void testFdo45553();
void testN192129();
void testFdo45543();
CPPUNIT_TEST_SUITE(RtfModelTest);
#if !defined(MACOSX) && !defined(WNT)
CPPUNIT_TEST(testFdo45553);
CPPUNIT_TEST(testN192129);
CPPUNIT_TEST(testFdo45543);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -136,6 +138,27 @@ void RtfModelTest::testN192129()
CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height);
}
void RtfModelTest::testFdo45543()
{
load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo45543.rtf")));
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
OUStringBuffer aBuf;
while (xParaEnum->hasMoreElements())
{
uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
while (xRangeEnum->hasMoreElements())
{
uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
aBuf.append(xRange->getString());
}
}
CPPUNIT_ASSERT_EQUAL(5, aBuf.getLength());
}
CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();