Kaydet (Commit) 6415f3e7 authored tarafından YogeshBharate's avatar YogeshBharate Kaydeden (comit) Miklos Vajna

fdo#75604: File Corruption - Issue related to the nested AlternateContent.

Problem Description:
- If the document contains, text box & group shape having
  text, after roundtrip file get corrupted.
- Due this the text box exported inside the another group shape.
(i.e nested alternateContent which is not allowed in MS office 2010.)

Implementation:
- Use the variable which avoid the nested alternateContent.
- This keeps the various text frame on same level in different
  run.

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

Change-Id: Ia18eb2b8cf17a451ebe344a811efae1328134215
üst 881ca9d4
...@@ -2804,6 +2804,15 @@ DECLARE_OOXMLEXPORT_TEST(testFileWithInvalidImageLink, "FileWithInvalidImageLink ...@@ -2804,6 +2804,15 @@ DECLARE_OOXMLEXPORT_TEST(testFileWithInvalidImageLink, "FileWithInvalidImageLink
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", ""); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", "");
} }
DECLARE_OOXMLEXPORT_TEST(testNestedAlternateContent, "nestedAlternateContent.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
// We check alternateContent could not contains alternateContent (i.e. nested alternateContent)
assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wpg:wgp[1]/wps:wsp[2]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]",0);
}
#endif #endif
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -4069,7 +4069,10 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) ...@@ -4069,7 +4069,10 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
aAttrIter.NextPos(); aAttrIter.NextPos();
} }
while( nAktPos < nEnd ); while( nAktPos < nEnd );
// Word can't handle nested text boxes, so write them on the same level.
++m_nTextFrameLevel;
EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t()); EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t());
--m_nTextFrameLevel;
} }
m_pSerializer->endElementNS( XML_w, XML_txbxContent ); m_pSerializer->endElementNS( XML_w, XML_txbxContent );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment