diff options
author | László Németh <nemeth@numbertext.org> | 2020-12-12 13:19:01 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-12-12 16:49:35 +0100 |
commit | e57d77cb01d3e76a942c5e2bb896135dd900f807 (patch) | |
tree | a024d9a69f16b5965977742421803a79f095be69 /sw/source/core/undo | |
parent | dd69546ac992e394c2f93e706d1eaa021e64bed5 (diff) |
tdf#138605 sw change tracking: fix crash with Undo
Regression from commit 469f472fb31c4ef1a57f8ec54ba750c1332feec2
(tdf#138479 tdf#137769 sw ChangesInMargin: fix Undo in paragraphs)
Change-Id: I7826b7920e51733da98c00bfdcb8636d42655afc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107637
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/undo')
-rw-r--r-- | sw/source/core/undo/unredln.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx index 6865beba6cd6..a737863c3835 100644 --- a/sw/source/core/undo/unredln.cxx +++ b/sw/source/core/undo/unredln.cxx @@ -93,15 +93,15 @@ void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext) // fix PaM for deletions shown in margin bool bIsDeletion = dynamic_cast<SwUndoRedlineDelete*>(this); + const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); sal_uInt32 nMaxId = SAL_MAX_UINT32; - if ( bIsDeletion ) + if ( bIsDeletion && rTable.size() > 0 ) { // Nodes of the deletion range are in the newest invisible redlines. // Set all redlines visible and recover the original deletion range. - for (sal_uInt32 nNodes = 0; nNodes < m_nEndNode - m_nSttNode + 1; ++ nNodes) + for (sal_uInt32 nNodes = 0; nNodes < m_nEndNode - m_nSttNode + 1; ++nNodes) { SwRedlineTable::size_type nCurRedlinePos = 0; - const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); SwRangeRedline * pRedline(rTable[nCurRedlinePos]); // search last but nNodes redline by its nth biggest id |