summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-12-04 10:38:53 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-12-04 10:59:19 +0100
commit41890bf714803969515578b47e63fa9730ea7090 (patch)
treeedcb686683025ed1e193119e6b6b6627e1e8d376 /sw/qa
parent5da8bdb4d4bde5175c9e89182956043ffc991c50 (diff)
fdo#54473 fdo#57133 fix RTF import of character styles
Regression from commit d2d77fd86e6cb7341e113557e2cfe3d7948759bd Change-Id: I7accc5c383de3fa53c12527766c3fc155bfa9863
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo54473.rtf10
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo54473.rtf b/sw/qa/extras/rtfimport/data/fdo54473.rtf
new file mode 100644
index 000000000000..7bb6208fe304
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo54473.rtf
@@ -0,0 +1,10 @@
+{\rtf1\ansi
+{\stylesheet
+{\*\cs16\ul Anot;}
+{\*\cs15\i ForeignTxt;}
+}
+{\cs16\ul Text }
+with
+{\cs15\i character }
+formatting
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 7853fc35190f..826ca966b4bd 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -127,6 +127,7 @@ public:
void testFdo48442();
void testFdo55525();
void testFdo57708();
+ void testFdo54473();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -204,6 +205,7 @@ void Test::run()
{"fdo48442.rtf", &Test::testFdo48442},
{"fdo55525.rtf", &Test::testFdo55525},
{"fdo57708.rtf", &Test::testFdo57708},
+ {"fdo54473.rtf", &Test::testFdo54473},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -941,6 +943,13 @@ void Test::testFdo57708()
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount());
}
+void Test::testFdo54473()
+{
+ // The problem was that character styles were not imported due to a typo.
+ CPPUNIT_ASSERT_EQUAL(OUString("Anot"), getProperty<OUString>(getRun(getParagraph(1), 1, "Text "), "CharStyleName"));
+ CPPUNIT_ASSERT_EQUAL(OUString("ForeignTxt"), getProperty<OUString>(getRun(getParagraph(1), 3, "character "), "CharStyleName"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();