summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/filter/xml/xmlcondformat.cxx14
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx12
2 files changed, 10 insertions, 16 deletions
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index be215df81d72..3db4904f99ca 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -457,15 +457,13 @@ ScXMLDataBarFormatContext::ScXMLDataBarFormatContext( ScXMLImport& rImport,
if(!sPositiveColor.isEmpty())
{
- sal_Int32 nColor = 0;
- sax::Converter::convertColor( nColor, sPositiveColor );
- mpFormatData->maPositiveColor = Color(nColor);
+ sax::Converter::convertColor( mpFormatData->maPositiveColor, sPositiveColor );
}
if(!sNegativeColor.isEmpty())
{
// we might check here for 0xff0000 and don't write it
- sal_Int32 nColor = 0;
+ Color nColor;
sax::Converter::convertColor( nColor, sNegativeColor );
mpFormatData->mpNegativeColor.reset(new Color(nColor));
}
@@ -482,9 +480,7 @@ ScXMLDataBarFormatContext::ScXMLDataBarFormatContext( ScXMLImport& rImport,
if(!sAxisColor.isEmpty())
{
- sal_Int32 nColor = 0;
- sax::Converter::convertColor( nColor, sAxisColor );
- mpFormatData->maAxisColor = Color(nColor);
+ sax::Converter::convertColor( mpFormatData->maAxisColor, sAxisColor );
}
if(!sShowValue.isEmpty())
@@ -889,9 +885,7 @@ ScXMLColorScaleFormatEntryContext::ScXMLColorScaleFormatEntryContext( ScXMLImpor
}
}
- sal_Int32 nColor;
- sax::Converter::convertColor(nColor, sColor);
- aColor = Color(nColor);
+ sax::Converter::convertColor(aColor, sColor);
if(!sVal.isEmpty())
sax::Converter::convertDouble(nVal, sVal);
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index d41bc3ba2b5a..baf55bb3213e 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3971,7 +3971,7 @@ void ScXMLExport::WriteScenario()
if (!(nFlags & ScScenarioFlags::ShowFrame))
AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_BORDER, XML_FALSE);
OUStringBuffer aBuffer;
- ::sax::Converter::convertColor(aBuffer, aColor.GetColor());
+ ::sax::Converter::convertColor(aBuffer, aColor);
AddAttribute(XML_NAMESPACE_TABLE, XML_BORDER_COLOR, aBuffer.makeStringAndClear());
if (!(nFlags & ScScenarioFlags::TwoWay))
AddAttribute(XML_NAMESPACE_TABLE, XML_COPY_BACK, XML_FALSE);
@@ -4426,7 +4426,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*it[0]));
OUStringBuffer aBuffer;
- ::sax::Converter::convertColor(aBuffer, it[0]->GetColor().GetColor());
+ ::sax::Converter::convertColor(aBuffer, it[0]->GetColor());
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_COLOR, aBuffer.makeStringAndClear());
SvXMLElementExport aElementColorScaleEntry(*this, XML_NAMESPACE_CALC_EXT, XML_COLOR_SCALE_ENTRY, true, true);
}
@@ -4450,13 +4450,13 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
if(pFormatData->mpNegativeColor)
{
OUStringBuffer aBuffer;
- ::sax::Converter::convertColor(aBuffer, pFormatData->mpNegativeColor->GetColor());
+ ::sax::Converter::convertColor(aBuffer, *pFormatData->mpNegativeColor);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_NEGATIVE_COLOR, aBuffer.makeStringAndClear());
}
else
{
OUStringBuffer aBuffer;
- ::sax::Converter::convertColor(aBuffer, sal_Int32(COL_LIGHTRED));
+ ::sax::Converter::convertColor(aBuffer, COL_LIGHTRED);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_NEGATIVE_COLOR, aBuffer.makeStringAndClear());
}
}
@@ -4474,11 +4474,11 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
}
OUStringBuffer aBuffer;
- ::sax::Converter::convertColor(aBuffer, pFormatData->maPositiveColor.GetColor());
+ ::sax::Converter::convertColor(aBuffer, pFormatData->maPositiveColor);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_POSITIVE_COLOR, aBuffer.makeStringAndClear());
aBuffer.truncate();
- ::sax::Converter::convertColor(aBuffer, pFormatData->maAxisColor.GetColor());
+ ::sax::Converter::convertColor(aBuffer, pFormatData->maAxisColor);
AddAttribute(XML_NAMESPACE_CALC_EXT, XML_AXIS_COLOR, aBuffer.makeStringAndClear());
SvXMLElementExport aElementDataBar(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR, true, true);