diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-22 14:36:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-23 11:11:11 +0200 |
commit | 28bff4bd3947f442c0aebb92217cd0c7b6a53bda (patch) | |
tree | cfa5cf6199774bc9decd07e286d4e4182f1590d3 /sw/source/core | |
parent | be6227b6c8d6ffacb7168e76856c7e059c08bf77 (diff) |
convert nsRedlineType_t to scoped enum
and move the auto-format embedded flag to a separate field
Change-Id: I02155702389178fbfdf874f592d47a29f8759974
Reviewed-on: https://gerrit.libreoffice.org/72771
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core')
48 files changed, 230 insertions, 229 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 32bf6cb8b6dc..dc87d1ebe943 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1863,15 +1863,16 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, { switch( pRedline->GetType()) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: aChangeAttr = pOpt->GetInsertAuthorAttr(); break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: aChangeAttr = pOpt->GetDeletedAuthorAttr(); break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: aChangeAttr = pOpt->GetFormatAuthorAttr(); break; + default: break; } } switch( aChangeAttr.m_nItemId ) diff --git a/sw/source/core/access/parachangetrackinginfo.cxx b/sw/source/core/access/parachangetrackinginfo.cxx index b8544b891f78..8ddeee61a344 100644 --- a/sw/source/core/access/parachangetrackinginfo.cxx +++ b/sw/source/core/access/parachangetrackinginfo.cxx @@ -61,7 +61,7 @@ namespace { } const SwRedlineTable::size_type nIdxOfFirstRedlineForTextNode = - rIDocChangeTrack.GetRedlinePos( rTextNode, USHRT_MAX ); + rIDocChangeTrack.GetRedlinePos( rTextNode, RedlineType::Any ); if ( nIdxOfFirstRedlineForTextNode == SwRedlineTable::npos ) { // nothing to do --> empty change track text markup lists. @@ -105,17 +105,17 @@ namespace { SwWrongList* pMarkupList( nullptr ); switch ( pActRedline->GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: { pMarkupList = opChangeTrackInsertionTextMarkupList.get(); } break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: { pMarkupList = opChangeTrackDeletionTextMarkupList.get(); } break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: { pMarkupList = opChangeTrackFormatChangeTextMarkupList.get(); } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index a593db4de4bd..9c0d9c130150 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -2250,7 +2250,7 @@ const SwRangeRedline* SwCursorShell::GotoRedline_( SwRedlineTable::size_type nAr if( pFnd && bSelect ) { m_pCurrentCursor->SetMark(); - if( nsRedlineType_t::REDLINE_FMTCOLL == pFnd->GetType() ) + if( RedlineType::FmtColl == pFnd->GetType() ) { pCNd = pIdx->GetNode().GetContentNode(); m_pCurrentCursor->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 8503a98c17c2..def2a7529d72 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -1069,7 +1069,7 @@ bool ReplaceImpl( ++tmp; continue; } - if (pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + if (pRedline->GetType() == RedlineType::Delete) { assert(*pRedline->Start() != *pRedline->End()); // search in hidden layout can't overlap redlines diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index cd58106998bc..5509b9f33027 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1504,14 +1504,14 @@ static OUString lcl_MaskDeletedRedlines( const SwTextNode* pTextNd ) const bool bShowChg = IDocumentRedlineAccess::IsShowChanges( rDoc.getIDocumentRedlineAccess().GetRedlineFlags() ); if ( bShowChg ) { - SwRedlineTable::size_type nAct = rDoc.getIDocumentRedlineAccess().GetRedlinePos( *pTextNd, USHRT_MAX ); + SwRedlineTable::size_type nAct = rDoc.getIDocumentRedlineAccess().GetRedlinePos( *pTextNd, RedlineType::Any ); for ( ; nAct < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); nAct++ ) { const SwRangeRedline* pRed = rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct ]; if ( pRed->Start()->nNode > pTextNd->GetIndex() ) break; - if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() ) + if( RedlineType::Delete == pRed->GetType() ) { sal_Int32 nStart, nEnd; pRed->CalcStartEnd( pTextNd->GetIndex(), nStart, nEnd ); diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 1fe99be1dd2a..7e2d3e415148 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -336,7 +336,7 @@ namespace for( ; n < rTable.size(); ++n ) { const SwRangeRedline* pRedl = rTable[ n ]; - if( nsRedlineType_t::REDLINE_DELETE == pRedl->GetType() && pRedl->IsVisible() ) + if( RedlineType::Delete == pRedl->GetType() && pRedl->IsVisible() ) { const SwPosition *pRStt = pRedl->Start(), *pREnd = pRedl->End(); @@ -823,7 +823,7 @@ namespace { rSvRedLine.SetPos( nInsPos ); pDoc->getIDocumentRedlineAccess().AppendRedline( rSvRedLine.pRedl, true ); - if (rSvRedLine.pRedl->GetType() == nsRedlineType_t::REDLINE_DELETE) + if (rSvRedLine.pRedl->GetType() == RedlineType::Delete) { UpdateFramesForAddDeleteRedline(*pDoc, *rSvRedLine.pRedl); } @@ -1245,7 +1245,7 @@ namespace //local functions originally from docfmt.cxx pUndo->SaveRedlineData( aPam, true ); if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) - pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); + pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aPam ), true); else pDoc->getIDocumentRedlineAccess().SplitRedline( aPam ); } @@ -1289,7 +1289,7 @@ namespace //local functions originally from docfmt.cxx if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( - bTextIns ? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_FORMAT, aPam ), + bTextIns ? RedlineType::Insert : RedlineType::Format, aPam ), true); else if( bTextIns ) pDoc->getIDocumentRedlineAccess().SplitRedline( aPam ); @@ -1483,7 +1483,7 @@ namespace //local functions originally from docfmt.cxx if( pUndo ) pUndo->SaveRedlineData( aPam, false ); - pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_FORMAT, aPam ), true); + pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Format, aPam ), true); } } if( pOtherSet && pOtherSet->Count() ) @@ -1505,7 +1505,7 @@ namespace //local functions originally from docfmt.cxx { if( pUndo ) pUndo->SaveRedlineData( rRg, false ); - pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_FORMAT, rRg ), true); + pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Format, rRg ), true); } /* now if range */ @@ -1841,7 +1841,7 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, cons if( pRedlineRange ) { if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) - pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, *pRedlineRange ), true); + pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, *pRedlineRange ), true); else pDoc->getIDocumentRedlineAccess().SplitRedline( *pRedlineRange ); delete pRedlineRange; @@ -1862,7 +1862,7 @@ void DocumentContentOperationsManager::DeleteSection( SwNode *pNode ) // delete all Flys, Bookmarks, ... DelFlyInRange( aSttIdx, aEndIdx ); - m_rDoc.getIDocumentRedlineAccess().DeleteRedline( *pSttNd, true, USHRT_MAX ); + m_rDoc.getIDocumentRedlineAccess().DeleteRedline( *pSttNd, true, RedlineType::Any ); DelBookmarks(aSttIdx, aEndIdx); { @@ -2340,7 +2340,7 @@ bool DocumentContentOperationsManager::MoveNodeRange( SwNodeRange& rRange, SwNod // Find all RedLines that end at the InsPos. // These have to be moved back to the "old" position after the Move. - SwRedlineTable::size_type nRedlPos = m_rDoc.getIDocumentRedlineAccess().GetRedlinePos( rPos.GetNode(), USHRT_MAX ); + SwRedlineTable::size_type nRedlPos = m_rDoc.getIDocumentRedlineAccess().GetRedlinePos( rPos.GetNode(), RedlineType::Any ); if( SwRedlineTable::npos != nRedlPos ) { const SwPosition *pRStt, *pREnd; @@ -2554,14 +2554,14 @@ bool DocumentContentOperationsManager::Overwrite( const SwPaM &rRg, const OUStri !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()) { SwPaM aPam(rPt.nNode, nActualStart, rPt.nNode, rPt.nContent.GetIndex()); - m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aPam, true, USHRT_MAX ); + m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aPam, true, RedlineType::Any ); } else if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { // FIXME: this redline is WRONG: there is no DELETE, and the skipped // characters are also included in aPam SwPaM aPam(rPt.nNode, nActualStart, rPt.nNode, rPt.nContent.GetIndex()); - m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); + m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aPam ), true); } m_rDoc.getIDocumentState().SetModified(); @@ -2661,7 +2661,7 @@ bool DocumentContentOperationsManager::InsertString( const SwPaM &rRg, const OUS if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { m_rDoc.getIDocumentRedlineAccess().AppendRedline( - new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); + new SwRangeRedline( RedlineType::Insert, aPam ), true); } else { @@ -3079,7 +3079,7 @@ bool DocumentContentOperationsManager::SplitNode( const SwPosition &rPos, bool b if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()) { m_rDoc.getIDocumentRedlineAccess().AppendRedline( - new SwRangeRedline(nsRedlineType_t::REDLINE_INSERT, aPam), true); + new SwRangeRedline(RedlineType::Insert, aPam), true); } else { @@ -3123,7 +3123,7 @@ bool DocumentContentOperationsManager::AppendTextNode( SwPosition& rPos ) aPam.SetMark(); aPam.Move( fnMoveBackward ); if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) - m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); + m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aPam ), true); else m_rDoc.getIDocumentRedlineAccess().SplitRedline( aPam ); } @@ -3697,7 +3697,7 @@ bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa std::vector<SwRangeRedline*> redlines; { - auto pRedline(std::make_unique<SwRangeRedline>(nsRedlineType_t::REDLINE_DELETE, rPam)); + auto pRedline(std::make_unique<SwRangeRedline>(RedlineType::Delete, rPam)); if (pRedline->HasValidRange()) { redlines.push_back(pRedline.release()); @@ -3934,7 +3934,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam) } if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) - m_rDoc.getIDocumentRedlineAccess().DeleteRedline( rPam, true, USHRT_MAX ); + m_rDoc.getIDocumentRedlineAccess().DeleteRedline( rPam, true, RedlineType::Any ); // Delete and move all "Flys at the paragraph", which are within the Selection DelFlyInRange(rPam.GetMark()->nNode, rPam.GetPoint()->nNode); @@ -4166,7 +4166,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt m_rDoc.GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoRedlineDelete>( aDelPam, SwUndoId::REPLACE )); } - m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, aDelPam ), true); + m_rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Delete, aDelPam ), true); *rPam.GetMark() = *aDelPam.GetMark(); if (m_rDoc.GetIDocumentUndoRedo().DoesUndo()) @@ -4203,7 +4203,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt "invalid range: Point and Mark on different nodes" ); if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) - m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aDelPam, true, USHRT_MAX ); + m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aDelPam, true, RedlineType::Any ); SwUndoReplace* pUndoRpl = nullptr; bool const bDoesUndo = m_rDoc.GetIDocumentUndoRedo().DoesUndo(); diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index c9c1d34157b8..c66b4ddd22a1 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -70,7 +70,7 @@ namespace sw rTextField.GetStart()); SwRangeRedline const*const pRedline(rIDRA.GetRedline(pos, &tmp)); return (pRedline - && pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE + && pRedline->GetType() == RedlineType::Delete && *pRedline->GetPoint() != *pRedline->GetMark()); } } diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index ed2ac2d9cbe3..47fc8db4db05 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -313,8 +313,8 @@ namespace switch( pRedl->GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Insert: + case RedlineType::Format: { bool bCheck = false, bReplace = false; switch( eCmp ) @@ -363,7 +363,7 @@ namespace } } break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: { SwDoc& rDoc = *pRedl->GetDoc(); const SwPosition *pDelStt = nullptr, *pDelEnd = nullptr; @@ -440,11 +440,11 @@ namespace } break; - case nsRedlineType_t::REDLINE_FMTCOLL: + case RedlineType::FmtColl: rArr.DeleteAndDestroy( rPos-- ); break; - case nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT: + case RedlineType::ParagraphFormat: rArr.DeleteAndDestroy( rPos-- ); break; @@ -475,7 +475,7 @@ namespace switch( pRedl->GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: { const SwPosition *pDelStt = nullptr, *pDelEnd = nullptr; bool bDelRedl = false; @@ -551,7 +551,7 @@ namespace delete pRedl; } break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: { SwRangeRedline* pNew = nullptr; bool bCheck = false, bReplace = false; @@ -645,8 +645,8 @@ namespace } break; - case nsRedlineType_t::REDLINE_FORMAT: - case nsRedlineType_t::REDLINE_FMTCOLL: + case RedlineType::Format: + case RedlineType::FmtColl: { if( pRedl->GetExtraData() ) pRedl->GetExtraData()->Reject( *pRedl ); @@ -656,7 +656,7 @@ namespace // original state of the text (FIXME if the original text // has already contained direct text formatting: unfortunately // ODF 1.2 doesn't support rejection of format-only changes) - if ( pRedl->GetType() == nsRedlineType_t::REDLINE_FORMAT ) + if ( pRedl->GetType() == RedlineType::Format ) { SwPaM aPam( *(pRedl->Start()), *(pRedl->End()) ); rArr.DeleteAndDestroy( rPos-- ); @@ -710,7 +710,7 @@ namespace { if( *pTmp->End() <= *pEnd ) { - if( (m > 0 || nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT == pTmp->GetType()) && + if( (m > 0 || RedlineType::ParagraphFormat == pTmp->GetType()) && (*fn_AcceptReject)( rArr, o, bCallDelete, nullptr, nullptr )) { bHasParagraphFormatChange = true; @@ -722,7 +722,7 @@ namespace if( *pTmp->Start() < *pEnd ) { // Only revoke the partial selection - if( (m > 0 || nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT == pTmp->GetType()) && + if( (m > 0 || RedlineType::ParagraphFormat == pTmp->GetType()) && (*fn_AcceptReject)( rArr, o, bCallDelete, pStt, pEnd )) { bHasParagraphFormatChange = true; @@ -1001,7 +1001,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall if( m_rDoc.IsAutoFormatRedline() ) { - pNewRedl->SetAutoFormatFlag(); + pNewRedl->SetAutoFormat(); if( mpAutoFormatRedlnComment && !mpAutoFormatRedlnComment->isEmpty() ) { pNewRedl->SetComment( *mpAutoFormatRedlnComment ); @@ -1082,10 +1082,10 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall switch( pNewRedl->GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: switch( pRedl->GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: if( pRedl->IsOwnRedline( *pNewRedl ) ) { bool bDelete = false; @@ -1222,7 +1222,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } } break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: if( SwComparePosition::Inside == eCmpPos ) { // split up @@ -1276,7 +1276,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pNewRedl->SetStart( *pREnd ); } break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: switch( eCmpPos ) { case SwComparePosition::OverlapBefore: @@ -1333,10 +1333,10 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: switch( pRedl->GetType() ) { - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: switch( eCmpPos ) { case SwComparePosition::Outside: @@ -1436,7 +1436,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } break; - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: { // b62341295: Do not throw away redlines // even if they are not allowed to be combined @@ -1709,7 +1709,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: switch( eCmpPos ) { case SwComparePosition::OverlapBefore: @@ -1762,11 +1762,11 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: switch( pRedl->GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Insert: + case RedlineType::Delete: switch( eCmpPos ) { case SwComparePosition::OverlapBefore: @@ -1805,7 +1805,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall break; } break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: switch( eCmpPos ) { case SwComparePosition::Outside: @@ -1905,7 +1905,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } break; - case nsRedlineType_t::REDLINE_FMTCOLL: + case RedlineType::FmtColl: // How should we behave here? // insert as is break; @@ -1924,7 +1924,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } else { - if ( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() ) + if ( bCallDelete && RedlineType::Delete == pNewRedl->GetType() ) { if ( pStt->nContent == 0 ) { @@ -1974,7 +1974,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } else { - if( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() ) + if( bCallDelete && RedlineType::Delete == pNewRedl->GetType() ) { RedlineFlags eOld = meRedlineFlags; // Set to NONE, so that the Delete::Redo merges the Redline data correctly! @@ -2015,7 +2015,7 @@ bool DocumentRedlineManager::AppendTableRowRedline( SwTableRowRedline* pNewRedl, { // TO DO - equivalent for 'SwTableRowRedline' /* - if( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() ) + if( bCallDelete && RedlineType::Delete == pNewRedl->GetType() ) { RedlineFlags eOld = meRedlineFlags; // Set to NONE, so that the Delete::Redo merges the Redline data correctly! @@ -2057,7 +2057,7 @@ bool DocumentRedlineManager::AppendTableCellRedline( SwTableCellRedline* pNewRed { // TO DO - equivalent for 'SwTableCellRedline' /* - if( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() ) + if( bCallDelete && RedlineType::Delete == pNewRedl->GetType() ) { RedlineFlags eOld = meRedlineFlags; // Set to NONE, so that the Delete::Redo merges the Redline data correctly! @@ -2184,7 +2184,7 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) } bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo, - sal_uInt16 nDelType ) + RedlineType nDelType ) { if( !rRange.HasMark() || *rRange.GetMark() == *rRange.GetPoint() ) return false; @@ -2208,7 +2208,7 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd for( ; n < mpRedlineTable->size() ; ++n ) { SwRangeRedline* pRedl = (*mpRedlineTable)[ n ]; - if( USHRT_MAX != nDelType && nDelType != pRedl->GetType() ) + if( RedlineType::Any != nDelType && nDelType != pRedl->GetType() ) continue; SwPosition* pRStt = pRedl->Start(), @@ -2303,13 +2303,13 @@ bool DocumentRedlineManager::DeleteRedline( const SwPaM& rRange, bool bSaveInUnd } bool DocumentRedlineManager::DeleteRedline( const SwStartNode& rNode, bool bSaveInUndo, - sal_uInt16 nDelType ) + RedlineType nDelType ) { SwPaM aTemp(*rNode.EndOfSectionNode(), rNode); return DeleteRedline(aTemp, bSaveInUndo, nDelType); } -SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& rNd, sal_uInt16 nType ) const +SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& rNd, RedlineType nType ) const { const sal_uLong nNdIdx = rNd.GetIndex(); for( SwRedlineTable::size_type n = 0; n < mpRedlineTable->size() ; ++n ) @@ -2319,7 +2319,7 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r nMk = pTmp->GetMark()->nNode.GetIndex(); if( nPt < nMk ) { long nTmp = nMk; nMk = nPt; nPt = nTmp; } - if( ( USHRT_MAX == nType || nType == pTmp->GetType()) && + if( ( RedlineType::Any == nType || nType == pTmp->GetType()) && nMk <= nNdIdx && nNdIdx <= nPt ) return n; @@ -2360,18 +2360,18 @@ const SwRangeRedline* DocumentRedlineManager::GetRedline( const SwPosition& rPos // show insert change first. // since the redlines are sorted by position, only check the redline // before and after the current redline - if( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() ) + if( RedlineType::Format == pRedl->GetType() ) { if( nM && rPos >= *(*mpRedlineTable)[ nM - 1 ]->Start() && rPos <= *(*mpRedlineTable)[ nM - 1 ]->End() && - ( nsRedlineType_t::REDLINE_INSERT == (*mpRedlineTable)[ nM - 1 ]->GetType() ) ) + ( RedlineType::Insert == (*mpRedlineTable)[ nM - 1 ]->GetType() ) ) { --nM; pRedl = (*mpRedlineTable)[ nM ]; } else if( ( nM + 1 ) <= nO && rPos >= *(*mpRedlineTable)[ nM + 1 ]->Start() && rPos <= *(*mpRedlineTable)[ nM + 1 ]->End() && - ( nsRedlineType_t::REDLINE_INSERT == (*mpRedlineTable)[ nM + 1 ]->GetType() ) ) + ( RedlineType::Insert == (*mpRedlineTable)[ nM + 1 ]->GetType() ) ) { ++nM; pRedl = (*mpRedlineTable)[ nM ]; @@ -2534,7 +2534,7 @@ void DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam nMk = pTmp->GetMark()->nNode.GetIndex(); if( nPt < nMk ) { long nTmp = nMk; nMk = nPt; nPt = nTmp; } - if( nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT == pTmp->GetType() && + if( RedlineType::ParagraphFormat == pTmp->GetType() && ( (nSttIdx <= nMk && nMk <= nEndIdx) || (nSttIdx <= nPt && nPt <= nEndIdx) ) ) AcceptRedline( n, false ); @@ -3025,7 +3025,7 @@ void DocumentRedlineManager::FinalizeImport() for( SwRedlineTable::size_type n = 0; n < mpRedlineTable->size(); ++n ) { SwRangeRedline* pRedl = (*mpRedlineTable)[ n ]; - if ( nsRedlineType_t::REDLINE_DELETE == pRedl->GetType() ) + if ( RedlineType::Delete == pRedl->GetType() ) { const SwPosition* pStt = pRedl->Start(), * pEnd = pStt == pRedl->GetPoint() diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index e46f0d9aa5f7..4d40ae43ae33 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1643,7 +1643,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo ) if( pTmp ) { - SwRedlineData aRedlnData( nsRedlineType_t::REDLINE_DELETE, nAuthor, aTimeStamp, + SwRedlineData aRedlnData( RedlineType::Delete, nAuthor, aTimeStamp, OUString(), nullptr ); do { // #i65201#: Expand again, see comment above. @@ -1674,7 +1674,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo ) } } - rDoc.getIDocumentRedlineAccess().DeleteRedline( *pTmp, false, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( *pTmp, false, RedlineType::Any ); if (rDoc.GetIDocumentUndoRedo().DoesUndo()) { @@ -1717,7 +1717,7 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo ) } } } while( pInsRing.get() != ( pTmp = pTmp->GetNext()) ); - SwRedlineData aRedlnData( nsRedlineType_t::REDLINE_INSERT, nAuthor, aTimeStamp, + SwRedlineData aRedlnData( RedlineType::Insert, nAuthor, aTimeStamp, OUString(), nullptr ); // combine consecutive @@ -1903,7 +1903,7 @@ SaveMergeRedline::SaveMergeRedline( const SwNode& rDstNd, aPos.nContent.Assign( const_cast<SwContentNode*>(static_cast<const SwContentNode*>(&rDstNd)), pStt->nContent.GetIndex() ); pDestRedl = new SwRangeRedline( rSrcRedl.GetRedlineData(), aPos ); - if( nsRedlineType_t::REDLINE_DELETE == pDestRedl->GetType() ) + if( RedlineType::Delete == pDestRedl->GetType() ) { // mark the area as deleted const SwPosition* pEnd = pStt == rSrcRedl.GetPoint() @@ -1923,7 +1923,7 @@ sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline) sal_uInt16 nIns = 0; SwDoc* pDoc = pDestRedl->GetDoc(); - if( nsRedlineType_t::REDLINE_INSERT == pDestRedl->GetType() ) + if( RedlineType::Insert == pDestRedl->GetType() ) { // the part was inserted so copy it from the SourceDoc ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); @@ -1968,8 +1968,8 @@ sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline) SwPosition* pRStt = pRedl->Start(), * pREnd = pRStt == pRedl->GetPoint() ? pRedl->GetMark() : pRedl->GetPoint(); - if( nsRedlineType_t::REDLINE_DELETE == pRedl->GetType() || - nsRedlineType_t::REDLINE_INSERT == pRedl->GetType() ) + if( RedlineType::Delete == pRedl->GetType() || + RedlineType::Insert == pRedl->GetType() ) { SwComparePosition eCmpPos = ComparePosition( *pDStt, *pDEnd, *pRStt, *pREnd ); switch( eCmpPos ) @@ -2087,9 +2087,9 @@ long SwDoc::MergeDoc( const SwDoc& rDoc ) for(const SwRangeRedline* pRedl : rSrcRedlTable) { sal_uLong nNd = pRedl->GetPoint()->nNode.GetIndex(); - RedlineType_t eType = pRedl->GetType(); + RedlineType eType = pRedl->GetType(); if( nEndOfExtra < nNd && - ( nsRedlineType_t::REDLINE_INSERT == eType || nsRedlineType_t::REDLINE_DELETE == eType )) + ( RedlineType::Insert == eType || RedlineType::Delete == eType )) { const SwNode* pDstNd = GetNodes()[ nMyEndOfExtra + nNd - nEndOfExtra ]; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 392bb4fc5008..5bd36426a600 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1781,7 +1781,7 @@ void SwDoc::SetTextFormatCollByAutoFormat( const SwPosition& rPos, sal_uInt16 nP { // create the redline object const SwTextFormatColl& rColl = *pTNd->GetTextColl(); - SwRangeRedline* pRedl = new SwRangeRedline( nsRedlineType_t::REDLINE_FMTCOLL, aPam ); + SwRangeRedline* pRedl = new SwRangeRedline( RedlineType::FmtColl, aPam ); pRedl->SetMark(); // Only those items that are not set by the Set again in the Node @@ -1828,7 +1828,7 @@ void SwDoc::SetFormatItemByAutoFormat( const SwPaM& rPam, const SfxItemSet& rSet if (mbIsAutoFormatRedline) { // create the redline object - SwRangeRedline* pRedl = new SwRangeRedline( nsRedlineType_t::REDLINE_FORMAT, rPam ); + SwRangeRedline* pRedl = new SwRangeRedline( RedlineType::Format, rPam ); if( !pRedl->HasMark() ) pRedl->SetMark(); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index ad013e8c5744..8138a5197bdd 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2044,7 +2044,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, // Test for Redlining - Can the Selection be moved at all, actually? if( !getIDocumentRedlineAccess().IsIgnoreRedline() ) { - SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_DELETE ); + SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStt->nNode.GetNode(), RedlineType::Delete ); if( SwRedlineTable::npos != nRedlPos ) { SwPosition aStPos( *pStt ), aEndPos( *pEnd ); @@ -2057,7 +2057,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, for( ; nRedlPos < getIDocumentRedlineAccess().GetRedlineTable().size(); ++nRedlPos ) { const SwRangeRedline* pTmp = getIDocumentRedlineAccess().GetRedlineTable()[ nRedlPos ]; - if( !bCheckDel || nsRedlineType_t::REDLINE_DELETE == pTmp->GetType() ) + if( !bCheckDel || RedlineType::Delete == pTmp->GetType() ) { const SwPosition *pRStt = pTmp->Start(), *pREnd = pTmp->End(); switch( ComparePosition( *pRStt, *pREnd, aStPos, aEndPos )) @@ -2101,12 +2101,12 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, if( getIDocumentRedlineAccess().IsRedlineOn() ) { // If the range is completely in the own Redline, we can move it! - SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_INSERT ); + SwRedlineTable::size_type nRedlPos = getIDocumentRedlineAccess().GetRedlinePos( pStt->nNode.GetNode(), RedlineType::Insert ); if( SwRedlineTable::npos != nRedlPos ) { SwRangeRedline* pTmp = getIDocumentRedlineAccess().GetRedlineTable()[ nRedlPos ]; const SwPosition *pRStt = pTmp->Start(), *pREnd = pTmp->End(); - SwRangeRedline aTmpRedl( nsRedlineType_t::REDLINE_INSERT, rPam ); + SwRangeRedline aTmpRedl( RedlineType::Insert, rPam ); const SwContentNode* pCEndNd = pEnd->nNode.GetNode().GetContentNode(); // Is completely in the range and is the own Redline too? if( aTmpRedl.IsOwnRedline( *pTmp ) && @@ -2198,7 +2198,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, { break; } - if (pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + if (pRedline->GetType() == RedlineType::Delete) { assert(*aPam.Start() <= *pRedline->Start()); // caller's fault SwRangeRedline* pNewRedline; @@ -2211,7 +2211,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, pam.GetMark()->nNode += nCurrentOffset; pam.GetMark()->nContent.Assign(pam.GetMark()->nNode.GetNode().GetContentNode(), pam.GetMark()->nContent.GetIndex()); - pNewRedline = new SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, pam ); + pNewRedline = new SwRangeRedline( RedlineType::Delete, pam ); } // note: effectively this will DeleteAndJoin the pam! getIDocumentRedlineAccess().AppendRedline(pNewRedline, true); @@ -2272,7 +2272,7 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, std::make_unique<SwUndoRedlineDelete>(aPam, SwUndoId::DELETE)); } - SwRangeRedline* pNewRedline = new SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, aPam ); + SwRangeRedline* pNewRedline = new SwRangeRedline( RedlineType::Delete, aPam ); // prevent assertion from aPam's target being deleted // (Alternatively, one could just let aPam go out of scope, but diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 986b48e48de2..6a1183a832cc 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -134,7 +134,7 @@ static bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd ) } #endif -bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rTable, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete ) +bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rTable, bool bSaveInUndo, RedlineType nRedlineTypeToDelete ) { bool bChg = false; @@ -164,10 +164,10 @@ bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rT { // Redline for this table const SwRedlineData& aRedlineData = pTableCellRedline->GetRedlineData(); - const RedlineType_t nRedlineType = aRedlineData.GetType(); + const RedlineType nRedlineType = aRedlineData.GetType(); // Check if this redline object type should be deleted - if (USHRT_MAX == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType) + if (RedlineType::Any == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType) { DeleteAndDestroy( nCurRedlinePos ); @@ -188,10 +188,10 @@ bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rT { // Redline for this table const SwRedlineData& aRedlineData = pTableRowRedline->GetRedlineData(); - const RedlineType_t nRedlineType = aRedlineData.GetType(); + const RedlineType nRedlineType = aRedlineData.GetType(); // Check if this redline object type should be deleted - if (USHRT_MAX == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType) + if (RedlineType::Any == nRedlineTypeToDelete || nRedlineTypeToDelete == nRedlineType) { DeleteAndDestroy( nCurRedlinePos ); @@ -210,7 +210,7 @@ bool SwExtraRedlineTable::DeleteAllTableRedlines( SwDoc* pDoc, const SwTable& rT return bChg; } -bool SwExtraRedlineTable::DeleteTableRowRedline( SwDoc* pDoc, const SwTableLine& rTableLine, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete ) +bool SwExtraRedlineTable::DeleteTableRowRedline( SwDoc* pDoc, const SwTableLine& rTableLine, bool bSaveInUndo, RedlineType nRedlineTypeToDelete ) { bool bChg = false; @@ -237,10 +237,10 @@ bool SwExtraRedlineTable::DeleteTableRowRedline( SwDoc* pDoc, const SwTableLine& { // Redline for this table row const SwRedlineData& aRedlineData = pTableRowRedline->GetRedlineData(); - const RedlineType_t nRedlineType = aRedlineData.GetType(); + const RedlineType nRedlineType = aRedlineData.GetType(); // Check if this redline object type should be deleted - if( USHRT_MAX != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType ) + if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType ) continue; DeleteAndDestroy( nCurRedlinePos ); @@ -254,7 +254,7 @@ bool SwExtraRedlineTable::DeleteTableRowRedline( SwDoc* pDoc, const SwTableLine& return bChg; } -bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& rTableBox, bool bSaveInUndo, sal_uInt16 nRedlineTypeToDelete ) +bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& rTableBox, bool bSaveInUndo, RedlineType nRedlineTypeToDelete ) { bool bChg = false; @@ -281,10 +281,10 @@ bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& { // Redline for this table cell const SwRedlineData& aRedlineData = pTableCellRedline->GetRedlineData(); - const RedlineType_t nRedlineType = aRedlineData.GetType(); + const RedlineType nRedlineType = aRedlineData.GetType(); // Check if this redline object type should be deleted - if( USHRT_MAX != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType ) + if( RedlineType::Any != nRedlineTypeToDelete && nRedlineTypeToDelete != nRedlineType ) continue; DeleteAndDestroy( nCurRedlinePos ); @@ -362,7 +362,7 @@ void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRe (nType == RedlineNotification::Modify ? "Modify" : "???")))); aRedline.put("index", pRedline->GetId()); aRedline.put("author", pRedline->GetAuthorString(1).toUtf8().getStr()); - aRedline.put("type", nsRedlineType_t::SwRedlineTypeToOUString(pRedline->GetRedlineData().GetType()).toUtf8().getStr()); + aRedline.put("type", SwRedlineTypeToOUString(pRedline->GetRedlineData().GetType()).toUtf8().getStr()); aRedline.put("comment", pRedline->GetRedlineData().GetComment().toUtf8().getStr()); aRedline.put("description", pRedline->GetDescr().toUtf8().getStr()); OUString sDateTime = utl::toISO8601(pRedline->GetRedlineData().GetTimeStamp().GetUNODateTime()); @@ -935,7 +935,7 @@ bool SwRedlineExtraData_FormattingChanges::operator == ( const SwRedlineExtraDat return false; } -SwRedlineData::SwRedlineData( RedlineType_t eT, std::size_t nAut ) +SwRedlineData::SwRedlineData( RedlineType eT, std::size_t nAut ) : m_pNext( nullptr ), m_pExtraData( nullptr ), m_aStamp( DateTime::SYSTEM ), m_eType( eT ), m_nAuthor( nAut ), m_nSeqNo( 0 ) @@ -957,7 +957,7 @@ SwRedlineData::SwRedlineData( } // For sw3io: We now own pNext! -SwRedlineData::SwRedlineData(RedlineType_t eT, std::size_t nAut, const DateTime& rDT, +SwRedlineData::SwRedlineData(RedlineType eT, std::size_t nAut, const DateTime& rDT, const OUString& rCmnt, SwRedlineData *pNxt) : m_pNext(pNxt), m_pExtraData(nullptr), m_sComment(rCmnt), m_aStamp(rDT), m_eType(eT), m_nAuthor(nAut), m_nSeqNo(0) @@ -1017,12 +1017,12 @@ static const char* STR_REDLINE_ARY[] = OUString SwRedlineData::GetDescr() const { - return SwResId(STR_REDLINE_ARY[GetType()]); + return SwResId(STR_REDLINE_ARY[static_cast<int>(GetType())]); } sal_uInt32 SwRangeRedline::m_nLastId = 1; -SwRangeRedline::SwRangeRedline(RedlineType_t eTyp, const SwPaM& rPam ) +SwRangeRedline::SwRangeRedline(RedlineType eTyp, const SwPaM& rPam ) : SwPaM( *rPam.GetMark(), *rPam.GetPoint() ), m_pRedlineData( new SwRedlineData( eTyp, GetDoc()->getIDocumentRedlineAccess().GetRedlineAuthor() ) ), m_pContentSect( nullptr ), @@ -1162,18 +1162,18 @@ void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos) switch( GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: // Content has been inserted + case RedlineType::Insert: // Content has been inserted m_bIsVisible = true; MoveFromSection(nMyPos); break; - case nsRedlineType_t::REDLINE_DELETE: // Content has been deleted + case RedlineType::Delete: // Content has been deleted m_bIsVisible = true; MoveFromSection(nMyPos); break; - case nsRedlineType_t::REDLINE_FORMAT: // Attributes have been applied - case nsRedlineType_t::REDLINE_TABLE: // Table structure has been modified + case RedlineType::Format: // Attributes have been applied + case RedlineType::Table: // Table structure has been modified InvalidateRange(Invalidation::Add); break; default: @@ -1192,13 +1192,13 @@ void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos) switch( GetType() ) { - case nsRedlineType_t::REDLINE_INSERT: // Content has been inserted + case RedlineType::Insert: // Content has been inserted m_bIsVisible = true; if( 1 <= nLoop ) MoveFromSection(nMyPos); break; - case nsRedlineType_t::REDLINE_DELETE: // Content has been deleted + case RedlineType::Delete: // Content has been deleted m_bIsVisible = false; switch( nLoop ) { @@ -1208,8 +1208,8 @@ void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos) } break; - case nsRedlineType_t::REDLINE_FORMAT: // Attributes have been applied - case nsRedlineType_t::REDLINE_TABLE: // Table structure has been modified + case RedlineType::Format: // Attributes have been applied + case RedlineType::Table: // Table structure has been modified if( 1 <= nLoop ) InvalidateRange(Invalidation::Remove); break; @@ -1234,7 +1234,7 @@ void SwRangeRedline::ShowOriginal(sal_uInt16 nLoop, size_t nMyPos) switch( pCur->m_eType ) { - case nsRedlineType_t::REDLINE_INSERT: // Content has been inserted + case RedlineType::Insert: // Content has been inserted m_bIsVisible = false; switch( nLoop ) { @@ -1244,14 +1244,14 @@ void SwRangeRedline::ShowOriginal(sal_uInt16 nLoop, size_t nMyPos) } break; - case nsRedlineType_t::REDLINE_DELETE: // Content has been deleted + case RedlineType::Delete: // Content has been deleted m_bIsVisible = true; if( 1 <= nLoop ) MoveFromSection(nMyPos); break; - case nsRedlineType_t::REDLINE_FORMAT: // Attributes have been applied - case nsRedlineType_t::REDLINE_TABLE: // Table structure has been modified + case RedlineType::Format: // Attributes have been applied + case RedlineType::Table: // Table structure has been modified if( 1 <= nLoop ) InvalidateRange(Invalidation::Remove); break; @@ -1292,7 +1292,7 @@ void SwRangeRedline::InvalidateRange(Invalidation const eWhy) pNd->ModifyNotification(&aHt, &aHt); // SwUpdateAttr must be handled first, otherwise indexes are off - if (GetType() == nsRedlineType_t::REDLINE_DELETE) + if (GetType() == RedlineType::Delete) { sal_Int32 const nStart(n == nSttNd ? nSttCnt : 0); sal_Int32 const nLen((n == nEndNd ? nEndCnt : pNd->GetText().getLength()) - nStart); @@ -1776,7 +1776,7 @@ const DateTime& SwRangeRedline::GetTimeStamp( sal_uInt16 nPos ) const return GetRedlineData(nPos).m_aStamp; } -RedlineType_t SwRangeRedline::GetRealType( sal_uInt16 nPos ) const +RedlineType SwRangeRedline::GetType( sal_uInt16 nPos ) const { return GetRedlineData(nPos).m_eType; } @@ -1870,13 +1870,13 @@ void SwRangeRedline::dumpAsXml(xmlTextWriterPtr pWriter) const OString sRedlineType; switch (GetType()) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: sRedlineType = "REDLINE_INSERT"; break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: sRedlineType = "REDLINE_DELETE"; break; - case nsRedlineType_t::REDLINE_FORMAT: + case RedlineType::Format: sRedlineType = "REDLINE_FORMAT"; break; default: diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 1be8ffa88358..20e956187aed 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -346,7 +346,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) GetNodes().Copy_( aRg, aEndIdx ); // range is new from pEnd->nNode+1 to aEndIdx - getIDocumentRedlineAccess().DeleteRedline( *pRedlPam, true, USHRT_MAX ); + getIDocumentRedlineAccess().DeleteRedline( *pRedlPam, true, RedlineType::Any ); pRedlPam->GetMark()->nNode.Assign( pEnd->nNode.GetNode(), 1 ); pCNd = pRedlPam->GetContentNode( false ); @@ -368,7 +368,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) } else { - getIDocumentRedlineAccess().DeleteRedline( *pRedlPam, true, USHRT_MAX ); + getIDocumentRedlineAccess().DeleteRedline( *pRedlPam, true, RedlineType::Any ); delete pRedlPam; pRedlPam = nullptr; } @@ -434,7 +434,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) // the copied range is deleted SwRangeRedline *const pDeleteRedline( - new SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, *pRedlPam )); + new SwRangeRedline( RedlineType::Delete, *pRedlPam )); // pRedlPam points to nodes that may be deleted (hidden) by // AppendRedline, so adjust it beforehand to prevent ASSERT @@ -445,7 +445,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) getIDocumentRedlineAccess().AppendRedline(pDeleteRedline, true); // the sorted range is inserted - getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, *pRedlPam ), true); + getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, *pRedlPam ), true); if( pRedlUndo ) { @@ -491,7 +491,7 @@ bool SwDoc::SortTable(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) return false; if( !getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTable().empty() ) - getIDocumentRedlineAccess().DeleteRedline( *pTableNd, true, USHRT_MAX ); + getIDocumentRedlineAccess().DeleteRedline( *pTableNd, true, RedlineType::Any ); FndLines_t::size_type nStart = 0; if( pTableNd->GetTable().GetRowsToRepeat() > 0 && rOpt.eDirection == SRT_ROWS ) diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 13ca079c2804..9a01f4da776c 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -916,7 +916,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, SwUndoUpdateIndex * pUndo(nullptr); { - pDoc->getIDocumentRedlineAccess().DeleteRedline( *pSectNd, true, USHRT_MAX ); + pDoc->getIDocumentRedlineAccess().DeleteRedline( *pSectNd, true, RedlineType::Any ); SwNodeIndex aSttIdx( *pSectNd, +1 ); SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() ); diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx index 41831272a534..37ac0e0286d5 100644 --- a/sw/source/core/doc/ftnidx.cxx +++ b/sw/source/core/doc/ftnidx.cxx @@ -42,7 +42,7 @@ bool IsFootnoteDeleted(IDocumentRedlineAccess const& rIDRA, rTextFootnote.GetStart()); SwRangeRedline const*const pRedline(rIDRA.GetRedline(pos, &tmp)); return (pRedline - && pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE + && pRedline->GetType() == RedlineType::Delete && *pRedline->GetPoint() != *pRedline->GetMark()); } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index b414d65847f7..1084e4c77475 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -718,7 +718,7 @@ void DeleteBox_( SwTable& rTable, SwTableBox* pBox, SwUndo* pUndo, // Before deleting the 'Table Box' from memory - delete any redlines attached to it if ( rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().HasExtraRedlineTable() ) - rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteTableCellRedline( rTable.GetFrameFormat()->GetDoc(), *(rTableBoxes[nDelPos]), true, USHRT_MAX ); + rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteTableCellRedline( rTable.GetFrameFormat()->GetDoc(), *(rTableBoxes[nDelPos]), true, RedlineType::Any ); delete rTableBoxes[nDelPos]; rTableBoxes.erase( rTableBoxes.begin() + nDelPos ); @@ -771,7 +771,7 @@ void DeleteBox_( SwTable& rTable, SwTableBox* pBox, SwUndo* pUndo, SwTableLine* pTabLineToDelete = rTable.GetTabLines()[ nDelPos ]; // Before deleting the 'Table Line' from memory - delete any redlines attached to it if ( rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().HasExtraRedlineTable() ) - rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteTableRowRedline( rTable.GetFrameFormat()->GetDoc(), *pTabLineToDelete, true, USHRT_MAX ); + rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteTableRowRedline( rTable.GetFrameFormat()->GetDoc(), *pTabLineToDelete, true, RedlineType::Any ); delete pTabLineToDelete; rTable.GetTabLines().erase( rTable.GetTabLines().begin() + nDelPos ); break; // we cannot delete more @@ -786,7 +786,7 @@ void DeleteBox_( SwTable& rTable, SwTableBox* pBox, SwUndo* pUndo, SwTableLine* pTabLineToDelete = pBox->GetTabLines()[ nDelPos ]; // Before deleting the 'Table Line' from memory - delete any redlines attached to it if ( rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().HasExtraRedlineTable() ) - rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteTableRowRedline( rTable.GetFrameFormat()->GetDoc(), *pTabLineToDelete, true, USHRT_MAX ); + rTable.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteTableRowRedline( rTable.GetFrameFormat()->GetDoc(), *pTabLineToDelete, true, RedlineType::Any ); delete pTabLineToDelete; pBox->GetTabLines().erase( pBox->GetTabLines().begin() + nDelPos ); } while( pBox->GetTabLines().empty() ); diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 16c26f4befa1..641c074c618c 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -329,7 +329,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, SwPaM aPam( *pNewSectNode->EndOfSectionNode(), *pNewSectNode, 1 ); if( getIDocumentRedlineAccess().IsRedlineOn() ) { - getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); + getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aPam ), true); } else { diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index b86b2f52d9f2..e71fb003bf9f 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -547,7 +547,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, { SwPaM aPam( *pTableNd->EndOfSectionNode(), *pTableNd, 1 ); if( getIDocumentRedlineAccess().IsRedlineOn() ) - getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); + getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aPam ), true); else getIDocumentRedlineAccess().SplitRedline( aPam ); } @@ -2472,7 +2472,7 @@ void SwTableNode::RemoveRedlines() { SwTable& rTable = GetTable(); if ( pDoc->getIDocumentRedlineAccess().HasExtraRedlineTable() ) - pDoc->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteAllTableRedlines( pDoc, rTable, true, USHRT_MAX ); + pDoc->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteAllTableRedlines( pDoc, rTable, true, RedlineType::Any ); } } diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index f39616624c36..c2fbfef86d82 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1147,7 +1147,7 @@ bool GetRanges(std::vector<std::shared_ptr<SwUnoCursor>> & rRanges, { continue; } - if (pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + if (pRedline->GetType() == RedlineType::Delete) { assert(*pRedline->Start() != *pRedline->End()); isNoRedline = false; diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index 41ea8139b11a..8375bddaf445 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -102,7 +102,7 @@ static void lcl_disableShowChangesIfNeeded( SwDoc *const pDoc, const SwNode& rNo { if ( IDocumentRedlineAccess::IsShowChanges(eRedlMode) && // is there redlining at beginning of the position (possible redline block before the modified node) - pDoc->getIDocumentRedlineAccess().GetRedlinePos( rNode, USHRT_MAX ) < + pDoc->getIDocumentRedlineAccess().GetRedlinePos( rNode, RedlineType::Any ) < pDoc->getIDocumentRedlineAccess().GetRedlineTable().size() ) { eRedlMode = RedlineFlags::ShowInsert | RedlineFlags::Ignore; diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index ab31bef2be55..4df464ee49ed 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -2206,7 +2206,7 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, // ie. in all directly preceding deleted paragraphs at the actual cursor positions if ( IDocumentRedlineAccess::IsShowChanges(eRedlMode) && // is there redlining at beginning of the position (possible redline block before the modified node) - GetDoc()->getIDocumentRedlineAccess().GetRedlinePos( (*rPaM.Start()).nNode.GetNode(), USHRT_MAX ) < + GetDoc()->getIDocumentRedlineAccess().GetRedlinePos( (*rPaM.Start()).nNode.GetNode(), RedlineType::Any ) < GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size() ) { eRedlMode = RedlineFlags::ShowInsert | RedlineFlags::Ignore; diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index c533e8013575..335041745d0b 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1228,7 +1228,7 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell const * pSh) const SwPosition* pStartPos = pCursor->Start(); const SwTextNode* pTextNode = pCursor->GetNode().GetTextNode(); - SwRedlineTable::size_type nAct = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *pTextNode, USHRT_MAX ); + SwRedlineTable::size_type nAct = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *pTextNode, RedlineType::Any ); const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex(); for ( ; nAct < pDoc->getIDocumentRedlineAccess().GetRedlineTable().size(); nAct++ ) { @@ -1237,7 +1237,7 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell const * pSh) if ( pRed->Start()->nNode > pTextNode->GetIndex() ) break; - if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() ) + if( RedlineType::Delete == pRed->GetType() ) { sal_Int32 nStart_, nEnd_; pRed->CalcStartEnd( pTextNode->GetIndex(), nStart_, nEnd_ ); diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 8b276678a3d7..dde8d8dcaecf 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -89,9 +89,9 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( const SwRangeRedline* pRedline = rIDRA.GetRedline( rAnchorPos, nullptr ); if( pRedline ) { - if( nsRedlineType_t::REDLINE_INSERT == pRedline->GetType() ) + if( RedlineType::Insert == pRedline->GetType() ) aRet = INSERTED; - else if( nsRedlineType_t::REDLINE_DELETE == pRedline->GetType() ) + else if( RedlineType::Delete == pRedline->GetType() ) aRet = DELETED; o_rInfo.mRedlineAuthor = pRedline->GetAuthor(); } diff --git a/sw/source/core/inc/DocumentRedlineManager.hxx b/sw/source/core/inc/DocumentRedlineManager.hxx index 56ff92942de9..dd64f5511d12 100644 --- a/sw/source/core/inc/DocumentRedlineManager.hxx +++ b/sw/source/core/inc/DocumentRedlineManager.hxx @@ -65,16 +65,16 @@ public: virtual bool DeleteRedline( /*[in]*/const SwPaM& rPam, /*[in]*/bool bSaveInUndo, - /*[in]*/sal_uInt16 nDelType) override; + /*[in]*/RedlineType nDelType) override; virtual bool DeleteRedline( /*[in]*/const SwStartNode& rSection, /*[in]*/bool bSaveInUndo, - /*[in]*/sal_uInt16 nDelType) override; + /*[in]*/RedlineType nDelType) override; virtual SwRedlineTable::size_type GetRedlinePos( /*[in]*/const SwNode& rNode, - /*[in]*/sal_uInt16 nType) const override; + /*[in]*/RedlineType nType) const override; virtual void CompressRedlines() override; diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 2cfab46f988a..0526dfe5b2bd 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1465,7 +1465,7 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, // pathology: redline that starts on a TableNode; cannot // be created in UI but by import filters... if (pRedline - && pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE + && pRedline->GetType() == RedlineType::Delete && &pRedline->Start()->nNode.GetNode() == pNd) { SAL_WARN("sw.pageframe", "skipping table frame creation on bizarre redline"); diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 4e80de512c8b..55b9dfe32e4e 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -451,7 +451,7 @@ void SwTextFrame::RegisterToNode(SwTextNode & rNode, bool const isForceNodeAsFir { // nothing registered here, in particular no redlines assert(m_pMergedPara->pFirstNode->GetIndex() + 1 == rNode.GetIndex()); assert(rNode.GetDoc()->getIDocumentRedlineAccess().GetRedlinePos( - *m_pMergedPara->pFirstNode, USHRT_MAX) == SwRedlineTable::npos); + *m_pMergedPara->pFirstNode, RedlineType::Any) == SwRedlineTable::npos); } assert(&rNode != GetDep()); assert(!m_pMergedPara diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index b6014ddbd18c..c3e751f3b6f2 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -4395,7 +4395,7 @@ static void UnHideRedlines(SwRootFrame & rLayout, // pathology: redline that starts on a TableNode; cannot // be created in UI but by import filters... if (pRedline - && pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE + && pRedline->GetType() == RedlineType::Delete && &pRedline->Start()->nNode.GetNode() == &rNode) { for (sal_uLong j = rNode.GetIndex(); j <= rNode.EndOfSectionIndex(); ++j) @@ -4544,7 +4544,7 @@ void SwRootFrame::SetHideRedlines(bool const bHideRedlines) for (auto const pRedline : rDoc.getIDocumentRedlineAccess().GetRedlineTable()) { // DELETE are handled by the code above; for other types, need to // trigger repaint of text frames to add/remove the redline color font - if (pRedline->GetType() != nsRedlineType_t::REDLINE_DELETE) + if (pRedline->GetType() != RedlineType::Delete) { pRedline->InvalidateRange(SwRangeRedline::Invalidation::Add); } diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 337d712d95db..f550aed40da8 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2036,7 +2036,7 @@ void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) { SwPaM aTemp(*pTNd, 0, *pTNd, rOrig.getLength()); - pDoc->getIDocumentRedlineAccess().DeleteRedline(aTemp, true, USHRT_MAX); + pDoc->getIDocumentRedlineAccess().DeleteRedline(aTemp, true, RedlineType::Any); } // preserve comments inside of the number by deleting number portions starting from the back @@ -2061,7 +2061,7 @@ void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { SwPaM aTemp(*pTNd, 0, *pTNd, rText.getLength()); - pDoc->getIDocumentRedlineAccess().AppendRedline(new SwRangeRedline(nsRedlineType_t::REDLINE_INSERT, aTemp), true); + pDoc->getIDocumentRedlineAccess().AppendRedline(new SwRangeRedline(RedlineType::Insert, aTemp), true); } } diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 70db09b052bb..3c018f0a702c 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -355,7 +355,7 @@ void SwTextFrame::MakePos() { pRedln->MaybeNotifyRedlinePositionModification(getFrameArea().Top()); if (GetMergedPara() - && pRedln->GetType() == nsRedlineType_t::REDLINE_DELETE + && pRedln->GetType() == RedlineType::Delete && pRedln->GetPoint()->nNode != pRedln->GetMark()->nNode) { pTextNode = pRedln->End()->nNode.GetNode().GetTextNode(); diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 99e34f9673a6..e52f220ffbf2 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -389,7 +389,7 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const else { if (!GetMergedPara() && - SwRedlineTable::npos == rIDRA.GetRedlinePos(*GetTextNodeFirst(), USHRT_MAX)) + SwRedlineTable::npos == rIDRA.GetRedlinePos(*GetTextNodeFirst(), RedlineType::Any)) { bRedLine = false; } @@ -484,7 +484,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const if (IDocumentRedlineAccess::IsShowChanges(rIDRA.GetRedlineFlags()) && !getRootFrame()->IsHideRedlines()) { - const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, USHRT_MAX ); + const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, RedlineType::Any ); if( SwRedlineTable::npos != nRedlPos ) { SwAttrHandler aAttrHandler; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 46b3c60c8aa1..eea5dbd4a622 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -2306,7 +2306,7 @@ void SwScriptInfo::selectRedLineDeleted(const SwTextNode& rNode, MultiSelection const IDocumentRedlineAccess& rIDRA = rNode.getIDocumentRedlineAccess(); if ( IDocumentRedlineAccess::IsShowChanges( rIDRA.GetRedlineFlags() ) ) { - SwRedlineTable::size_type nAct = rIDRA.GetRedlinePos( rNode, USHRT_MAX ); + SwRedlineTable::size_type nAct = rIDRA.GetRedlinePos( rNode, RedlineType::Any ); for ( ; nAct < rIDRA.GetRedlineTable().size(); nAct++ ) { @@ -2315,7 +2315,7 @@ void SwScriptInfo::selectRedLineDeleted(const SwTextNode& rNode, MultiSelection if (pRed->Start()->nNode > rNode.GetIndex()) break; - if (pRed->GetType() != nsRedlineType_t::REDLINE_DELETE) + if (pRed->GetType() != RedlineType::Delete) continue; sal_Int32 nRedlStart; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 8ea644532112..3ae4b9623978 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -252,7 +252,7 @@ SwTwips SwTextFrame::EmptyHeight() const if (IDocumentRedlineAccess::IsShowChanges(rIDRA.GetRedlineFlags()) && !getRootFrame()->IsHideRedlines()) { - const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, USHRT_MAX ); + const SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, RedlineType::Any ); if( SwRedlineTable::npos != nRedlPos ) { SwAttrHandler aAttrHandler; diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index e98240098786..6133b08ce1bb 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -68,7 +68,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, SwTextNode * pParaPropsNode(nullptr); SwTextNode * pNode(&rTextNode); sal_Int32 nLastEnd(0); - for (auto i = rIDRA.GetRedlinePos(rTextNode, USHRT_MAX); + for (auto i = rIDRA.GetRedlinePos(rTextNode, RedlineType::Any); i < rIDRA.GetRedlineTable().size(); ++i) { SwRangeRedline const*const pRed = rIDRA.GetRedlineTable()[i]; @@ -76,7 +76,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode, if (pNode->GetIndex() < pRed->Start()->nNode.GetIndex()) break; - if (pRed->GetType() != nsRedlineType_t::REDLINE_DELETE) + if (pRed->GetType() != RedlineType::Delete) continue; SwPosition const*const pStart(pRed->Start()); @@ -445,7 +445,7 @@ void SwAttrIter::CtorInitAttrIter(SwTextNode & rTextNode, && pRootFrame && !pRootFrame->IsHideRedlines(); if (pExtInp || m_pMergedPara || bShow) { - SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, USHRT_MAX ); + SwRedlineTable::size_type nRedlPos = rIDRA.GetRedlinePos( rTextNode, RedlineType::Any ); if (SwRedlineTable::npos == nRedlPos && m_pMergedPara) { SwTextNode const* pNode(&rTextNode); @@ -454,7 +454,7 @@ void SwAttrIter::CtorInitAttrIter(SwTextNode & rTextNode, if (rExtent.pNode != pNode) { pNode = rExtent.pNode; - nRedlPos = rIDRA.GetRedlinePos(*pNode, USHRT_MAX); + nRedlPos = rIDRA.GetRedlinePos(*pNode, RedlineType::Any); if (SwRedlineTable::npos != nRedlPos) break; } @@ -635,7 +635,7 @@ short SwRedlineItr::Seek(SwFont& rFnt, SwRangeRedline const*const pRedline( m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[m_nAct]); SwPosition const*const pStart(pRedline->Start()); - if (pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE + if (pRedline->GetType() == RedlineType::Delete && (nNode < pStart->nNode.GetIndex() || (nNode == pStart->nNode.GetIndex() && nNew <= pStart->nContent.GetIndex()))) @@ -650,18 +650,18 @@ short SwRedlineItr::Seek(SwFont& rFnt, return nRet + EnterExtend(rFnt, nNode, nNew); } -void SwRedlineItr::FillHints( std::size_t nAuthor, RedlineType_t eType ) +void SwRedlineItr::FillHints( std::size_t nAuthor, RedlineType eType ) { switch ( eType ) { - case nsRedlineType_t::REDLINE_INSERT: + case RedlineType::Insert: SW_MOD()->GetInsertAuthorAttr(nAuthor, *m_pSet); break; - case nsRedlineType_t::REDLINE_DELETE: + case RedlineType::Delete: SW_MOD()->GetDeletedAuthorAttr(nAuthor, *m_pSet); break; - case nsRedlineType_t::REDLINE_FORMAT: - case nsRedlineType_t::REDLINE_FMTCOLL: + case RedlineType::Format: + case RedlineType::FmtColl: SW_MOD()->GetFormatAuthorAttr(nAuthor, *m_pSet); break; default: @@ -730,7 +730,7 @@ SwRedlineItr::GetNextRedln(sal_Int32 nNext, SwTextNode const*const pNode, m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[rAct]); pRedline->CalcStartEnd(pNode->GetIndex(), nStart, nEnd); if (m_eMode != Mode::Hide - || pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + || pRedline->GetType() == RedlineType::Delete) { break; } @@ -757,8 +757,8 @@ SwRedlineItr::GetNextRedln(sal_Int32 nNext, SwTextNode const*const pNode, assert(m_eMode == Mode::Hide); SwRangeRedline const* pRedline( m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[rAct]); - assert(pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE); //? - if (pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE) + assert(pRedline->GetType() == RedlineType::Delete); //? + if (pRedline->GetType() == RedlineType::Delete) { nNext = nStart; size_t nSkipped(1); // (consecutive) candidates to be skipped @@ -772,7 +772,7 @@ SwRedlineItr::GetNextRedln(sal_Int32 nNext, SwTextNode const*const pNode, break; // done for now } else if (*pNext->Start() == *pRedline->End() && - pNext->GetType() == nsRedlineType_t::REDLINE_DELETE) + pNext->GetType() == RedlineType::Delete) { // consecutive delete - continue pRedline = pNext; diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx index 0d6d365e9637..6fc39e14f240 100644 --- a/sw/source/core/text/redlnitr.hxx +++ b/sw/source/core/text/redlnitr.hxx @@ -89,7 +89,7 @@ private: void Clear_( SwFont* pFnt ); bool ChkSpecialUnderline_() const; - void FillHints( std::size_t nAuthor, RedlineType_t eType ); + void FillHints( std::size_t nAuthor, RedlineType eType ); short EnterExtend(SwFont& rFnt, sal_uLong const nNode, sal_Int32 const nNew) { if (m_pExt) return m_pExt->Enter(rFnt, nNode, nNew); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index ff94c1848b1b..532dec392920 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3614,7 +3614,7 @@ OUString SwTextNode::GetRedlineText() const { std::vector<sal_Int32> aRedlArr; const SwDoc* pDoc = GetDoc(); - SwRedlineTable::size_type nRedlPos = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *this, nsRedlineType_t::REDLINE_DELETE ); + SwRedlineTable::size_type nRedlPos = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *this, RedlineType::Delete ); if( SwRedlineTable::npos != nRedlPos ) { // some redline-delete object exists for the node @@ -3622,7 +3622,7 @@ OUString SwTextNode::GetRedlineText() const for( ; nRedlPos < pDoc->getIDocumentRedlineAccess().GetRedlineTable().size() ; ++nRedlPos ) { const SwRangeRedline* pTmp = pDoc->getIDocumentRedlineAccess().GetRedlineTable()[ nRedlPos ]; - if( nsRedlineType_t::REDLINE_DELETE == pTmp->GetType() ) + if( RedlineType::Delete == pTmp->GetType() ) { const SwPosition *pRStt = pTmp->Start(), *pREnd = pTmp->End(); if( pRStt->nNode < nNdIdx ) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index c4dd0d09805c..d00dbf9c5358 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -149,14 +149,14 @@ lcl_MaskRedlines( const SwTextNode& rNode, OUStringBuffer& rText, const SwDoc& rDoc = *rNode.GetDoc(); - for ( SwRedlineTable::size_type nAct = rDoc.getIDocumentRedlineAccess().GetRedlinePos( rNode, USHRT_MAX ); nAct < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); ++nAct ) + for ( SwRedlineTable::size_type nAct = rDoc.getIDocumentRedlineAccess().GetRedlinePos( rNode, RedlineType::Any ); nAct < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); ++nAct ) { const SwRangeRedline* pRed = rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ nAct ]; if ( pRed->Start()->nNode > rNode.GetIndex() ) break; - if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() ) + if( RedlineType::Delete == pRed->GetType() ) { sal_Int32 nRedlineEnd; sal_Int32 nRedlineStart; diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 86cf73bef4c3..ff54f61ca06c 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -693,8 +693,8 @@ void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, bool bIsContent ) SwDoc* pDoc = rPam.GetDoc(); if ( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { m_pRedlineData.reset( new SwRedlineData( bIsContent - ? nsRedlineType_t::REDLINE_INSERT - : nsRedlineType_t::REDLINE_FORMAT, + ? RedlineType::Insert + : RedlineType::Format, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); } @@ -722,11 +722,11 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext) aPam.GetPoint()->nContent.Assign( aPam.GetContentNode(), nSttContent ); aPam.SetMark(); ++aPam.GetPoint()->nContent; - pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, USHRT_MAX); + pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, RedlineType::Any); } else { // remove all format redlines, will be recreated if needed SetPaM(aPam); - pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT); + pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, RedlineType::Format); if (m_pRedlineSaveData) { SetSaveData( *pDoc, *m_pRedlineSaveData ); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index daa062536d88..a53458952594 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -80,7 +80,7 @@ static SwTextNode * FindFirstAndNextNode(SwDoc & rDoc, SwUndRng const& rRange, if (rRedline.nSttNode <= rRange.nSttNode && rRedline.nSttNode < rRange.nEndNode && rRange.nEndNode <= rRedline.nEndNode - && rRedline.GetType() == nsRedlineType_t::REDLINE_DELETE) + && rRedline.GetType() == RedlineType::Delete) { nEndOfRedline = rRedline.nEndNode; o_rpFirstMergedDeletedTextNode = rDoc.GetNodes()[rRedline.nSttNode]->GetTextNode(); @@ -573,7 +573,7 @@ bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) if( !bOk ) return false; - pDoc->getIDocumentRedlineAccess().DeleteRedline( rDelPam, false, USHRT_MAX ); + pDoc->getIDocumentRedlineAccess().DeleteRedline( rDelPam, false, RedlineType::Any ); } // Both 'deletes' can be consolidated, so 'move' the related character diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 7e9c54ae2bc5..1d9facd95822 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1364,7 +1364,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM const & rPam ) // First, delete the "old" so that in an Append no unexpected things will // happen, e.g. a delete in an insert. In the latter case the just restored // content will be deleted and not the one you originally wanted. - rDoc.getIDocumentRedlineAccess().DeleteRedline( *pRedl, false, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( *pRedl, false, RedlineType::Any ); RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags(); rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld | RedlineFlags::DontCombineRedlines ); @@ -1408,7 +1408,7 @@ bool SwUndo::FillSaveData( } if( !rSData.empty() && bDelRange ) { - rRange.GetDoc()->getIDocumentRedlineAccess().DeleteRedline( rRange, false, USHRT_MAX ); + rRange.GetDoc()->getIDocumentRedlineAccess().DeleteRedline( rRange, false, RedlineType::Any ); } return !rSData.empty(); } @@ -1426,7 +1426,7 @@ bool SwUndo::FillSaveDataForFormat( for ( ; n < rTable.size(); ++n ) { SwRangeRedline* pRedl = rTable[n]; - if ( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() ) + if ( RedlineType::Format == pRedl->GetType() ) { const SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() ); if ( eCmpPos != SwComparePosition::Before diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 5b429992bbb5..63ed58035aac 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -93,7 +93,7 @@ void SwUndoInsert::Init(const SwNodeIndex & rNd) pDoc = rNd.GetNode().GetDoc(); if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { - pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, + pRedlData.reset( new SwRedlineData( RedlineType::Insert, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() ); } @@ -165,7 +165,7 @@ bool SwUndoInsert::CanGrouping( const SwPosition& rPos ) const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); if( !rTable.empty() ) { - SwRedlineData aRData( nsRedlineType_t::REDLINE_INSERT, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ); + SwRedlineData aRData( RedlineType::Insert, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ); const SwIndexReg* pIReg = rPos.nContent.GetIdxReg(); for(SwRangeRedline* pRedl : rTable) { @@ -219,7 +219,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) pPam->SetMark(); pPam->Move( fnMoveBackward ); pPam->Exchange(); - pTmpDoc->getIDocumentRedlineAccess().DeleteRedline( *pPam, true, USHRT_MAX ); + pTmpDoc->getIDocumentRedlineAccess().DeleteRedline( *pPam, true, RedlineType::Any ); } pPam->DeleteMark(); pTmpDoc->getIDocumentContentOperations().DelFullPara( *pPam ); @@ -242,7 +242,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) { aPaM.GetPoint()->nContent -= nLen; if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) - pTmpDoc->getIDocumentRedlineAccess().DeleteRedline( aPaM, true, USHRT_MAX ); + pTmpDoc->getIDocumentRedlineAccess().DeleteRedline( aPaM, true, RedlineType::Any ); if (m_bWithRsid) { // RSID was added: remove any CHARFMT/AUTOFMT that may be @@ -263,7 +263,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) { aPaM.Move(fnMoveBackward); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) - pTmpDoc->getIDocumentRedlineAccess().DeleteRedline( aPaM, true, USHRT_MAX ); + pTmpDoc->getIDocumentRedlineAccess().DeleteRedline( aPaM, true, RedlineType::Any ); RemoveIdxFromRange( aPaM, false ); } diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index c19b6cf0242d..bf64fc3fca5f 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -61,7 +61,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, } if (nSttContent < nTextNdLen) { - pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, USHRT_MAX); + pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, RedlineType::Any); } } @@ -140,7 +140,7 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, if( !bOk ) return false; - pDoc->getIDocumentRedlineAccess().DeleteRedline( aPam, false, USHRT_MAX ); + pDoc->getIDocumentRedlineAccess().DeleteRedline( aPam, false, RedlineType::Any ); } // both 'overwrites' can be combined so 'move' the corresponding character @@ -273,7 +273,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) rIdx.Assign( pTextNd, nSttContent ); pCurrentPam->SetMark(); pCurrentPam->GetMark()->nContent += aDelStr.getLength(); - pDoc->getIDocumentRedlineAccess().DeleteRedline( *pCurrentPam, false, USHRT_MAX ); + pDoc->getIDocumentRedlineAccess().DeleteRedline( *pCurrentPam, false, RedlineType::Any ); pCurrentPam->DeleteMark(); } rIdx.Assign( pTextNd, !aDelStr.isEmpty() ? nSttContent+1 : nSttContent ); diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx index e5b48e5fa363..59be96d9d2dd 100644 --- a/sw/source/core/undo/unredln.cxx +++ b/sw/source/core/undo/unredln.cxx @@ -48,7 +48,7 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange ) { case SwUndoId::DELETE: case SwUndoId::REPLACE: - mpRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_DELETE, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) ); + mpRedlData.reset( new SwRedlineData( RedlineType::Delete, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) ); break; default: ; @@ -150,7 +150,7 @@ void SwUndoRedline::UndoRedlineImpl(SwDoc &, SwPaM &) // default: remove redlines void SwUndoRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) { - rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX); + rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any); } SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId ) @@ -196,7 +196,7 @@ void SwUndoRedlineDelete::SetRedlineText(const OUString & rText) void SwUndoRedlineDelete::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) { - rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX); + rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any); } void SwUndoRedlineDelete::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) @@ -272,7 +272,7 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) // 'insert' Redline object. The former is located directly after the latter. SwRedlineTable::size_type nFnd = rDoc.getIDocumentRedlineAccess().GetRedlinePos( *rDoc.GetNodes()[ nSttNode + 1 ], - nsRedlineType_t::REDLINE_INSERT ); + RedlineType::Insert ); OSL_ENSURE( SwRedlineTable::npos != nFnd && nFnd+1 < rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(), "could not find an Insert object" ); ++nFnd; @@ -285,7 +285,7 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) aTmp.SetMark(); aTmp.GetPoint()->nNode = nSaveEndNode; aTmp.GetPoint()->nContent.Assign( aTmp.GetContentNode(), nSaveEndContent ); - rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, RedlineType::Any ); } rDoc.getIDocumentContentOperations().DelFullPara(rPam); @@ -387,7 +387,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns ) SwDoc* pDoc = rRg.GetDoc(); if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { - RedlineType_t eTyp = bInsert ? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_DELETE; + RedlineType eTyp = bInsert ? RedlineType::Insert : RedlineType::Delete; pRedlData.reset( new SwRedlineData( eTyp, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() ); } @@ -396,7 +396,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, bool bIns ) SwUndoCompDoc::SwUndoCompDoc( const SwRangeRedline& rRedl ) : SwUndo( SwUndoId::COMPAREDOC, rRedl.GetDoc() ), SwUndRng( rRedl ), // for MergeDoc the corresponding inverse is needed - bInsert( nsRedlineType_t::REDLINE_DELETE == rRedl.GetType() ) + bInsert( RedlineType::Delete == rRedl.GetType() ) { SwDoc* pDoc = rRedl.GetDoc(); if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) @@ -431,7 +431,7 @@ void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext) RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags(); rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern(( eOld & ~RedlineFlags::Ignore) | RedlineFlags::On); - rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX); + rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any); rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld ); @@ -475,7 +475,7 @@ void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext) { if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) { - rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX); + rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any); if( pRedlSaveData ) SetSaveData(rDoc, *pRedlSaveData); diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index ef84c67a138f..f6bd82bb959f 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -92,7 +92,7 @@ SwUndoInsSection::SwUndoInsSection( SwDoc& rDoc = *rPam.GetDoc(); if( rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { - m_pRedlData.reset(new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, + m_pRedlData.reset(new SwRedlineData( RedlineType::Insert, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() )); SetRedlineFlags( rDoc.getIDocumentRedlineAccess().GetRedlineFlags() ); } @@ -133,7 +133,7 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext) OSL_ENSURE( pNd, "where is my SectionNode?" ); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) - rDoc.getIDocumentRedlineAccess().DeleteRedline( *pNd, true, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( *pNd, true, RedlineType::Any ); // no selection? SwNodeIndex aIdx( *pNd ); diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx index cab7026483d6..81997ed164d8 100644 --- a/sw/source/core/undo/unspnd.cxx +++ b/sw/source/core/undo/unspnd.cxx @@ -57,7 +57,7 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, // consider Redline if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { - pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); + pRedlData.reset( new SwRedlineData( RedlineType::Insert, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() ); } @@ -122,7 +122,7 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext) ++rPam.GetMark()->nNode; rPam.GetMark()->nContent.Assign( rPam.GetMark()-> nNode.GetNode().GetContentNode(), 0 ); - pDoc->getIDocumentRedlineAccess().DeleteRedline( rPam, true, USHRT_MAX ); + pDoc->getIDocumentRedlineAccess().DeleteRedline( rPam, true, RedlineType::Any ); rPam.DeleteMark(); } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 2caf8836d338..026aa6f8dea4 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -235,7 +235,7 @@ SwUndoInsTable::SwUndoInsTable( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt SwDoc& rDoc = *rPos.nNode.GetNode().GetDoc(); if( rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { - pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) ); + pRedlData.reset( new SwRedlineData( RedlineType::Insert, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ) ); SetRedlineFlags( rDoc.getIDocumentRedlineAccess().GetRedlineFlags() ); } @@ -260,7 +260,7 @@ void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & rContext) pTableNd->DelFrames(); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) - rDoc.getIDocumentRedlineAccess().DeleteRedline( *pTableNd, true, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( *pTableNd, true, RedlineType::Any ); RemoveIdxFromSection( rDoc, nSttNode ); // move hard page breaks into next node @@ -2153,7 +2153,7 @@ void SwUndoTableNumFormat::UndoImpl(::sw::UndoRedoContext & rContext) // the same here. if( pTextNd->GetText() != m_aStr ) { - rDoc.getIDocumentRedlineAccess().DeleteRedline( *( pBox->GetSttNd() ), false, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( *( pBox->GetSttNd() ), false, RedlineType::Any ); SwIndex aIdx( pTextNd, 0 ); if( !m_aStr.isEmpty() ) @@ -2399,7 +2399,7 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) *aPam.GetPoint() = SwPosition( aTmpIdx ); } } - rDoc.getIDocumentRedlineAccess().DeleteRedline( aPam, true, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( aPam, true, RedlineType::Any ); if( pEntry->pUndo ) { @@ -2675,7 +2675,7 @@ std::unique_ptr<SwUndo> SwUndoTableCpyTable::PrepareRedline( SwDoc* pDoc, const { // If the old (deleted) part is not empty, here we are... SwPaM aDeletePam( aDeleteStart, aCellEnd ); pUndo = std::make_unique<SwUndoRedlineDelete>( aDeletePam, SwUndoId::DELETE ); - pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_DELETE, aDeletePam ), true ); + pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Delete, aDeletePam ), true ); } else if( !rJoin ) // If the old part is empty and joined, we are finished { // if it is not joined, we have to delete this empty paragraph @@ -2691,7 +2691,7 @@ std::unique_ptr<SwUndo> SwUndoTableCpyTable::PrepareRedline( SwDoc* pDoc, const if( aCellStart != aInsertEnd ) // An empty insertion will not been marked { SwPaM aTmpPam( aCellStart, aInsertEnd ); - pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aTmpPam ), true ); + pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( RedlineType::Insert, aTmpPam ), true ); } pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld ); diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 5a347704333e..47465620b882 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -73,7 +73,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) // consider Redline if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { - pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); + pRedlData.reset( new SwRedlineData( RedlineType::Insert, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() ); } } @@ -186,7 +186,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) SwPaM& rPam = AddUndoRedoPaM(rContext); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) - rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, USHRT_MAX); + rDoc.getIDocumentRedlineAccess().DeleteRedline(rPam, true, RedlineType::Any); // if Point and Mark are different text nodes so a JoinNext has to be done bool bJoinNext = nSttNode != nEndNode && diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 6b6c063d114b..0b8a3d8fadb9 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1167,17 +1167,17 @@ void makeRedline( SwPaM const & rPaM, { IDocumentRedlineAccess* pRedlineAccess = &rPaM.GetDoc()->getIDocumentRedlineAccess(); - RedlineType_t eType; + RedlineType eType; if ( rRedlineType == "Insert" ) - eType = nsRedlineType_t::REDLINE_INSERT; + eType = RedlineType::Insert; else if ( rRedlineType == "Delete" ) - eType = nsRedlineType_t::REDLINE_DELETE; + eType = RedlineType::Delete; else if ( rRedlineType == "Format" ) - eType = nsRedlineType_t::REDLINE_FORMAT; + eType = RedlineType::Format; else if ( rRedlineType == "TextTable" ) - eType = nsRedlineType_t::REDLINE_TABLE; + eType = RedlineType::Table; else if ( rRedlineType == "ParagraphFormat" ) - eType = nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT; + eType = RedlineType::ParagraphFormat; else throw lang::IllegalArgumentException(); @@ -1208,7 +1208,7 @@ void makeRedline( SwPaM const & rPaM, { int nMap = 0; // Make sure that paragraph format gets its own map, otherwise e.g. fill attributes are not preserved. - if (eType == nsRedlineType_t::REDLINE_PARAGRAPH_FORMAT) + if (eType == RedlineType::ParagraphFormat) nMap = PROPERTY_MAP_PARAGRAPH; else nMap = PROPERTY_MAP_TEXTPORTION_EXTENSIONS; @@ -1279,14 +1279,14 @@ void makeTableRowRedline( SwTableLine& rTableLine, { IDocumentRedlineAccess* pRedlineAccess = &rTableLine.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess(); - RedlineType_t eType; + RedlineType eType; if ( rRedlineType == "TableRowInsert" ) { - eType = nsRedlineType_t::REDLINE_TABLE_ROW_INSERT; + eType = RedlineType::TableRowInsert; } else if ( rRedlineType == "TableRowDelete" ) { - eType = nsRedlineType_t::REDLINE_TABLE_ROW_DELETE; + eType = RedlineType::TableRowDelete; } else { @@ -1328,14 +1328,14 @@ void makeTableCellRedline( SwTableBox& rTableBox, { IDocumentRedlineAccess* pRedlineAccess = &rTableBox.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess(); - RedlineType_t eType; + RedlineType eType; if ( rRedlineType == "TableCellInsert" ) { - eType = nsRedlineType_t::REDLINE_TABLE_CELL_INSERT; + eType = RedlineType::TableCellInsert; } else if ( rRedlineType == "TableCellDelete" ) { - eType = nsRedlineType_t::REDLINE_TABLE_CELL_DELETE; + eType = RedlineType::TableCellDelete; } else { diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index ef8226d511b4..517548579d26 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -195,7 +195,7 @@ static uno::Sequence<beans::PropertyValue> lcl_GetSuccessorProperties(const SwRa pValues[2].Name = UNO_NAME_REDLINE_COMMENT; pValues[2].Value <<= pNext->GetComment(); pValues[3].Name = UNO_NAME_REDLINE_TYPE; - pValues[3].Value <<= nsRedlineType_t::SwRedlineTypeToOUString(pNext->GetType()); + pValues[3].Value <<= SwRedlineTypeToOUString(pNext->GetType()); } return aValues; } @@ -264,7 +264,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co aRet <<= const_cast<SwRangeRedline&>(rRedline).GetDescr(); else if(rPropertyName == UNO_NAME_REDLINE_TYPE) { - aRet <<= nsRedlineType_t::SwRedlineTypeToOUString(rRedline.GetType()); + aRet <<= SwRedlineTypeToOUString(rRedline.GetType()); } else if(rPropertyName == UNO_NAME_REDLINE_SUCCESSOR_DATA) { @@ -304,7 +304,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties pRet[nPropIdx].Name = UNO_NAME_REDLINE_DESCRIPTION; pRet[nPropIdx++].Value <<= const_cast<SwRangeRedline&>(rRedline).GetDescr(); pRet[nPropIdx].Name = UNO_NAME_REDLINE_TYPE; - pRet[nPropIdx++].Value <<= nsRedlineType_t::SwRedlineTypeToOUString(rRedline.GetType()); + pRet[nPropIdx++].Value <<= SwRedlineTypeToOUString(rRedline.GetType()); pRet[nPropIdx].Name = UNO_NAME_REDLINE_IDENTIFIER; pRet[nPropIdx++].Value <<= OUString::number( sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&rRedline) ) ); |