[Libreoffice-commits] core.git: sw/qa sw/source
Pallavi Jadhav
pallavi.jadhav at synerzip.com
Thu Feb 13 11:00:36 CET 2014
sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 11 ++++++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 3 ++
sw/source/filter/ww8/docxsdrexport.cxx | 15 +++++++++++++-
sw/source/filter/ww8/docxsdrexport.hxx | 1
5 files changed, 29 insertions(+), 1 deletion(-)
New commits:
commit e5a891793baafb4504dcedaec82e6827d847ecf1
Author: Pallavi Jadhav <pallavi.jadhav at synerzip.com>
Date: Thu Jan 23 15:56:32 2014 +0530
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 in MS office 2007.
Implementation :
1] Added XML element <v:stroke> with attribute dashstyle="dash".
2] Written Export Unit test case.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7611
Change-Id: Id01c5975c2c1cf176a7459f65973f4c9c3c9b9d8
diff --git a/sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx
new file mode 100644
index 0000000..8b95672
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/LineStyle_DashType_VML.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b11f4ca..06b881c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2974,6 +2974,17 @@ DECLARE_OOXMLEXPORT_TEST(fdo69656, "Table_cell_auto_width_fdo69656.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblW","type","auto");
}
+DECLARE_OOXMLEXPORT_TEST(testLineStyle_DashType_VML, "LineStyle_DashType_VML.docx")
+{
+ /* DOCX contatining "Shape with text inside" having Line Style as "Dash Type" should get
+ * preserved inside an XML tag <v:stroke> with attribute dashstyle having 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:Fallback/w:pict/v:rect/v:stroke", "dashstyle", "dash");
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 97ec8b7..87b1c6e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5919,6 +5919,9 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
AddToAttrList( m_rExport.SdrExporter().getFlyAttrList(), 2,
XML_strokecolor, sColor.getStr(),
XML_strokeweight, sWidth.getStr() );
+ if( LineStyle_DASH == pTop->GetBorderLineStyle() ) // Line Style is Dash type
+ AddToAttrList( m_rExport.SdrExporter().getDashLineStyle(),
+ XML_dashstyle, "dash" );
}
else
{
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index a99f5ea..7abc92a 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -74,6 +74,7 @@ struct DocxSdrExport::Impl
sax_fastparser::FastAttributeList* m_pFlyFillAttrList;
sax_fastparser::FastAttributeList* m_pFlyWrapAttrList;
sax_fastparser::FastAttributeList* m_pBodyPrAttrList;
+ sax_fastparser::FastAttributeList* m_pDashLineStyleAttr;
Impl(DocxSdrExport& rSdrExport, DocxExport& rExport, sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML)
: m_rSdrExport(rSdrExport),
@@ -88,7 +89,8 @@ struct DocxSdrExport::Impl
m_bFrameBtLr(false),
m_pFlyFillAttrList(0),
m_pFlyWrapAttrList(0),
- m_pBodyPrAttrList(0)
+ m_pBodyPrAttrList(0),
+ m_pDashLineStyleAttr(0)
{
}
@@ -177,6 +179,11 @@ sax_fastparser::FastAttributeList* DocxSdrExport::getBodyPrAttrList()
return m_pImpl->m_pBodyPrAttrList;
}
+sax_fastparser::FastAttributeList*& DocxSdrExport::getDashLineStyle()
+{
+ return m_pImpl->m_pDashLineStyleAttr;
+}
+
void DocxSdrExport::setFlyWrapAttrList(sax_fastparser::FastAttributeList* pAttrList)
{
m_pImpl->m_pFlyWrapAttrList = pAttrList;
@@ -981,6 +988,12 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame)
m_pImpl->m_pFlyFillAttrList = NULL;
pFS->singleElementNS(XML_v, XML_fill, xFlyFillAttrList);
}
+ if (m_pImpl->m_pDashLineStyleAttr)
+ {
+ sax_fastparser::XFastAttributeListRef xDashLineStyleAttr(m_pImpl->m_pDashLineStyleAttr);
+ m_pImpl->m_pFlyFillAttrList = NULL;
+ pFS->singleElementNS(XML_v, XML_stroke, xDashLineStyleAttr);
+ }
pFS->startElementNS(XML_v, XML_textbox, xTextboxAttrList);
pFS->startElementNS(XML_w, XML_txbxContent, FSEND);
m_pImpl->m_rExport.WriteText();
diff --git a/sw/source/filter/ww8/docxsdrexport.hxx b/sw/source/filter/ww8/docxsdrexport.hxx
index 0f871ac..04598f8 100644
--- a/sw/source/filter/ww8/docxsdrexport.hxx
+++ b/sw/source/filter/ww8/docxsdrexport.hxx
@@ -69,6 +69,7 @@ public:
void setFlyWrapAttrList(sax_fastparser::FastAttributeList* pAttrList);
/// Attributes of <wps:bodyPr>, used during DML export of text frames.
sax_fastparser::FastAttributeList* getBodyPrAttrList();
+ sax_fastparser::FastAttributeList*& getDashLineStyle();
void startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rSize);
void endDMLAnchorInline(const SwFrmFmt* pFrmFmt);
More information about the Libreoffice-commits
mailing list