summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2011-07-06 11:01:56 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2011-07-29 17:32:36 +0200
commitdbf2ad161fdead7ca29fb96f5d8eb9f4da604827 (patch)
treea9c67ab16212c0fc7d5163ba24926281e20462c9
parentbff7dd2614f1368c1157c8647e563ab78b6b599b (diff)
add comment explaining ww8 import does the same
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1f5b31b22611..8320b30d2bdb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -259,12 +259,16 @@ static const char* lcl_RtfToString(RTFKeyword nKeyword)
return NULL;
}
-sal_uInt32 lcl_BrgToRgb(sal_uInt32 nBrg)
+// NEEDSWORK: wwUtility::BGRToRGB does the same.
+sal_uInt32 lcl_BGRToRGB(sal_uInt32 nColor)
{
- sal_uInt32 nBlue = (nBrg & 0xff0000) >> 16;
- sal_uInt32 nGreen = (nBrg & 0x00ff00) >> 8;
- sal_uInt32 nRed = nBrg & 0x0000ff;
- return (nRed << 16) | (nGreen << 8) | nBlue;
+ sal_uInt8
+ r(static_cast<sal_uInt8>(nColor&0xFF)),
+ g(static_cast<sal_uInt8>(((nColor)>>8)&0xFF)),
+ b(static_cast<sal_uInt8>((nColor>>16)&0xFF)),
+ t(static_cast<sal_uInt8>((nColor>>24)&0xFF));
+ nColor = (t<<24) + (r<<16) + (g<<8) + b;
+ return nColor;
}
RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& xContext,
@@ -2460,7 +2464,7 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair<rtl::OUStrin
else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("fillColor")))
{
uno::Any aColor;
- aColor <<= lcl_BrgToRgb(i->second.toInt32());
+ aColor <<= lcl_BGRToRGB(i->second.toInt32());
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")), aColor);
}
else