From bf123eeffc05907dfcb0d355ab17359353b0ede5 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 11 May 2012 14:45:59 +0200 Subject: fdo#45190 import of RTF_LI should reset inherited RTF_FI Change-Id: I17c287fa4daa399876b34182c02d9cf928fe1b6f --- sw/qa/extras/rtftok/data/fdo45190.rtf | 10 ++++++++++ sw/qa/extras/rtftok/rtftok.cxx | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sw/qa/extras/rtftok/data/fdo45190.rtf (limited to 'sw/qa') diff --git a/sw/qa/extras/rtftok/data/fdo45190.rtf b/sw/qa/extras/rtftok/data/fdo45190.rtf new file mode 100644 index 000000000000..613a283150f1 --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo45190.rtf @@ -0,0 +1,10 @@ +{\rtf1 +{\stylesheet +{\s1 \fi-100 style;} +} +\s1\li0 first +\par +\pard +\s1\fi-100\li0 second +\par +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index bff076a47954..29ea9be10ed4 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -92,6 +92,7 @@ public: void testFdo49501(); void testFdo49271(); void testFdo49692(); + void testFdo45190(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -127,6 +128,7 @@ public: CPPUNIT_TEST(testFdo49501); CPPUNIT_TEST(testFdo49271); CPPUNIT_TEST(testFdo49692); + CPPUNIT_TEST(testFdo45190); #endif CPPUNIT_TEST_SUITE_END(); @@ -721,6 +723,26 @@ void Test::testFdo49692() } } +void Test::testFdo45190() +{ + load("fdo45190.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + + // inherited \fi should be reset + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue); + + // but direct one not + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), nValue); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit