summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2022-08-09 18:11:02 +0200
committerBalazs Varga <balazs.varga.extern@allotropia.de>2022-08-11 08:29:29 +0200
commitf810f05e2b50068f6d14be152eb4c2ffbc1c4e5e (patch)
tree02fe032c3b454b6dbd9c1ad27e6b382de1872178 /oox/source
parenta51509ee69b730e8987c149ac19e0bedccded127 (diff)
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.extern@allotropia.de>
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx19
1 files changed, 13 insertions, 6 deletions
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() )