Fix for :DOCX-Preservation of Line style Dash type of "Shape with text inside"

Issue :
        File containing Shape with text inside it having Line style as
        Dash type is not getting preserved after RT.

    Implementation :
        1] Added XML element <a:prstDash> with attribute  val="dash".
        2] Written Export Unit test case.

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/7572

Change-Id: I27ca9f8786426a224b32dbd2aeabc40be244c9db
This commit is contained in:
Pallavi Jadhav
2014-01-21 19:49:45 +05:30
committed by Miklos Vajna
parent 5ac84cb165
commit 0fc0acb525
3 changed files with 13 additions and 0 deletions

Binary file not shown.

View File

@@ -2687,6 +2687,17 @@ DECLARE_OOXMLEXPORT_TEST(testAlignForShape,"Shape.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:align","1");
}
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".
*/
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:prstDash", "val", "dash");
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();

View File

@@ -5810,6 +5810,8 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
XML_val, sColor,
FSEND);
m_pSerializer->endElementNS(XML_a, XML_solidFill);
if( LineStyle_DASH == pTop->GetBorderLineStyle() ) // Line Style is Dash type
m_pSerializer->singleElementNS(XML_a, XML_prstDash, XML_val, "dash", FSEND);
m_pSerializer->endElementNS(XML_a, XML_ln);
}
}