summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/DocumentRedlineManager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/DocumentRedlineManager.cxx')
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 22893963b5b1..17419eda39ba 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2523,6 +2523,35 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r
// #TODO - add 'SwExtraRedlineTable' also ?
}
+bool DocumentRedlineManager::HasRedline( const SwPaM& rPam, RedlineType nType, bool bStartOrEndInRange ) const // xxx
+{
+ SwPosition currentStart(*rPam.Start());
+ SwPosition currentEnd(*rPam.End());
+ SwNodeIndex pEndNodeIndex(currentEnd.nNode.GetNode());
+
+ for( SwRedlineTable::size_type n = GetRedlinePos( rPam.Start()->nNode.GetNode(), nType );
+ n < mpRedlineTable->size(); ++n )
+ {
+ const SwRangeRedline* pTmp = (*mpRedlineTable)[ n ];
+
+ if ( pTmp->Start()->nNode > pEndNodeIndex )
+ break;
+
+ if( RedlineType::Any != nType && nType != pTmp->GetType() )
+ continue;
+
+ // redline over the range
+ if ( currentStart < *pTmp->End() && *pTmp->Start() <= currentEnd &&
+ // starting or ending within the range
+ ( !bStartOrEndInRange ||
+ ( currentStart <= *pTmp->Start() || *pTmp->End() <= currentEnd ) ) )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
const SwRangeRedline* DocumentRedlineManager::GetRedline( const SwPosition& rPos,
SwRedlineTable::size_type* pFndPos ) const
{