fdo#47764 fix RTF import of automatic paragraph background color
Change-Id: I4b3a4bd6ce45cffc5b2c23052c49ff98579c5564
This commit is contained in:
4
sw/qa/extras/rtftok/data/fdo47764.rtf
Normal file
4
sw/qa/extras/rtftok/data/fdo47764.rtf
Normal file
@@ -0,0 +1,4 @@
|
||||
{\rtf1
|
||||
\cbpat0\cf0
|
||||
bug
|
||||
}
|
@@ -91,6 +91,7 @@ public:
|
||||
void testFdo48193();
|
||||
void testFdo44211();
|
||||
void testFdo48037();
|
||||
void testFdo47764();
|
||||
|
||||
CPPUNIT_TEST_SUITE(Test);
|
||||
#if !defined(MACOSX) && !defined(WNT)
|
||||
@@ -120,6 +121,7 @@ public:
|
||||
CPPUNIT_TEST(testFdo48193);
|
||||
CPPUNIT_TEST(testFdo44211);
|
||||
CPPUNIT_TEST(testFdo48037);
|
||||
CPPUNIT_TEST(testFdo47764);
|
||||
#endif
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
@@ -660,6 +662,20 @@ void Test::testFdo48037()
|
||||
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
|
||||
}
|
||||
|
||||
void Test::testFdo47764()
|
||||
{
|
||||
load("fdo47764.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<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
|
||||
sal_Int32 nValue = 0;
|
||||
// \cbpat with zero argument should mean the auto (-1) color, not a default color (black)
|
||||
xPropertySet->getPropertyValue("ParaBackColor") >>= nValue;
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
@@ -2331,6 +2331,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
|
||||
}
|
||||
break;
|
||||
case RTF_CBPAT:
|
||||
if (nParam)
|
||||
{
|
||||
RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam)));
|
||||
lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_sprm::LN_PShd, NS_ooxml::LN_CT_Shd_fill, pValue);
|
||||
|
Reference in New Issue
Block a user