summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-07-06 09:46:06 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-07 11:15:16 +0200
commita75477101510e7a8e60db03edbf2d253f504d70d (patch)
tree44550714254547b2e62892eb35d5a10af654367a
parent868d8c8f0fdf376b0a3eb545ee841c9c12ffee3b (diff)
tdf#77219 writerfilter: allow shapes to be in front of text
In LO4.3, commit 2496eaa5c4535b88b44e4ac034aae6af0c08de0e forced every shape to be "in background". That is not correct. Word appears to use negative z-indexes to indicate behind-text zordering and positive numbers for in-front placement. Change-Id: I4083ae67ef76152e1c0a894d810950d249ac13b4 Reviewed-on: https://gerrit.libreoffice.org/39670 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docxbin0 -> 10550 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docxbin0 -> 10554 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx10
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
4 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx b/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx
new file mode 100644
index 000000000000..bcfdcf377491
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf77219_backgroundShape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx b/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx
new file mode 100644
index 000000000000..7de2b4c39021
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf77219_foregroundShape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index c4c4f035a784..0957e02eb313 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -631,6 +631,16 @@ DECLARE_OOXMLEXPORT_TEST(test77219, "test77219.docx")
assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", "1");
}
+DECLARE_OOXMLEXPORT_TEST(testTdf77219_backgroundShape, "tdf77219_backgroundShape.docx")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", false, bool(getProperty<bool>(getShape(1), "Opaque")));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf77219_foregroundShape, "tdf77219_foregroundShape.docx")
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of the paragraph", true, bool(getProperty<bool>(getShape(1), "Opaque")));
+}
+
DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx")
{
// Document contains a flowChartMultidocument preset shape, our date for that shape wasn't correct.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8b8a78995b8a..bc15fc347fcf 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2081,7 +2081,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
aGrabBag[i].Value >>= zOrder;
xShapePropertySet->setPropertyValue( "ZOrder", uno::makeAny(pZOrderHelper->findZOrder(zOrder)));
pZOrderHelper->addItem(xShapePropertySet, zOrder);
- xShapePropertySet->setPropertyValue(getPropertyName( PROP_OPAQUE ), uno::makeAny( false ) );
+ xShapePropertySet->setPropertyValue(getPropertyName( PROP_OPAQUE ), uno::makeAny( zOrder >= 0 ) );
checkZOrderStatus = true;
}
else if ( aGrabBag[i].Name == "TxbxHasLink" )