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
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user