oox/source/drawingml/chart/objectformatter.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
New commits: commit f810f05e2b50068f6d14be152eb4c2ffbc1c4e5e Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Tue Aug 9 18:11:02 2022 +0200 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Thu Aug 11 08:29:29 2022 +0200 Related: tdf#150176 pptx chart import: fix automatic border style With this patch it will work not just for pptx, but other ooxml presentation file formats. Follow up of commit: 071a36e042c76286fedb38f479dac79f29b661f9 (tdf#150176 pptx chart import: fix automatic border style) Change-Id: I05e03d2723e9978156dfd8025e3a4b5bcecddbc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138059 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index 5644b9eedf09..e552dea82fb9 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -39,6 +39,8 @@ #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> +#include <unotools/mediadescriptor.hxx> + namespace oox::drawingml::chart { using namespace ::com::sun::star::chart2; @@ -829,13 +831,18 @@ LineFormatter::LineFormatter( ObjectFormatterData& rData, const AutoFormatEntry* if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() ) if( const LineProperties* pLineProps = pTheme->getLineStyle( pAutoFormatEntry->mnThemedIdx ) ) *mxAutoLine = *pLineProps; - // set automatic border property for chartarea, because of tdf#81437 and tdf#82217, except for pptx (tdf#150176) - if ( eObjType == OBJECTTYPE_CHARTSPACE && !rData.mrFilter.getFileUrl().endsWithIgnoreAsciiCase(".pptx") ) + // set automatic border property for chartarea, because of tdf#81437 and tdf#82217, except for Impress (tdf#150176) + if ( eObjType == OBJECTTYPE_CHARTSPACE ) { - mxAutoLine->maLineFill.moFillType = oox::GraphicHelper::getDefaultChartAreaLineStyle(); - mxAutoLine->moLineWidth = oox::GraphicHelper::getDefaultChartAreaLineWidth(); - // this value is what MSO 2016 use as a default color for chartspace border - mxAutoLine->maLineFill.maFillColor.setSrgbClr( 0xD9D9D9 ); + OUString aFilterName; + rData.mrFilter.getMediaDescriptor()[utl::MediaDescriptor::PROP_FILTERNAME] >>= aFilterName; + if (!aFilterName.startsWithIgnoreAsciiCase("Impress")) + { + mxAutoLine->maLineFill.moFillType = oox::GraphicHelper::getDefaultChartAreaLineStyle(); + mxAutoLine->moLineWidth = oox::GraphicHelper::getDefaultChartAreaLineWidth(); + // this value is what MSO 2016 use as a default color for chartspace border + mxAutoLine->maLineFill.maFillColor.setSrgbClr(0xD9D9D9); + } } // change line width according to chart auto style if( mxAutoLine->moLineWidth.has_value() )