summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorAdam Kovacs <christo161@gmail.com>2018-08-16 09:32:17 -0400
committerAndras Timar <andras.timar@collabora.com>2018-09-12 09:43:30 +0200
commit39cc0cdaf7fb6c290a2c787b2e41437d4723ca8c (patch)
treeb0b03e9a0dcdf81f5a8ba4ba7f3371e78c723d07 /oox
parent515d3f22716b42b5afafc66a0ea3aa4e783e7833 (diff)
tdf108064 OOXML export: keep preset dashes in shape outlines
Extending commit d7551e32609d0e0de8ac419576ca42d65c5015be to all default MSO 2016 preset dashes: Saving an ooxml file with LibreOffice now preserves the prstDash tags with the values sysDot, sysDash, dash, dashDot, lgDash, lgDashDot, lgDashDotDot, instead of converting them to custDash tags. Note: the import of the preset dash outlines are still not relative to the line width, in spite of their original behaviour in MSO. Change-Id: I65eaf06952a968019495664067010c874fce1352 Reviewed-on: https://gerrit.libreoffice.org/59203 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit f5f235051055d24c8aced602078c54261603efea)
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx34
1 files changed, 27 insertions, 7 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 9663d4db1905..8c800eec1fdb 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -696,14 +696,34 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet )
if( bDashSet && aStyleLineStyle != drawing::LineStyle_DASH )
{
- // line style is a dash and it was not set by the shape style
-
- if (aLineDash.Dashes == 1 && aLineDash.DashLen == 564 && aLineDash.Distance == 423)
+ // keep default preset linestyles (instead of custdash)
+ if (aLineDash.Dots == 1 && aLineDash.DotLen == 141 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 141)
{
- // That's exactly the predefined "dash" value.
- mpFS->singleElementNS(XML_a, XML_prstDash,
- XML_val, "dash",
- FSEND);
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot", FSEND);
+ }
+ else if (aLineDash.Dots == 0 && aLineDash.DotLen == 0 && aLineDash.Dashes == 1 && aLineDash.DashLen == 423 && aLineDash.Distance == 141)
+ {
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash", FSEND);
+ }
+ else if (aLineDash.Dots == 0 && aLineDash.DotLen == 0 && aLineDash.Dashes == 1 && aLineDash.DashLen == 564 && aLineDash.Distance == 423)
+ {
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND);
+ }
+ else if (aLineDash.Dots == 1 && aLineDash.DotLen == 141 && aLineDash.Dashes == 1 && aLineDash.DashLen == 564 && aLineDash.Distance == 423)
+ {
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dashDot", FSEND);
+ }
+ else if (aLineDash.Dots == 0 && aLineDash.DotLen == 0 && aLineDash.Dashes == 1 && aLineDash.DashLen == 1128 && aLineDash.Distance == 423)
+ {
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDash", FSEND);
+ }
+ else if (aLineDash.Dots == 1 && aLineDash.DotLen == 141 && aLineDash.Dashes == 1 && aLineDash.DashLen == 1128 && aLineDash.Distance == 423)
+ {
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDot", FSEND);
+ }
+ else if (aLineDash.Dots == 2 && aLineDash.DotLen == 141 && aLineDash.Dashes == 1 && aLineDash.DashLen == 1128 && aLineDash.Distance == 423)
+ {
+ mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDotDot", FSEND);
}
else
{