[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Feb 17 12:56:50 CET 2014
sw/qa/extras/ooxmlexport/data/behinddoc.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 +++++++++
sw/source/filter/ww8/docxsdrexport.cxx | 6 +++++-
3 files changed, 14 insertions(+), 1 deletion(-)
New commits:
commit ea47fed15792c1b046c0872d334d24b146ddf083
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Feb 17 12:18:07 2014 +0100
DOCX export: try harder to detect in-background shapes
Change-Id: If7a4a5b9aad564d026173b942fd0b4a2fb52e157
diff --git a/sw/qa/extras/ooxmlexport/data/behinddoc.docx b/sw/qa/extras/ooxmlexport/data/behinddoc.docx
new file mode 100755
index 0000000..f859d2e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/behinddoc.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 3710bc2..5cc672f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2280,6 +2280,15 @@ DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx")
CPPUNIT_ASSERT_EQUAL(OUString("Description"), getProperty<OUString>(getShape(1), "Description"));
}
+DECLARE_OOXMLEXPORT_TEST(testBehinddoc, "behinddoc.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return;
+ // This was "0", shape was in the foreground.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor", "behindDoc", "1");
+}
+
DECLARE_OOXMLEXPORT_TEST(testDmlZorder, "dml-zorder.odt")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index cefb62f..2919806 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -200,7 +200,11 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS
if (isAnchor)
{
::sax_fastparser::FastAttributeList* attrList = m_pImpl->m_pSerializer->createAttrList();
- attrList->add(XML_behindDoc, pFrmFmt->GetOpaque().GetValue() ? "0" : "1");
+ bool bOpaque = pFrmFmt->GetOpaque().GetValue();
+ if (const SdrObject* pObj = pFrmFmt->FindRealSdrObject())
+ // SdrObjects know their layer, consider that instead of the frame format.
+ bOpaque = pObj->GetLayer() != pFrmFmt->GetDoc()->GetHellId() && pObj->GetLayer() != pFrmFmt->GetDoc()->GetInvisibleHellId();
+ attrList->add(XML_behindDoc, bOpaque ? "0" : "1");
attrList->add(XML_distT, OString::number(TwipsToEMU(pULSpaceItem.GetUpper())).getStr());
attrList->add(XML_distB, OString::number(TwipsToEMU(pULSpaceItem.GetLower())).getStr());
attrList->add(XML_distL, OString::number(TwipsToEMU(pLRSpaceItem.GetLeft())).getStr());
More information about the Libreoffice-commits
mailing list