summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml/OOXMLPropertySet.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLPropertySet.cxx')
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySet.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index 916c1b9a4902..79af27a96178 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -23,6 +23,7 @@
#include <ooxml/QNameToString.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <oox/token/tokens.hxx>
+#include <sax/tools/converter.hxx>
#include <tools/color.hxx>
namespace writerfilter {
@@ -590,6 +591,20 @@ OOXMLHexColorValue::OOXMLHexColorValue(const char * pValue)
else
{
mnValue = rtl_str_toUInt32(pValue, 16);
+
+ // Convert hash-encoded values (like #FF0080)
+ const sal_Int32 nLen = strlen(pValue);
+ if ( !mnValue && nLen > 1 && pValue[0] == '#' )
+ {
+ sal_Int32 nColor(COL_AUTO);
+ // Word appears to require strict 6 digit length, else it ignores it
+ if ( nLen == 7 )
+ {
+ const OUString sHashColor(pValue, nLen, RTL_TEXTENCODING_ASCII_US);
+ sax::Converter::convertColor( nColor, sHashColor );
+ }
+ mnValue = nColor;
+ }
}
}