diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-12-09 20:22:07 -0900 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-12-14 11:12:36 +0100 |
commit | 2b035eb5ba1f9600ea19937519cbc9068c31263b (patch) | |
tree | a18497440f7a304c8f9fa20d9bc6a7fc89bcb69f /sw/source | |
parent | 42be5b7c75b2d50b93e110b0cd906a48b3bb0e26 (diff) |
tdf#134960 List drawing objects in order of appearance in document
in Writer Navigator drawing objects content type member list
Current code seems like it should work but GetFrameOfModified doesn't
provide layout position for drawing objects like it does for table and
frame objects. This patch gets position of drawing object in document
directly from SdrObject.
Change-Id: I501757900f265370d8e3b606cb4b3a81464e73f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126627
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
(cherry picked from commit 9e046e43fc6d3fecd193da076c0871a458ba71dd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126808
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 380af4aba7a4..93b2af042fe7 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++; } } |