From 5a7157d319477830426797532e02ac39d3b859f4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:29:03 +0200 Subject: Merging upstream version 4:24.2.1. Signed-off-by: Daniel Baumann --- sw/source/core/draw/dcontact.cxx | 8 ++++---- sw/source/core/draw/dview.cxx | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'sw/source/core/draw') diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 5c2147ed91..aac8f2393c 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -493,7 +493,7 @@ sal_uInt32 SwFlyDrawContact::GetOrdNumForNewRef(const SwFlyFrame* pFly, { for (SwAnchoredObject const*const pAnchoredObj : *pObjs) { - if (&pAnchoredObj->GetFrameFormat() == pDrawFormat) + if (pAnchoredObj->GetFrameFormat() == pDrawFormat) { return pAnchoredObj->GetDrawObj()->GetOrdNum() + 1; } @@ -1235,7 +1235,7 @@ void SwDrawContact::Changed_( const SdrObject& rObj, // #i31698# - determine layout direction // via draw frame format. SwFrameFormat::tLayoutDir eLayoutDir = - pAnchoredDrawObj->GetFrameFormat().GetLayoutDir(); + pAnchoredDrawObj->GetFrameFormat()->GetLayoutDir(); // use geometry of drawing object tools::Rectangle aObjRect( rObj.GetSnapRect() ); // If drawing object is a member of a group, the adjustment @@ -1967,7 +1967,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) { for (const SwAnchoredObject* pAnchoredObj : *pObjs) { - if (&pAnchoredObj->GetFrameFormat() == pFlyFormat) + if (pAnchoredObj->GetFrameFormat() == pFlyFormat) { SdrPage* pDrawPage = pAnchoredObj->GetDrawObj()->getSdrPageFromSdrObject(); if (pDrawPage) @@ -2359,7 +2359,7 @@ void SwDrawVirtObj::AddToDrawingPage(SwFrame const& rAnchorFrame) { for (SwAnchoredObject const*const pAnchoredObj : *pObjs) { - if (&pAnchoredObj->GetFrameFormat() == pFlyFormat) + if (pAnchoredObj->GetFrameFormat() == pFlyFormat) { assert(dynamic_cast(pAnchoredObj)); diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 9d704647c3..fe0db61925 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -550,7 +550,7 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, size_t nOldPos, { size_t nTmpNewPos( nNewPos ); const SwFrameFormat* pParentFrameFormat = - pParentAnchoredObj ? &(pParentAnchoredObj->GetFrameFormat()) : nullptr; + pParentAnchoredObj ? pParentAnchoredObj->GetFrameFormat() : nullptr; const SdrObject* pTmpObj = pDrawPage->GetObj( nNewPos + 1 ); while ( pTmpObj ) { @@ -562,7 +562,7 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, size_t nOldPos, const SwFlyFrame* pTmpParentObj = pTmpAnchorFrame ? pTmpAnchorFrame->FindFlyFrame() : nullptr; if ( pTmpParentObj && - &(pTmpParentObj->GetFrameFormat()) != pParentFrameFormat ) + pTmpParentObj->GetFrameFormat() != pParentFrameFormat ) { if ( bMovedForward ) { @@ -977,16 +977,19 @@ void SwDrawView::DeleteMarked() { SdrObject *pObject = rMarkList.GetMark(i)->GetMarkedSdrObj(); SwContact* pContact = GetUserCall(pObject); - SwFrameFormat* pFormat = pContact->GetFormat(); - if (pObject->getChildrenOfSdrObject()) + if (pContact) { - auto pChildTextBoxes = SwTextBoxHelper::CollectTextBoxes(pObject, pFormat); - for (auto& rChildTextBox : pChildTextBoxes) - aTextBoxesToDelete.push_back(rChildTextBox); - } - else - if (SwFrameFormat* pTextBox = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT)) + SwFrameFormat* pFormat = pContact->GetFormat(); + if (pObject->getChildrenOfSdrObject()) + { + auto pChildTextBoxes = SwTextBoxHelper::CollectTextBoxes(pObject, pFormat); + for (auto& rChildTextBox : pChildTextBoxes) + aTextBoxesToDelete.push_back(rChildTextBox); + } + else if (SwFrameFormat* pTextBox + = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT)) aTextBoxesToDelete.push_back(pTextBox); + } } if ( pDoc->DeleteSelection( *this ) ) -- cgit v1.2.3