diff options
Diffstat (limited to 'sw/source/core/doc/DocumentRedlineManager.cxx')
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 6db6b797dc35..f2d51192759d 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -30,6 +30,7 @@ #include <swmodule.hxx> #include <editsh.hxx> #include <vcl/layout.hxx> +#include <comphelper/flagguard.hxx> using namespace com::sun::star; @@ -1226,10 +1227,15 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall // also dealt with when moving the indices. if( bCallDelete ) { + ::comphelper::FlagGuard g(m_isForbidCompressRedlines); mpRedlineTable->Insert( pNewRedl ); m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pRedl ); if( !mpRedlineTable->Remove( pNewRedl ) ) + { + assert(false); // can't happen pNewRedl = nullptr; + } + bCompress = true; // delayed compress } delete pRedl; } @@ -1253,10 +1259,15 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall { // We insert temporarily so that pNew is // also dealt with when moving the indices. + ::comphelper::FlagGuard g(m_isForbidCompressRedlines); mpRedlineTable->Insert( pNewRedl ); m_rDoc.getIDocumentContentOperations().DeleteAndJoin( aPam ); if( !mpRedlineTable->Remove( pNewRedl ) ) + { + assert(false); // can't happen pNewRedl = nullptr; + } + bCompress = true; // delayed compress n = 0; // re-initialize } bDec = true; @@ -1279,10 +1290,15 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool bCall { // We insert temporarily so that pNew is // also dealt with when moving the indices. + ::comphelper::FlagGuard g(m_isForbidCompressRedlines); mpRedlineTable->Insert( pNewRedl ); m_rDoc.getIDocumentContentOperations().DeleteAndJoin( aPam ); if( !mpRedlineTable->Remove( pNewRedl ) ) + { + assert(false); // can't happen pNewRedl = nullptr; + } + bCompress = true; // delayed compress n = 0; // re-initialize bDec = true; } @@ -1777,6 +1793,11 @@ bool DocumentRedlineManager::AppendTableCellRedline( SwTableCellRedline* pNewRed void DocumentRedlineManager::CompressRedlines() { + if (m_isForbidCompressRedlines) + { + return; + } + CHECK_REDLINE( *this ) void (SwRangeRedline::*pFnc)(sal_uInt16, size_t) = nullptr; |