summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-01 16:30:06 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-01 16:40:11 +0200
commit9bbb849dd892fc79df4b2a06253c8cf02cbbcbdf (patch)
tree275b5a6b9f9285d15729c1560491b98dc665559e /sw/qa
parentc9337a8bfcd904d723c76525e2473578d5af4e77 (diff)
fdo#50539 fix RTF import of automatic character background color
Change-Id: I7efb3bce9a3a6f6c029d99de2264e00bb1bc7c93
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtftok/data/fdo50539.rtf4
-rw-r--r--sw/qa/extras/rtftok/rtftok.cxx18
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo50539.rtf b/sw/qa/extras/rtftok/data/fdo50539.rtf
new file mode 100644
index 000000000000..c8a13012f0b0
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo50539.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\chcbpat0\cf0
+bug
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 29ea9be10ed4..a37d02e8244b 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -93,6 +93,7 @@ public:
void testFdo49271();
void testFdo49692();
void testFdo45190();
+ void testFdo50539();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -129,6 +130,7 @@ public:
CPPUNIT_TEST(testFdo49271);
CPPUNIT_TEST(testFdo49692);
CPPUNIT_TEST(testFdo45190);
+ CPPUNIT_TEST(testFdo50539);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -743,6 +745,22 @@ void Test::testFdo45190()
CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), nValue);
}
+void Test::testFdo50539()
+{
+ load("fdo50539.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();
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black)
+ xPropertySet->getPropertyValue("CharBackColor") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();