summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-21 11:09:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-21 14:36:43 +0200
commit6471ea40f7739814264ce8540cdedef28a3cb731 (patch)
tree76ace883a9aff15c107bb35c1c415596a74da627 /oox/source/drawingml
parentb99d5bd8318d7f3fefec4fb3cde609fbfbf88354 (diff)
remove oox::OptValue::differsFrom
as a step towards converting it to std::optional Change-Id: I198abb4ae85b1d82f465577ebd0eec37b78c1111 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136213 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx5
-rw-r--r--oox/source/drawingml/lineproperties.cxx16
-rw-r--r--oox/source/drawingml/table/tablecell.cxx2
3 files changed, 13 insertions, 10 deletions
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index c022c35bf536..703d995b18bf 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -722,12 +722,13 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat
PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) );
// data point marker
- if( mrModel.monMarkerSymbol.differsFrom( rSeries.mnMarkerSymbol ) || mrModel.monMarkerSize.differsFrom( rSeries.mnMarkerSize ) )
+ if( ( mrModel.monMarkerSymbol.has_value() && mrModel.monMarkerSymbol.get() != rSeries.mnMarkerSymbol ) ||
+ ( mrModel.monMarkerSize.has_value() && mrModel.monMarkerSize.get() != rSeries.mnMarkerSize ) )
rTypeGroup.convertMarker( aPropSet, mrModel.monMarkerSymbol.get( rSeries.mnMarkerSymbol ),
mrModel.monMarkerSize.get( rSeries.mnMarkerSize ), mrModel.mxMarkerProp );
// data point pie explosion
- if( mrModel.monExplosion.differsFrom( rSeries.mnExplosion ) )
+ if( mrModel.monExplosion.has_value() && mrModel.monExplosion.get() != rSeries.mnExplosion )
rTypeGroup.convertPieExplosion( aPropSet, mrModel.monExplosion.get() );
// point formatting
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx
index 8f1a0c905b92..4cd83045840a 100644
--- a/oox/source/drawingml/lineproperties.cxx
+++ b/oox/source/drawingml/lineproperties.cxx
@@ -449,12 +449,13 @@ void LineProperties::pushToPropMap( ShapePropertyMap& rPropMap,
rPropMap.setProperty( ShapeProperty::LineCap, eLineCap );
// create line dash from preset dash token or dash stop vector (not for invisible line)
- if( (eLineStyle != drawing::LineStyle_NONE) && (moPresetDash.differsFrom( XML_solid ) || !maCustomDash.empty()) )
+ if( (eLineStyle != drawing::LineStyle_NONE) &&
+ ((moPresetDash.has_value() && moPresetDash.get() != XML_solid) || !maCustomDash.empty()) )
{
LineDash aLineDash;
aLineDash.Style = lclGetDashStyle( moLineCap.get( XML_flat ) );
- if(moPresetDash.differsFrom(XML_solid))
+ if(moPresetDash.has_value() && moPresetDash.get() != XML_solid)
lclConvertPresetDash(aLineDash, moPresetDash.get(XML_dash));
else // !maCustomDash.empty()
{
@@ -505,11 +506,12 @@ void LineProperties::pushToPropMap( ShapePropertyMap& rPropMap,
drawing::LineStyle LineProperties::getLineStyle() const
{
// rules to calculate the line style inferred from the code in LineProperties::pushToPropMap
- return (maLineFill.moFillType.get() == XML_noFill) ?
- drawing::LineStyle_NONE :
- (moPresetDash.differsFrom( XML_solid ) || (!moPresetDash && !maCustomDash.empty())) ?
- drawing::LineStyle_DASH :
- drawing::LineStyle_SOLID;
+ if (maLineFill.moFillType.get() == XML_noFill)
+ return drawing::LineStyle_NONE;
+ if ((moPresetDash.has_value() && moPresetDash.get() != XML_solid) ||
+ (!moPresetDash && !maCustomDash.empty()))
+ return drawing::LineStyle_DASH;
+ return drawing::LineStyle_SOLID;
}
drawing::LineCap LineProperties::getLineCap() const
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 32ac36b92ddc..1dae5369b271 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -64,7 +64,7 @@ static void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase,
sal_Int32 nPropId )
{
BorderLine2 aBorderLine;
- if ( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill ))
+ if ( rLineProperties.maLineFill.moFillType.has_value() && rLineProperties.maLineFill.moFillType.get() != XML_noFill )
{
Color aColor = rLineProperties.maLineFill.getBestSolidColor();
aBorderLine.Color = sal_Int32(aColor.getColor( rFilterBase.getGraphicHelper() ));