summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-07-25 13:16:28 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-07-27 19:10:39 +0200
commitcb46bc6ba066c1c98d4e357f8469c5eecc171241 (patch)
tree4e8d459c1df506e35a2a592db1a3745622ace6d6 /sc
parent1d9a30bac4ba69ddee34f40427ba24a4d83a1f72 (diff)
tdf#90510 : Override default point label placement setting...
with global label placement setting if available while importing xls chart. Added unit test in chart2import.cxx that asserts one of the point label setting in the bugzilla xls document. Change-Id: Id331f56c05873554b22920e02805909c50fb8619 Reviewed-on: https://gerrit.libreoffice.org/40402 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 2a4d015ff896dc9e8d2219982da54c51a42482b8) Reviewed-on: https://gerrit.libreoffice.org/40495
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xichart.cxx13
-rw-r--r--sc/source/filter/inc/xichart.hxx4
2 files changed, 11 insertions, 6 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 49c35f7ee6a6..5a9a6ff47943 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1071,7 +1071,7 @@ void XclImpChText::ConvertNumFmt( ScfPropertySet& rPropSet, bool bPercent ) cons
mxSrcLink->ConvertNumFmt( rPropSet, bPercent );
}
-void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeInfo& rTypeInfo ) const
+void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeInfo& rTypeInfo, const ScfPropertySet* pGlobalPropSet ) const
{
// existing CHFRLABELPROPS record wins over flags from CHTEXT
sal_uInt16 nShowFlags = mxLabelProps ? mxLabelProps->mnFlags : maData.mnFlags;
@@ -1124,6 +1124,11 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeIn
case EXC_CHTEXT_POS_RIGHT: nPlacement = RIGHT; break;
case EXC_CHTEXT_POS_AUTO: nPlacement = AVOID_OVERLAP; break;
}
+ sal_Int32 nGlobalPlacement = 0;
+ if ( ( nPlacement == rTypeInfo.mnDefaultLabelPos ) && pGlobalPropSet &&
+ pGlobalPropSet->GetProperty( nGlobalPlacement, EXC_CHPROP_LABELPLACEMENT ) )
+ nPlacement = nGlobalPlacement;
+
rPropSet.SetProperty( EXC_CHPROP_LABELPLACEMENT, nPlacement );
// label number format (percentage format wins over value format)
if( bShowPercent || bShowValue )
@@ -1506,7 +1511,7 @@ void XclImpChDataFormat::UpdateTrendLineFormat()
UpdateDataLabel( nullptr );
}
-void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo ) const
+void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo, const ScfPropertySet* pGlobalPropSet ) const
{
/* Line and area format.
#i71810# If the data points are filled with bitmaps, textures, or
@@ -1529,7 +1534,7 @@ void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeIn
if( mx3dDataFmt )
mx3dDataFmt->Convert( rPropSet );
if( mxLabel )
- mxLabel->ConvertDataLabel( rPropSet, rTypeInfo );
+ mxLabel->ConvertDataLabel( rPropSet, rTypeInfo, pGlobalPropSet );
// 3D settings
rPropSet.SetProperty< sal_Int16 >( EXC_CHPROP_PERCENTDIAGONAL, 0 );
@@ -2067,7 +2072,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
for( XclImpChDataFormatMap::const_iterator aIt = maPointFmts.begin(), aEnd = maPointFmts.end(); aIt != aEnd; ++aIt )
{
ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, aIt->first );
- aIt->second->Convert( aPointProp, rTypeInfo );
+ aIt->second->Convert( aPointProp, rTypeInfo, &aSeriesProp );
}
}
return xDataSeries;
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index d4be01621e23..7389226e6298 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -507,7 +507,7 @@ public:
/** Converts and writes the contained number format to the passed property set. */
void ConvertNumFmt( ScfPropertySet& rPropSet, bool bPercent ) const;
/** Converts and writes all contained data to the passed data point label property set. */
- void ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeInfo& rTypeInfo ) const;
+ void ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeInfo& rTypeInfo, const ScfPropertySet* pGlobalPropSet = nullptr ) const;
/** Creates a title text object. */
css::uno::Reference< css::chart2::XTitle >
CreateTitle() const;
@@ -665,7 +665,7 @@ public:
const XclImpChText* GetDataLabel() const { return mxLabel.get(); }
/** Converts and writes the contained data to the passed property set. */
- void Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo ) const;
+ void Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo, const ScfPropertySet* pGlobalPropSet = nullptr ) const;
/** Writes the line format only, e.g. for trend lines or error bars. */
void ConvertLine( ScfPropertySet& rPropSet, XclChObjectType eObjType ) const;
/** Writes the area format only for the series or a data point. */