diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2020-07-27 21:55:05 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2020-08-06 13:10:14 +0200 |
commit | 74be8bb787a44464957e5d3105c8de6d36e81b4a (patch) | |
tree | 390e2feb729f68226f2f55f62942837118b122ed /oox | |
parent | a814825461b1fc26288655535b64fc38b18ecf15 (diff) |
tdf#135184 add linecaps in charts
Chart is currently not able to interpret property linecap. But in
case of linecap 'round' or 'square', line dashes lengths are adapted
so that they look same as in MS Office (tdf#134053). This does not
work, if the corresponding linecap property is not interpreted.
Dashed border of data labels is not fixed because of bug
tdf#135366.
In addition I have fixed errors in prstDash detection, which I
have noticed while creating unit tests.
The unit tests cover file text, not visual appearence.
Change-Id: I8cf2d2b2fc0923c2882f8148b4550bc363270480
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99562
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/objectformatter.cxx | 6 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 23 |
2 files changed, 15 insertions, 14 deletions
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index c0669678eee0..326f632e84b3 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -446,7 +446,7 @@ const AutoTextEntry* lclGetAutoTextEntry( const AutoTextEntry* pEntries, sal_Int const ShapePropertyIds spnCommonPropIds = { PROP_LineStyle, PROP_LineWidth, PROP_LineColor, PROP_LineTransparence, PROP_LineDashName, - PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_LineCap, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_FillStyle, PROP_FillColor, PROP_FillTransparence, PROP_INVALID, PROP_FillGradientName, PROP_FillBitmapName, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY, PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, @@ -456,7 +456,7 @@ const ShapePropertyIds spnCommonPropIds = const ShapePropertyIds spnLinearPropIds = { PROP_LineStyle, PROP_LineWidth, PROP_Color, PROP_Transparency, PROP_LineDashName, - PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_LineCap, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, @@ -470,7 +470,7 @@ const ShapePropertyIds spnFilledPropIds = PROP_BorderColor, PROP_BorderTransparency, PROP_BorderDashName, - PROP_INVALID, + PROP_LineCap, PROP_INVALID, PROP_INVALID, PROP_INVALID, diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 155c33796f70..a0d24576d371 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -959,7 +959,8 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc { nDistance -= 99; nDotLen += 99; - nDashLen += 99; + if (nDashLen > 0) + nDashLen += 99; } // LO uses length 0 for 100%, if the attribute is missing in ODF. // Other applications might write 100%. Make is unique for the conditions. @@ -968,43 +969,43 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc if (nDashLen == 0 && aLineDash.Dashes > 0) nDashLen = 100; bIsConverted = true; - if (nDotLen == 100 && aLineDash.Dashes == 0 && nDashLen == 0 && aLineDash.Distance == 300) + if (nDotLen == 100 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 300) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot"); } - else if (nDotLen == 400 && aLineDash.Dashes == 0 && nDashLen == 0 && aLineDash.Distance == 300) + else if (nDotLen == 400 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 300) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash"); } - else if (nDotLen == 400 && aLineDash.Dashes == 1 && nDashLen == 100 && aLineDash.Distance == 300) + else if (nDotLen == 400 && aLineDash.Dashes == 1 && nDashLen == 100 && nDistance == 300) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dashDot"); } - else if (nDotLen == 800 && aLineDash.Dashes == 0 && nDashLen == 0 && aLineDash.Distance == 300) + else if (nDotLen == 800 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 300) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDash"); } - else if (nDotLen == 800 && aLineDash.Dashes == 1 && nDashLen == 100 && aLineDash.Distance == 300) + else if (nDotLen == 800 && aLineDash.Dashes == 1 && nDashLen == 100 && nDistance == 300) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDot"); } - else if (nDotLen == 800 && aLineDash.Dashes == 2 && nDashLen == 100 && aLineDash.Distance == 300) + else if (nDotLen == 800 && aLineDash.Dashes == 2 && nDashLen == 100 && nDistance == 300) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDotDot"); } - else if (nDotLen == 100 && aLineDash.Dashes == 0 && nDashLen == 0 && aLineDash.Distance == 100) + else if (nDotLen == 100 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 100) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot"); } - else if (nDotLen == 300 && aLineDash.Dashes == 0 && nDashLen == 0 && aLineDash.Distance == 100) + else if (nDotLen == 300 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 100) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash"); } - else if (nDotLen == 300 && aLineDash.Dashes == 1 && nDashLen == 100 && aLineDash.Distance == 100) + else if (nDotLen == 300 && aLineDash.Dashes == 1 && nDashLen == 100 && nDistance == 100) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDot"); } - else if (nDotLen == 300 && aLineDash.Dashes == 2 && nDashLen == 100 && aLineDash.Distance == 100) + else if (nDotLen == 300 && aLineDash.Dashes == 2 && nDashLen == 100 && nDistance == 100) { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot"); } |