summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-06 10:34:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-06 11:50:16 +0100
commitf02b1ba18deeab9744c5fe25162f5853d69b438e (patch)
treed770d9dd6fb7a52e125ce221987bfba12c70ce15 /xmloff/source/style
parentd15ff312ad80e4d1f210636e3374a81c14c229a2 (diff)
use more Color in xmloff
Change-Id: Iec12d2e9f3e254dc6525dc285259321b13f75c4a Reviewed-on: https://gerrit.libreoffice.org/50794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/TransGradientStyle.cxx8
-rw-r--r--xmloff/source/style/shadwhdl.cxx7
-rw-r--r--xmloff/source/style/xmlnumfi.cxx2
-rw-r--r--xmloff/source/style/xmlnumi.cxx9
4 files changed, 12 insertions, 14 deletions
diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx
index c5e424fb5ed7..622e2af57366 100644
--- a/xmloff/source/style/TransGradientStyle.cxx
+++ b/xmloff/source/style/TransGradientStyle.cxx
@@ -151,7 +151,7 @@ void XMLTransGradientStyleImport::importXML(
( (100 - aStartTransparency) * 255 ) / 100 );
Color aColor( n, n, n );
- aGradient.StartColor = static_cast<sal_Int32>( aColor.GetColor() );
+ aGradient.StartColor = static_cast<sal_Int32>( aColor );
}
break;
case XML_TOK_GRADIENT_END:
@@ -163,7 +163,7 @@ void XMLTransGradientStyleImport::importXML(
( (100 - aEndTransparency) * 255 ) / 100 );
Color aColor( n, n, n );
- aGradient.EndColor = static_cast<sal_Int32>( aColor.GetColor() );
+ aGradient.EndColor = static_cast<sal_Int32>( aColor );
}
break;
case XML_TOK_GRADIENT_ANGLE:
@@ -248,14 +248,14 @@ void XMLTransGradientStyleExport::exportXML(
Color aColor;
// Transparency start
- aColor = aGradient.StartColor;
+ aColor = Color(aGradient.StartColor);
sal_Int32 aStartValue = 100 - static_cast<sal_Int32>(((aColor.GetRed() + 1) * 100) / 255);
::sax::Converter::convertPercent( aOut, aStartValue );
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START, aStrValue );
// Transparency end
- aColor = aGradient.EndColor;
+ aColor = Color(aGradient.EndColor);
sal_Int32 aEndValue = 100 - static_cast<sal_Int32>(((aColor.GetRed() + 1) * 100) / 255);
::sax::Converter::convertPercent( aOut, aEndValue );
aStrValue = aOut.makeStringAndClear();
diff --git a/xmloff/source/style/shadwhdl.cxx b/xmloff/source/style/shadwhdl.cxx
index bccfab9e017d..b3c2739aa1db 100644
--- a/xmloff/source/style/shadwhdl.cxx
+++ b/xmloff/source/style/shadwhdl.cxx
@@ -63,12 +63,9 @@ bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue
}
else if( !bColorFound && aToken.startsWith("#") )
{
- sal_Int32 nColor(0);
- bRet = ::sax::Converter::convertColor( nColor, aToken );
+ bRet = ::sax::Converter::convertColor( aColor, aToken );
if( !bRet )
return false;
-
- aColor = nColor;
bColorFound = true;
}
else if( !bOffsetFound )
@@ -112,7 +109,7 @@ bool XMLShadowPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue
if( bRet && ( bColorFound || bOffsetFound ) )
{
aShadow.IsTransparent = aColor.GetTransparency() > 0;
- aShadow.Color = aColor.GetColor();
+ aShadow.Color = sal_Int32(aColor);
bRet = true;
}
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 2e2905d6ffd0..037d38c2d15a 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -190,7 +190,7 @@ public:
class SvXMLNumFmtPropContext : public SvXMLImportContext
{
SvXMLNumFormatContext& rParent;
- sal_Int32 m_nColor;
+ Color m_nColor;
bool bColSet;
public:
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 7c0a4665b611..42ccda81d3ea 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -37,6 +37,7 @@
#include <osl/diagnose.h>
#include <tools/fontenum.hxx>
+#include <tools/color.hxx>
#include <sax/tools/converter.hxx>
@@ -174,7 +175,7 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext
sal_Unicode cBullet;
sal_Int16 nRelSize;
- sal_Int32 m_nColor;
+ Color m_nColor;
sal_Int16 ePosAndSpaceMode;
sal_Int16 eLabelFollowedBy;
@@ -188,7 +189,7 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext
bool bHasColor : 1;
void SetRelSize( sal_Int16 nRel ) { nRelSize = nRel; }
- void SetColor( sal_Int32 nColor )
+ void SetColor( Color nColor )
{ m_nColor = nColor; bHasColor = true; }
void SetSpaceBefore( sal_Int32 nSet ) { nSpaceBefore = nSet; }
void SetMinLabelWidth( sal_Int32 nSet ) { nMinLabelWidth = nSet; }
@@ -738,14 +739,14 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
sal_Int32 nColor(0);
if (::sax::Converter::convertColor( nColor, rValue ))
{
- rListLevel.SetColor( nColor );
+ rListLevel.SetColor( Color(nColor) );
}
}
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR:
{
if( IsXMLToken( rValue, XML_TRUE ) )
- rListLevel.SetColor( sal_Int32(0xffffffff) );
+ rListLevel.SetColor( Color(0xffffffff) );
}
break;
case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE: