diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
commit | 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch) | |
tree | 812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /sw/source/core/undo/undraw.cxx | |
parent | Releasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff) | |
download | libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip |
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/source/core/undo/undraw.cxx')
-rw-r--r-- | sw/source/core/undo/undraw.cxx | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 134c686297..73a58a0f52 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -274,6 +274,8 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &) SdrObject* pObj = rSave.pObj; SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); + if (!pContact) + continue; // Save the textboxes if (auto pOldTextBoxNode = rSave.pFormat->GetOtherTextBoxFormats()) @@ -350,23 +352,25 @@ SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj, const SwDoc& rDoc ) m_nSize = o3tl::narrowing<sal_uInt16>(pObj->GetSubList()->GetObjCount()) + 1; m_pObjArray.reset( new SwUndoGroupObjImpl[ m_nSize ] ); - SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); - SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat()); + if (SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj))) + { + SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat()); - m_pObjArray[0].pObj = pObj; - m_pObjArray[0].pFormat = pFormat; + m_pObjArray[0].pObj = pObj; + m_pObjArray[0].pFormat = pFormat; - // object will destroy itself - pContact->Changed( *pObj, SdrUserCallType::Delete, pObj->GetLastBoundRect() ); - pObj->SetUserCall( nullptr ); + // object will destroy itself + pContact->Changed( *pObj, SdrUserCallType::Delete, pObj->GetLastBoundRect() ); + pObj->SetUserCall( nullptr ); - ::lcl_SaveAnchor( pFormat, m_pObjArray[0].nNodeIdx ); + ::lcl_SaveAnchor( pFormat, m_pObjArray[0].nNodeIdx ); - pFormat->RemoveAllUnos(); + pFormat->RemoveAllUnos(); - // remove from array - sw::SpzFrameFormats& rFlyFormats = *pFormat->GetDoc()->GetSpzFrameFormats(); - rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); + // remove from array + sw::SpzFrameFormats& rFlyFormats = *pFormat->GetDoc()->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); + } } SwUndoDrawUnGroup::~SwUndoDrawUnGroup() @@ -622,6 +626,9 @@ void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext) SwUndoGroupObjImpl& rSave = m_pObjArray[n]; SdrObject *pObj = rSave.pObj; SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); + if (!pContact) + continue; + SwDrawFrameFormat *pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat()); // object will destroy itself |