diff options
-rw-r--r-- | sw/qa/uitest/navigator/tdf140661.py | 5 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 18 |
2 files changed, 11 insertions, 12 deletions
diff --git a/sw/qa/uitest/navigator/tdf140661.py b/sw/qa/uitest/navigator/tdf140661.py index 258dd5e5ee63..d6c79eb2a00b 100644 --- a/sw/qa/uitest/navigator/tdf140661.py +++ b/sw/qa/uitest/navigator/tdf140661.py @@ -34,8 +34,11 @@ class tdf140661(UITestCase): self.assertEqual('DrawObject1', get_state_as_dict(xDrawings.getChild('0'))['Text']) else: self.assertEqual(12, len(xDrawings.getChildren())) + + # tdf#134960 + expectedShapeOrder = [1, 2, 8, 9, 7, 10, 11, 3, 12, 4, 5, 6] for i in range(12): - self.assertEqual('Shape' + str(i + 1), get_state_as_dict(xDrawings.getChild(str(i)))['Text']) + self.assertEqual('Shape' + str(expectedShapeOrder[i]), get_state_as_dict(xDrawings.getChild(str(i)))['Text']) xDrawings.executeAction("COLLAPSE", tuple()) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index d181182de36b..1a8db68e9baa 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1035,18 +1035,14 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) // #i51726# - all drawing objects can be named now if (!pTemp->GetName().isEmpty()) { - SwContact* pContact = static_cast<SwContact*>(pTemp->GetUserCall()); - tools::Long nYPos = 0; - const Point aNullPt; - if(pContact && pContact->GetFormat()) - nYPos = pContact->GetFormat()->FindLayoutRect(false, &aNullPt).Top(); - SwContent* pCnt = new SwContent( - this, - pTemp->GetName(), - nYPos); - if(!rIDDMA.IsVisibleLayerId(pTemp->GetLayer())) + tools::Long nYPos = LONG_MIN; + const bool bIsVisible = rIDDMA.IsVisibleLayerId(pTemp->GetLayer()); + if (bIsVisible) + nYPos = pTemp->GetLogicRect().Top(); + auto pCnt(std::make_unique<SwContent>(this, pTemp->GetName(), nYPos)); + if (!bIsVisible) pCnt->SetInvisible(); - m_pMember->insert(std::unique_ptr<SwContent>(pCnt)); + m_pMember->insert(std::move(pCnt)); m_nMemberCount++; } } |