summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/export/drawingml.cxx34
-rw-r--r--sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docxbin15661 -> 22017 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport6.cxx10
3 files changed, 35 insertions, 9 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index b19042e1c140..6536798be85b 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -700,14 +700,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
{
diff --git a/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx
index 9256c3ec7a4e..d7997ddc63c6 100644
--- a/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx
+++ b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 3a20b765f934..a41dd05501f4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -840,13 +840,19 @@ DECLARE_OOXMLEXPORT_TEST(testAlignForShape,"Shape.docx")
DECLARE_OOXMLEXPORT_TEST(testLineStyle_DashType, "LineStyle_DashType.docx")
{
/* DOCX contatining Shape with LineStyle as Dash Type should get preserved inside
- * an XMl tag <a:prstDash> with value "dash".
+ * an XMl tag <a:prstDash> with value "dash", "sysDot", "lgDot", etc.
*/
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[7]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDotDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[6]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDashDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[5]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "lgDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dashDot");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDash");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "sysDot");
}
DECLARE_OOXMLEXPORT_TEST(testGradientFillPreservation, "gradient-fill-preservation.docx")