summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-01-21 14:20:38 +0100
committerXisco Faulí <xiscofauli@libreoffice.org>2020-02-26 11:59:27 +0100
commit14a4992311a7cffdf66f8c4656b0c9cb5ebd4e14 (patch)
treeb21945d084f91c4887fe45355fa0a51a701d0865 /oox
parenta563d4279e383de3f84379b6393188bcbcb64a95 (diff)
tdf#130105 Chart OOXML Import: Fix data label position
The position of datapoint labels was overwritten with the position of series placement. Do not overwrite datapoint labels placement, if we have explicit datapoint label placement. Regression from commit: 70944a849dc59fa686e3f316a3983dbc8a47017f (tdf#109858: Override default point label placement setting...) Change-Id: Ic27c8a7eb93e8c3776389d1b3d285d120568f024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87137 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit a4cdd4d1266e77330d4745f369db85ee7dba265c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87594 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/chart/seriesconverter.hxx2
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx21
2 files changed, 11 insertions, 12 deletions
diff --git a/oox/inc/drawingml/chart/seriesconverter.hxx b/oox/inc/drawingml/chart/seriesconverter.hxx
index e381cdbc2148..6ee20c59f147 100644
--- a/oox/inc/drawingml/chart/seriesconverter.hxx
+++ b/oox/inc/drawingml/chart/seriesconverter.hxx
@@ -47,7 +47,7 @@ public:
/** Converts OOXML data label settings for the passed data point. */
void convertFromModel(
const css::uno::Reference< css::chart2::XDataSeries >& rxDataSeries,
- const TypeGroupConverter& rTypeGroup, const PropertySet& rSeriesPropSet );
+ const TypeGroupConverter& rTypeGroup );
};
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 10edab47fd11..1a3936ecb2c9 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -134,7 +134,7 @@ void convertTextProperty(PropertySet& rPropSet, ObjectFormatter& rFormatter,
void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatter,
const DataLabelModelBase& rDataLabel, const TypeGroupConverter& rTypeGroup,
- bool bDataSeriesLabel, bool bMSO2007Doc, const PropertySet* pSeriesPropSet )
+ bool bDataSeriesLabel, bool bMSO2007Doc )
{
const TypeGroupInfo& rTypeInfo = rTypeGroup.getTypeInfo();
@@ -193,7 +193,7 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt
if( bDataSeriesLabel || rDataLabel.monLabelPos.has() )
{
namespace csscd = ::com::sun::star::chart::DataLabelPlacement;
- sal_Int32 nPlacement = rTypeInfo.mnDefLabelPos;
+ sal_Int32 nPlacement = -1;
switch( rDataLabel.monLabelPos.get( XML_TOKEN_INVALID ) )
{
case XML_outEnd: nPlacement = csscd::OUTSIDE; break;
@@ -207,10 +207,10 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt
case XML_bestFit: nPlacement = csscd::AVOID_OVERLAP; break;
}
- sal_Int32 nGlobalPlacement = 0;
- if ( !bDataSeriesLabel && nPlacement == rTypeInfo.mnDefLabelPos && pSeriesPropSet &&
- pSeriesPropSet->getProperty( nGlobalPlacement, PROP_LabelPlacement ) )
- nPlacement = nGlobalPlacement;
+ if( !bDataSeriesLabel && nPlacement == -1 )
+ return;
+ else if( nPlacement == -1 )
+ nPlacement = rTypeInfo.mnDefLabelPos;
rPropSet.setProperty( PROP_LabelPlacement, nPlacement );
}
@@ -262,8 +262,7 @@ DataLabelConverter::~DataLabelConverter()
{
}
-void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries, const TypeGroupConverter& rTypeGroup,
- const PropertySet& rSeriesPropSet )
+void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries, const TypeGroupConverter& rTypeGroup )
{
if (!rxDataSeries.is())
return;
@@ -272,7 +271,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
{
bool bMSO2007Doc = getFilter().isMSO2007Document();
PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) );
- lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, false, bMSO2007Doc, &rSeriesPropSet );
+ lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, false, bMSO2007Doc );
const TypeGroupInfo& rTypeInfo = rTypeGroup.getTypeInfo();
bool bIsPie = rTypeInfo.meTypeCategory == TYPECATEGORY_PIE;
if( mrModel.mxLayout && !mrModel.mxLayout->mbAutoLayout && !bIsPie )
@@ -372,7 +371,7 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
if( !mrModel.mbDeleted )
{
bool bMSO2007Doc = getFilter().isMSO2007Document();
- lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, true, bMSO2007Doc, nullptr );
+ lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, true, bMSO2007Doc );
if (mrModel.mxShapeProp)
// Import baseline border properties for these data labels.
@@ -386,7 +385,7 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
pointLabel->maNumberFormat = mrModel.maNumberFormat;
DataLabelConverter aLabelConv(*this, *pointLabel);
- aLabelConv.convertFromModel( rxDataSeries, rTypeGroup, aPropSet );
+ aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );
}
}