diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
commit | 5a7157d319477830426797532e02ac39d3b859f4 (patch) | |
tree | 3773f5ce209bee14a5643e98672e0f3828c71434 /sw/source/core/frmedt | |
parent | Releasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff) | |
download | libreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip |
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/source/core/frmedt')
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 48 | ||||
-rw-r--r-- | sw/source/core/frmedt/fetab.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 4 |
4 files changed, 46 insertions, 42 deletions
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 9e2fedcc38..93ad4212cf 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -286,8 +286,8 @@ void SwFEShell::UnfloatFlyFrame() return; } - SwFrameFormat& rFlyFormat = pFly->GetFrameFormat(); - const SwFormatContent& rContent = rFlyFormat.GetContent(); + SwFrameFormat* pFlyFormat = pFly->GetFrameFormat(); + const SwFormatContent& rContent = pFlyFormat->GetContent(); const SwNodeIndex* pFlyStart = rContent.GetContentIdx(); if (!pFlyStart) { @@ -315,7 +315,7 @@ void SwFEShell::UnfloatFlyFrame() } SwNodeRange aRange(pFlyStart->GetNode(), SwNodeOffset(1), *pFlyEnd, SwNodeOffset(-1)); - const SwFormatAnchor& rAnchor = rFlyFormat.GetAnchor(); + const SwFormatAnchor& rAnchor = pFlyFormat->GetAnchor(); SwNode* pAnchor = rAnchor.GetAnchorNode(); if (!pAnchor) { @@ -327,8 +327,8 @@ void SwFEShell::UnfloatFlyFrame() rIDCO.MoveNodeRange(aRange, aInsertPos.GetNode(), SwMoveFlags::CREATEUNDOOBJ); // Remove the fly frame frame. - IDocumentLayoutAccess& rIDLA = rFlyFormat.getIDocumentLayoutAccess(); - rIDLA.DelLayoutFormat(&rFlyFormat); + IDocumentLayoutAccess& rIDLA = pFlyFormat->getIDocumentLayoutAccess(); + rIDLA.DelLayoutFormat(pFlyFormat); } // Get selected fly @@ -496,8 +496,8 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) // #i28701# SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj ); - SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat(); - const RndStdIds nAnchorId = rFormat.GetAnchor().GetAnchorId(); + SwFrameFormat* pFormat = pAnchoredObj->GetFrameFormat(); + const RndStdIds nAnchorId = pFormat->GetAnchor().GetAnchorId(); if ( RndStdIds::FLY_AS_CHAR == nAnchorId ) return aRet; @@ -505,9 +505,9 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) bool bFlyFrame = dynamic_cast<SwVirtFlyDrawObj *>(pObj) != nullptr; bool bTextBox = false; - if (rFormat.Which() == RES_DRAWFRMFMT) + if (pFormat->Which() == RES_DRAWFRMFMT) { - bTextBox = SwTextBoxHelper::isTextBox(&rFormat, RES_DRAWFRMFMT, pObj); + bTextBox = SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT, pObj); } SwFlyFrame* pFly = nullptr; @@ -534,7 +534,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) { auto pFlyFormat = dynamic_cast<const SwFlyFrameFormat*>(SwTextBoxHelper::getOtherTextBoxFormat( - &rFormat, RES_DRAWFRMFMT, pObj)); + pFormat, RES_DRAWFRMFMT, pObj)); if (pFlyFormat) { pFly = pFlyFormat->GetFrame(); @@ -608,7 +608,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) if ( bMoveIt || (nAnchorId == RndStdIds::FLY_AT_CHAR) ) { - SwFormatAnchor aAnch( rFormat.GetAnchor() ); + SwFormatAnchor aAnch( pFormat->GetAnchor() ); switch ( nAnchorId ) { case RndStdIds::FLY_AT_PARA: @@ -665,24 +665,24 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) // anchor attribute is change and re-create them afterwards. { std::unique_ptr<SwHandleAnchorNodeChg> pHandleAnchorNodeChg; - SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(&rFormat) ); + SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(pFormat) ); if ( pFlyFrameFormat ) { pHandleAnchorNodeChg.reset( new SwHandleAnchorNodeChg( *pFlyFrameFormat, aAnch )); } - rFormat.GetDoc()->SetAttr( aAnch, rFormat ); - if (SwTextBoxHelper::getOtherTextBoxFormat(&rFormat, RES_DRAWFRMFMT, + pFormat->GetDoc()->SetAttr( aAnch, *pFormat ); + if (SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT, pObj)) { if (SdrObjList* pObjList = pObj->getChildrenOfSdrObject()) { for (const rtl::Reference<SdrObject>& pChild : *pObjList) - SwTextBoxHelper::changeAnchor(&rFormat, pChild.get()); + SwTextBoxHelper::changeAnchor(pFormat, pChild.get()); } else SwTextBoxHelper::syncFlyFrameAttr( - rFormat, rFormat.GetAttrSet(), pObj); + *pFormat, pFormat->GetAttrSet(), pObj); } } // #i28701# - no call of method diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 9a18e7934c..9154758364 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -392,8 +392,8 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) SwFrame* pNew = pOld; // #i28701# SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj ); - SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat(); - SwFormatAnchor aAnch( rFormat.GetAnchor() ); + SwFrameFormat* pFormat = pAnchoredObj->GetFrameFormat(); + SwFormatAnchor aAnch( pFormat->GetAnchor() ); RndStdIds nAnchorId = aAnch.GetAnchorId(); if ( RndStdIds::FLY_AS_CHAR == nAnchorId ) return false; @@ -582,13 +582,13 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) // anchor attribute is change and re-create them afterwards. { std::unique_ptr<SwHandleAnchorNodeChg> pHandleAnchorNodeChg; - SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(&rFormat) ); + SwFlyFrameFormat* pFlyFrameFormat( dynamic_cast<SwFlyFrameFormat*>(pFormat) ); if ( pFlyFrameFormat ) { pHandleAnchorNodeChg.reset( new SwHandleAnchorNodeChg( *pFlyFrameFormat, aAnch )); } - rFormat.GetDoc()->SetAttr( aAnch, rFormat ); + pFormat->GetDoc()->SetAttr( aAnch, *pFormat ); } // #i28701# - no call of method // <CheckCharRectAndTopOfLine()> for to-character anchored @@ -1317,8 +1317,8 @@ bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) if ( pObj->GetLayer() == rIDDMA.GetHellId() ) { const SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj ); - const SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat(); - const SwFormatSurround& rSurround = rFormat.GetSurround(); + const SwFrameFormat* pFormat = pAnchoredObj->GetFrameFormat(); + const SwFormatSurround& rSurround = pFormat->GetSurround(); if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH ) { bObjInBackground = true; @@ -2221,14 +2221,16 @@ RndStdIds SwFEShell::GetAnchorId() const nRet = RndStdIds::UNKNOWN; break; } - SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); - RndStdIds nId = pContact->GetFormat()->GetAnchor().GetAnchorId(); - if ( nRet == RndStdIds(SHRT_MAX) ) - nRet = nId; - else if ( nRet != nId ) + if (SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj))) { - nRet = RndStdIds::UNKNOWN; - break; + RndStdIds nId = pContact->GetFormat()->GetAnchor().GetAnchorId(); + if (nRet == RndStdIds(SHRT_MAX)) + nRet = nId; + else if (nRet != nId) + { + nRet = RndStdIds::UNKNOWN; + break; + } } } } @@ -3152,17 +3154,19 @@ Color SwFEShell::GetShapeBackground() const OSL_ENSURE( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr, "wrong usage of SwFEShell::GetShapeBackground - selected object is not a drawing object!"); if ( dynamic_cast<const SwVirtFlyDrawObj*>( pSdrObj) == nullptr ) { - // determine page frame of the frame the shape is anchored. - const SwFrame* pAnchorFrame = - static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrame( pSdrObj ); - OSL_ENSURE( pAnchorFrame, "inconsistent model - no anchor at shape!"); - if ( pAnchorFrame ) + if (SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall(pSdrObj))) { - const SwPageFrame* pPageFrame = pAnchorFrame->FindPageFrame(); - OSL_ENSURE( pPageFrame, "inconsistent model - no page!"); - if ( pPageFrame ) + // determine page frame of the frame the shape is anchored. + const SwFrame * pAnchorFrame = pDrawContact->GetAnchorFrame(pSdrObj); + OSL_ENSURE(pAnchorFrame, "inconsistent model - no anchor at shape!"); + if (pAnchorFrame) { - aRetColor = pPageFrame->GetDrawBackgroundColor(); + const SwPageFrame* pPageFrame = pAnchorFrame->FindPageFrame(); + OSL_ENSURE(pPageFrame, "inconsistent model - no page!"); + if (pPageFrame) + { + aRetColor = pPageFrame->GetDrawBackgroundColor(); + } } } } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 79f5eb6b5e..33b9c9327b 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -2116,8 +2116,8 @@ SwTab SwFEShell::WhichMouseTabCol( const Point &rPt ) const { while( pFrame && pFrame->Lower() && pFrame->Lower()->IsRowFrame() ) pFrame = static_cast<const SwCellFrame*>(static_cast<const SwLayoutFrame*>(pFrame->Lower())->Lower()); - if( pFrame && pFrame->GetTabBox()->GetSttNd() && - pFrame->GetTabBox()->GetSttNd()->IsInProtectSect() ) + if( pFrame && ((pFrame->GetTabBox()->GetSttNd() && + pFrame->GetTabBox()->GetSttNd()->IsInProtectSect()) || (pFrame->GetTabBox()->getRowSpan() < 0))) pFrame = nullptr; } diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index bce8e2bb97..539f485313 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -464,12 +464,12 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con // This table is in a split fly, but we will insert a label, which means this is not // a floating table anymore, disable the "can split" bit, it'll be hidden on the UI // anyway. - SwFrameFormat& rFlyFormat = pFly->GetFrameFormat(); + SwFrameFormat* pFormat = pFly->GetFrameFormat(); SfxItemSetFixed<RES_FLY_SPLIT, RES_FLY_SPLIT> aSet(GetDoc()->GetAttrPool()); SwFormatFlySplit aSplit(false); aSet.Put(aSplit); // SwUndoFormatAttr is created for us. - GetDoc()->SetFlyFrameAttr(rFlyFormat, aSet); + GetDoc()->SetFlyFrameAttr(*pFormat, aSet); } } break; |