From 97952280f0adbe195e6a2e0bab8a21a7e352a721 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 19 Dec 2014 19:41:52 +0100 Subject: fdo#86963 SwXShape: don't ask SwTextBoxHelper for ZOrder of child shapes Regression from commit 01fc08c0b5c57fef8ad3755672f4266d85e849a5 (fdo#85554 SwXShape: fix getting ZOrder property when doc contains TextBoxes, 2014-11-20), the problem was that we returned wrong ZOrder of shapes inside group shapes. In SwXShape::getPropertyValue(), pObj points to the Writer-interfacing outermost group shape in case of shapes contained by group shapes, while GetSvxShape() gives access to the real shape. Given that TextBoxes are only possible at the highest level (and not inside group shapes), just check if the two pointers are the same: when not, then no need to convert anything. With this, child shapes get back their original ZOrder -- before in case the group shape had ZOrder=0, all its child shapes had ZOrder=0 as well. Change-Id: I9c4097154130cd04f6ab2f2082abafc1d4333872 --- sw/source/core/unocore/unodraw.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sw/source/core/unocore/unodraw.cxx') diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index ea0dd24ba90e..3cc240edf1e3 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1763,8 +1763,17 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) const SdrObject* pObj = pFmt->FindRealSdrObject(); if (pObj) { - std::set aTextBoxes = SwTextBoxHelper::findTextBoxes(pFmt->GetDoc()); - aRet <<= SwTextBoxHelper::getOrdNum(pObj, aTextBoxes); + bool bConvert = true; + if (SvxShape* pSvxShape = GetSvxShape()) + // In case of group shapes, pSvxShape points to the child shape, while pObj points to the outermost group shape. + if (pSvxShape->GetSdrObject() != pObj) + // Textboxes are not expected inside group shapes, so no conversion is necessary there. + bConvert = false; + if (bConvert) + { + std::set aTextBoxes = SwTextBoxHelper::findTextBoxes(pFmt->GetDoc()); + aRet <<= SwTextBoxHelper::getOrdNum(pObj, aTextBoxes); + } } } } -- cgit v1.2.3