summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/swcrsr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/crsr/swcrsr.cxx')
-rwxr-xr-x[-rw-r--r--]sw/source/core/crsr/swcrsr.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b7106ade751c..63aae63019d3 100644..100755
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -973,7 +973,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
{
// Cursor als Kopie vom akt. und in den Ring aufnehmen
// Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
// wenn schon ausserhalb vom Bodytext, suche von der Position,
// ansonsten beginne mit der 1. GrundSection
@@ -1004,8 +1004,8 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
+ pSav.release();
- delete pSav;
if( !( FND_IN_SELALL & eFndRngs ))
{
// es sollte nur einer gesucht werden, also fuege in dazu
@@ -1031,7 +1031,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else if( FND_IN_SELALL & eFndRngs )
{
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ ::std::auto_ptr< SwCursor> pSav( Create( this ) ); // save the current cursor
const SwNode* pSttNd = ( FND_IN_BODYONLY & eFndRngs )
? rNds.GetEndOfContent().StartOfSectionNode()
@@ -1058,10 +1058,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
DeleteMark();
return 0;
}
- // es wurde ein- bis mehrmals gefunden. Das steht alles
- // im neuen Crsr-Ring. Darum hebe erstmal den alten Ring auf
- delete pSav;
-
+ pSav.release();
while( GetNext() != this )
delete GetNext();