summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-01 16:14:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-06 06:51:00 +0100
commitffee771f8dae50aea716ffc0def4ef5fe5c104d2 (patch)
treea44446911fd212a81600079c334db12c872a071a /include
parent4eb78dc722e33f03b4ee57d43cbc64fe94e6e9cf (diff)
add some color conversion methods to sax::Converter
to make the call-sites less verbose Change-Id: Ifddcbb03a454a241bef93f31a8025801b84a66fc Reviewed-on: https://gerrit.libreoffice.org/50578 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/sax/tools/converter.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx
index 2dfc33461919..c7fe12f4c100 100644
--- a/include/sax/tools/converter.hxx
+++ b/include/sax/tools/converter.hxx
@@ -29,6 +29,7 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/util/MeasureUnit.hpp>
+#include <tools/color.hxx>
namespace com { namespace sun { namespace star {
@@ -97,10 +98,21 @@ public:
/** convert string to rgb color */
static bool convertColor( sal_Int32& rColor,
const OUString&rValue );
+ static bool convertColor( ::Color& rColor,
+ const OUString&rValue )
+ {
+ sal_Int32 n(rColor);
+ bool b = convertColor( n, rValue );
+ if (b) rColor = n;
+ return b;
+ }
/** convert color to string */
static void convertColor( OUStringBuffer &rBuffer,
sal_Int32 nColor );
+ static void convertColor( OUStringBuffer &rBuffer,
+ ::Color nColor )
+ { convertColor( rBuffer, sal_Int32(nColor) ); }
/** convert string to number with optional min and max values */
static bool convertNumber( sal_Int32& rValue,