diff options
author | Adam Kovacs <christo161@gmail.com> | 2018-09-13 04:04:41 -0400 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-09-14 08:06:39 +0200 |
commit | 761308edb65a6cf44ef84cebc387e77af8b70f83 (patch) | |
tree | 1d9cbf1d5353cdd1f239e183fe6d3d6d58aa0403 /oox | |
parent | 4464f851a34fb000673e54a3f7d6395682d53003 (diff) |
tdf#108064 OOXML export: fixing linestyle export in charts
getLineDash function copy paste from ChartLinePanel.cxx.
We query the actual linedash value associated to the LineDashName
of the chart line via DashTable service.
Thanks for the guidance of László Németh!
Change-Id: I565fc968ce009803f9872da1f01dd56cfe07ddb3
Reviewed-on: https://gerrit.libreoffice.org/60424
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 32 |
2 files changed, 32 insertions, 2 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 97adab7f5b00..584774d9bbbc 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2323,7 +2323,7 @@ void ChartExport::exportShapeProps( const Reference< XPropertySet >& xPropSet ) FSEND ); exportFill( xPropSet ); - WriteOutline( xPropSet ); + WriteOutline( xPropSet, getModel() ); pFS->endElement( FSNS( XML_c, XML_spPr ) ); } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 8e554ad671bd..ee6a43b58df5 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -134,6 +134,25 @@ namespace drawingml { #define CGETAD(propName) \ (( bCheckDirect && GetPropertyAndState( rXPropSet, rXPropState, #propName, eState ) && eState == beans::PropertyState_DIRECT_VALUE )||GetProperty( rXPropSet, #propName )) +css::uno::Any getLineDash( const css::uno::Reference<css::frame::XModel>& xModel, const OUString& rDashName ) + { + css::uno::Reference<css::lang::XMultiServiceFactory> xFact(xModel, css::uno::UNO_QUERY); + css::uno::Reference<css::container::XNameAccess> xNameAccess( + xFact->createInstance("com.sun.star.drawing.DashTable"), + css::uno::UNO_QUERY ); + if(xNameAccess.is()) + { + if (!xNameAccess->hasByName(rDashName)) + return css::uno::Any(); + + return xNameAccess->getByName(rDashName); + } + + return css::uno::Any(); + } + + + // not thread safe int DrawingML::mnImageCounter = 1; int DrawingML::mnWdpImageCounter = 1; @@ -571,7 +590,7 @@ void DrawingML::WriteLineArrow( const Reference< XPropertySet >& rXPropSet, bool } } -void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet ) +void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Reference< frame::XModel > const & xModel ) { drawing::LineStyle aLineStyle( drawing::LineStyle_NONE ); @@ -642,6 +661,17 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet ) if (GetProperty(rXPropSet, "LineDash")) { aLineDash = mAny.get<drawing::LineDash>(); + if (aLineDash.Dots == 0 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 0) { + OUString aLineDashName; + GET(aLineDashName, LineDashName); + if (!aLineDashName.isEmpty()) { + if (xModel) { + css::uno::Any aAny; + aAny = getLineDash(xModel, aLineDashName); + aLineDash = aAny.get<drawing::LineDash>(); + } + } + } bDashSet = true; if (aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE) { |