diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 46ea5a82c757..1f5b31b22611 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -258,6 +258,15 @@ static const char* lcl_RtfToString(RTFKeyword nKeyword) } return NULL; } + +sal_uInt32 lcl_BrgToRgb(sal_uInt32 nBrg) +{ + sal_uInt32 nBlue = (nBrg & 0xff0000) >> 16; + sal_uInt32 nGreen = (nBrg & 0x00ff00) >> 8; + sal_uInt32 nRed = nBrg & 0x0000ff; + return (nRed << 16) | (nGreen << 8) | nBlue; +} + RTFDocumentImpl::RTFDocumentImpl(uno::Reference const& xContext, uno::Reference const& xInputStream, uno::Reference const& xDstDoc, @@ -2424,6 +2433,7 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair xShape; xShape.set(m_xModelFactory->createInstance(aService), uno::UNO_QUERY); + uno::Reference xPropertySet(xShape, uno::UNO_QUERY); for (std::vector< std::pair >::iterator i = rShapeProperties.begin(); i != rShapeProperties.end(); ++i) { @@ -2447,6 +2457,12 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pairsecond); bPib = true; } + else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("fillColor"))) + { + uno::Any aColor; + aColor <<= lcl_BrgToRgb(i->second.toInt32()); + xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), aColor); + } else OSL_TRACE("%s: TODO handle shape property '%s':'%s'", OSL_THIS_FUNC, OUStringToOString( i->first, RTL_TEXTENCODING_UTF8 ).getStr(),