testcase for fdo#46662

This commit is contained in:
Miklos Vajna 2012-03-01 11:38:47 +01:00
parent 58272b9831
commit 7029ccec25
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,46 @@
{\rtf1
{\*\listtable
{\list\listtemplateid3
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
{\leveltext\'01\'00;}
{\levelnumbers\'01;}
\fi-360\li720\lin720 }
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
{\leveltext\'03\'00.\'01;}
{\levelnumbers\'01\'03;}
\fi-360\li1080\lin1080 }
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
{\leveltext\'05\'00.\'01.\'02;}
{\levelnumbers\'01\'03\'05;}
\fi-360\li1440\lin1440
}
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
{\leveltext\'07\'00.\'01.\'02.\'03;}
{\levelnumbers\'01\'03\'05\'07;}
\fi-360\li1800\lin1800 }
\listid3}
}
{\*\listoverridetable
{\listoverride\listid3\listoverridecount0\ls3}
}
\pard\ls3
{numbering with all sublevels: test 1
\par
}
\pard\ls3\ilvl1
{test 1.1
\par
}
\pard\ls3\ilvl2
{test 1.1.1
\par
}
\pard\ls3\ilvl3
{test 1.1.1.1
\par
}
\pard\ls3
{test 2
\par
}
}

View File

@ -28,6 +28,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
@ -60,6 +61,7 @@ public:
void testN695479();
void testFdo42465();
void testFdo45187();
void testFdo46662();
CPPUNIT_TEST_SUITE(RtfModelTest);
#if !defined(MACOSX) && !defined(WNT)
@ -69,6 +71,7 @@ public:
CPPUNIT_TEST(testN695479);
CPPUNIT_TEST(testFdo42465);
CPPUNIT_TEST(testFdo45187);
CPPUNIT_TEST(testFdo46662);
#endif
CPPUNIT_TEST_SUITE_END();
@ -266,6 +269,38 @@ void RtfModelTest::testFdo45187()
CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y);
}
void RtfModelTest::testFdo46662()
{
load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo46662.rtf")));
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xNumberingStyles(xStyles->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("NumberingStyles"))), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xPropertySet(xNumberingStyles->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("WWNum3"))), uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NumberingRules"))), uno::UNO_QUERY);
uno::Any aValue = xLevels->getByIndex(1); // 2nd level
uno::Sequence<beans::PropertyValue> aProps;
aValue >>= aProps;
for (int i = 0; i < aProps.getLength(); ++i)
{
const beans::PropertyValue& rProp = aProps[i];
if (rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ParentNumbering")))
{
sal_Int16 nValue;
rProp.Value >>= nValue;
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nValue);
}
else if (rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Suffix")))
{
rtl::OUString sValue;
rProp.Value >>= sValue;
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
}
}
}
CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
CPPUNIT_PLUGIN_IMPLEMENT();