diff options
author | Adam Kovacs <christo161@gmail.com> | 2018-10-05 08:24:08 -0400 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-10-08 16:34:31 +0200 |
commit | 47c3b0390e5ad5a894488c47f014cdd7ecba7d2e (patch) | |
tree | 92c2fd8018347ad9ed657f7b32868ad0c4f12d64 /oox | |
parent | f3ce30ec75a4d7116b9cd4d7b21d9aaa0e237eeb (diff) |
tdf#108064 OOXML export: convert LO preset dashes to equivalent MSO presets
Change-Id: I967dfdc6a49cf04d98ea9fa9b57bf4669126a585
Reviewed-on: https://gerrit.libreoffice.org/61417
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 2f67b1fe7420..4eef5ecd2ff1 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -801,6 +801,35 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc { mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot", FSEND); } + /*convert some LO preset dashes to MSO preset dashes for oox interoperability + LO preset dashes which don't have equivalent in MSO preset dashes: 2 Dots 3 Dashes, Line with Fine Dots, 3 Dashes 3 Dots*/ + //ultrafine Dashed, Ultrafine Dotted -> sysDot + else if ((aLineDash.Dots == 1 && aLineDash.DotLen == 51 && aLineDash.Dashes == 1 && aLineDash.DashLen == 51 && aLineDash.Distance == 51) || + (aLineDash.Dots == 1 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 50)) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot", FSEND); + } + //Fine Dashed -> dash + else if (aLineDash.Dots == 1 && aLineDash.DotLen == 197 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 197) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND); + } + //Fine Dotted -> dot + else if (aLineDash.Dots == 1 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 457) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot", FSEND); + } + //Line Style 9, Dashed -> sysDash + else if ((aLineDash.Dots == 1 && aLineDash.DotLen == 197 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 120) || + (aLineDash.Dots == 1 && aLineDash.DotLen == 197 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 127)) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash", FSEND); + } + //2 Dots 1 Dash -> sysDashDotDot + else if (aLineDash.Dots == 2 && aLineDash.DotLen == 0 && aLineDash.Dashes == 1 && aLineDash.DashLen == 203 && aLineDash.Distance == 203) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot", FSEND); + } else { mpFS->startElementNS( XML_a, XML_custDash, FSEND ); |