summaryrefslogtreecommitdiff
path: root/sw/source/core/doc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-22 14:36:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-23 11:11:11 +0200
commit28bff4bd3947f442c0aebb92217cd0c7b6a53bda (patch)
treecfa5cf6199774bc9decd07e286d4e4182f1590d3 /sw/source/core/doc
parentbe6227b6c8d6ffacb7168e76856c7e059c08bf77 (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/doc')
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx36
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx2
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx80
-rw-r--r--sw/source/core/doc/doccomp.cxx18
-rw-r--r--sw/source/core/doc/docfmt.cxx4
-rw-r--r--sw/source/core/doc/docnum.cxx14
-rw-r--r--sw/source/core/doc/docredln.cxx66
-rw-r--r--sw/source/core/doc/docsort.cxx10
-rw-r--r--sw/source/core/doc/doctxm.cxx2
-rw-r--r--sw/source/core/doc/ftnidx.cxx2
-rw-r--r--sw/source/core/doc/tblrwcl.cxx6
11 files changed, 120 insertions, 120 deletions
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() );