[Libreoffice-commits] .: sw/source
Takeshi Abe
tabe at kemper.freedesktop.org
Tue Sep 20 07:18:34 PDT 2011
sw/source/core/doc/docredln.cxx | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
New commits:
commit 1ac1b1499f94cbdea153faff2238b1a2e8a48b5f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Tue Sep 20 22:55:27 2011 +0900
removed unsatisfiable equalities of conditionals
by definition of ComparePosition(), neither *pEnd is equal to *pREnd
in case of POS_OVERLAP_BEFORE, nor *pStt is equal to *pRStt in case
of POS_OVERLAP_BEHIND
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 179168a..851174f 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1408,33 +1408,25 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
SwPosition* pRStt = pRedl->Start(),
* pREnd = pRStt == pRedl->GetPoint() ? pRedl->GetMark()
: pRedl->GetPoint();
- sal_Bool bDel = sal_False;
switch( ComparePosition( *pStt, *pEnd, *pRStt, *pREnd ) )
{
case POS_EQUAL:
case POS_OUTSIDE:
- bDel = sal_True;
+ pRedl->InvalidateRange();
+ pRedlineTbl->DeleteAndDestroy( n-- );
+ bChg = sal_True;
break;
case POS_OVERLAP_BEFORE:
- if( *pEnd == *pREnd )
- bDel = sal_True;
- else
- {
pRedl->InvalidateRange();
pRedl->SetStart( *pEnd, pRStt );
// neu einsortieren
pRedlineTbl->Remove( n );
pRedlineTbl->Insert( pRedl );
--n;
- }
break;
case POS_OVERLAP_BEHIND:
- if( *pStt == *pRStt )
- bDel = sal_True;
- else
- {
pRedl->InvalidateRange();
pRedl->SetEnd( *pStt, pREnd );
if( !pRedl->HasValidRange() )
@@ -1444,7 +1436,6 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
pRedlineTbl->Insert( pRedl );
--n;
}
- }
break;
case POS_INSIDE:
@@ -1490,13 +1481,6 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
default:
break;
}
-
- if( bDel )
- {
- pRedl->InvalidateRange();
- pRedlineTbl->DeleteAndDestroy( n-- );
- bChg = sal_True;
- }
}
if( bChg )
More information about the Libreoffice-commits
mailing list