summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-05-07 09:32:48 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-05-07 09:32:48 +0200
commitc450ea69921001621a1114369b3508bfa69bd088 (patch)
tree4989f9274bb926816546e2b0b2c5f20566c7ebd4 /writerfilter/source/rtftok
parent71bf95db0bf87424678ce62d526e14848cdafec7 (diff)
introduce msfilter::util::BGRToRGB to avoid copy&paste
Change-Id: Ic3fa8865bf3862407867b5e4a438e3d9bc723e86
Diffstat (limited to 'writerfilter/source/rtftok')
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 01b1d00d96b1..4fc04532cebf 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -35,6 +35,7 @@
#include <ooxml/resourceids.hxx> // NS_ooxml namespace
#include <filter/msfilter/escherex.hxx>
+#include <filter/msfilter/util.hxx>
#include <rtfsdrimport.hxx>
@@ -44,18 +45,6 @@ using rtl::OUString;
using rtl::OUStringBuffer;
using rtl::OUStringToOString;
-// NEEDSWORK: wwUtility::BGRToRGB does the same.
-static sal_uInt32 lcl_BGRToRGB(sal_uInt32 nColor)
-{
- 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;
-}
-
namespace writerfilter {
namespace rtftok {
@@ -132,14 +121,14 @@ void RTFSdrImport::resolve(RTFShape& rShape)
}
else if (i->first == "fillColor" && xPropertySet.is())
{
- aAny <<= lcl_BGRToRGB(i->second.toInt32());
+ aAny <<= msfilter::util::BGRToRGB(i->second.toInt32());
xPropertySet->setPropertyValue("FillColor", aAny);
}
else if ( i->first == "fillBackColor" )
; // Ignore: complementer of fillColor
else if (i->first == "lineColor" && xPropertySet.is())
{
- aAny <<= lcl_BGRToRGB(i->second.toInt32());
+ aAny <<= msfilter::util::BGRToRGB(i->second.toInt32());
xPropertySet->setPropertyValue("LineColor", aAny);
}
else if ( i->first == "lineBackColor" )