DOCX drawingML export: fix paragraph margins

Without the EndParagraphProperties() call, w:spacing wasn't ever
written as a paragraph property.

Change-Id: Iff4ca2a9e0725ac38d7b528c220c8ea58fc89cab
This commit is contained in:
Miklos Vajna 2014-02-18 14:29:11 +01:00
parent 3c058338fb
commit 9e6960c74d
3 changed files with 16 additions and 2 deletions

View File

@ -2317,6 +2317,18 @@ DECLARE_OOXMLEXPORT_TEST(testDmlGroupshapeRelsize, "dml-groupshape-relsize.docx"
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "page");
}
DECLARE_OOXMLEXPORT_TEST(testDmlGroupshapeParaspacing, "dml-groupshape-paraspacing.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
// Paragraph spacing of shape text in groupshapes was left, the w:spacing element was missing in pPr.
assertXPath(pXmlDoc,
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:pPr/w:spacing",
"before",
"240");
}
DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");

View File

@ -3466,11 +3466,13 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
sal_Int32 nAktPos = 0;
sal_Int32 nEnd = aStr.getLength();
m_pSerializer->startElementNS( XML_w, XML_p, FSEND );
StartParagraph(ww8::WW8TableNodeInfo::Pointer_t());
// Write paragraph properties.
m_pSerializer->startElementNS(XML_w, XML_pPr, FSEND);
StartParagraphProperties();
aAttrIter.OutParaAttr(false);
EndParagraphProperties(0, 0, 0, 0);
m_pSerializer->endElementNS(XML_w, XML_pPr);
do {
@ -3497,7 +3499,7 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
aAttrIter.NextPos();
}
while( nAktPos < nEnd );
m_pSerializer->endElementNS( XML_w, XML_p );
EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t());
}
m_pSerializer->endElementNS( XML_w, XML_txbxContent );
}