summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-04-19 21:57:29 -0400
committerJustin Luth <jluth@mail.com>2024-04-20 19:07:22 +0200
commit00ef339bfc747897b8e4410fa0aa4397c4e45717 (patch)
tree48357057001d1e59e69e5cfb633f8e5ea9b200a1
parent1d419280f70ecfe0cb4b3c0968492f4e2c7d93a3 (diff)
tdf#81956 vml import: put groupshape in foreground if positive z-index
no interesting unit tests found, but this one at least lets you add text to the body and visibly see the effect of foreground/background. make CppunitTest_sw_ooxmlimport CPPUNIT_TEST_NAME=testN751077 Change-Id: Ib03e6b429ad4ec6a38d1119f3720bc56a70b98eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166345 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx3
-rw-r--r--sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx21
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index e9bc24315d6b..7c2800b7aa72 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -175,6 +175,9 @@ xray ThisComponent.DrawPage(1).getByIndex(0).String
xray ThisComponent.DrawPage(1).getByIndex(0).Anchor.PageStyleName
*/
uno::Reference<drawing::XShapes> xShapes(getShape(2), uno::UNO_QUERY);
+ // The groupshape should be in the foreground, not the background.
+ CPPUNIT_ASSERT(getProperty<bool>(xShapes, "Opaque"));
+
uno::Reference<text::XTextRange> xShape(xShapes->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("TEXT1\n"), xShape->getString());
// we want to test the textbox is on the first page (it was put onto another page without the fix),
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 4fdacfb2f944..6e65750dec1e 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -4696,6 +4696,27 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
}
}
+ uno::Reference<beans::XPropertySet> xShapePropertySet(xShape, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ xShapePropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
+
+ for (const auto& rProp : aGrabBag)
+ {
+ if (rProp.Name == "VML-Z-ORDER")
+ {
+ sal_Int64 zOrder(0);
+ rProp.Value >>= zOrder;
+
+ text::TextContentAnchorType nAnchorType
+ = text::TextContentAnchorType_AT_PARAGRAPH;
+ xShapePropertySet->getPropertyValue(getPropertyName(PROP_ANCHOR_TYPE))
+ >>= nAnchorType;
+
+ const uno::Any aOpaque(nAnchorType == text::TextContentAnchorType_AS_CHARACTER
+ || (zOrder >= 0 && !IsInHeaderFooter()));
+ xShapePropertySet->setPropertyValue(getPropertyName(PROP_OPAQUE), aOpaque);
+ }
+ }
// A GroupShape doesn't implement text::XTextRange, but appending
// an empty reference to the stacks still makes sense, because this
// way bToRemove can be set, and we won't end up with duplicated