From ffee771f8dae50aea716ffc0def4ef5fe5c104d2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 1 Mar 2018 16:14:23 +0200 Subject: 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 Reviewed-by: Noel Grandin --- include/sax/tools/converter.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/sax') 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 #include #include +#include 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, -- cgit