summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2002-09-13 12:19:33 +0000
committerOliver Specht <os@openoffice.org>2002-09-13 12:19:33 +0000
commit68fea5d2878395c5dbbbed1c4b69e98e3b455789 (patch)
tree13be0b5456bc4ed0ba48bc1ac178d10fa5185373 /sw/source
parente1c8486083687152a782df0871422136869b56f4 (diff)
#100992# changed treatment of maximum undoable replace operations
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx15
-rw-r--r--sw/source/core/crsr/findattr.cxx23
-rw-r--r--sw/source/core/crsr/findcoll.cxx12
-rw-r--r--sw/source/core/crsr/findtxt.cxx8
-rw-r--r--sw/source/core/crsr/swcrsr.cxx46
-rw-r--r--sw/source/core/crsr/viscrs.cxx21
-rw-r--r--sw/source/core/edit/edtox.cxx7
-rw-r--r--sw/source/ui/index/idxmrk.cxx7
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx11
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx23
-rw-r--r--sw/source/ui/wrtsh/select.cxx34
11 files changed, 127 insertions, 80 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 905412f60a65..c780940ccd34 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: crsrsh.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: os $ $Date: 2002-09-06 13:24:11 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:07:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2819,27 +2819,29 @@ FASTBOOL SwCrsrShell::IsInVerticalText( const Point* pPt ) const
// die Suchfunktionen
ULONG SwCrsrShell::Find( const SearchOptions& rSearchOpt,
SwDocPositions eStart, SwDocPositions eEnde,
+ BOOL& bCancel,
FindRanges eRng, int bReplace )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- ULONG nRet = pCurCrsr->Find( rSearchOpt, eStart, eEnde, eRng, bReplace );
- if( nRet )
+ ULONG nRet = pCurCrsr->Find( rSearchOpt, eStart, eEnde, bCancel, eRng, bReplace );
+ if( nRet || bCancel )
UpdateCrsr();
return nRet;
}
ULONG SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl,
SwDocPositions eStart, SwDocPositions eEnde,
+ BOOL& bCancel,
FindRanges eRng, const SwTxtFmtColl* pReplFmt )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- ULONG nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, eRng, pReplFmt );
+ ULONG nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, bCancel, eRng, pReplFmt );
if( nRet )
UpdateCrsr();
return nRet;
@@ -2847,6 +2849,7 @@ ULONG SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl,
ULONG SwCrsrShell::Find( const SfxItemSet& rSet, FASTBOOL bNoCollections,
SwDocPositions eStart, SwDocPositions eEnde,
+ BOOL& bCancel,
FindRanges eRng, const SearchOptions* pSearchOpt,
const SfxItemSet* rReplSet )
{
@@ -2854,7 +2857,7 @@ ULONG SwCrsrShell::Find( const SfxItemSet& rSet, FASTBOOL bNoCollections,
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- ULONG nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde,
+ ULONG nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde, bCancel,
eRng, pSearchOpt, rReplSet );
if( nRet )
UpdateCrsr();
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 03b574ea20fc..0bbad5479312 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: findattr.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2002-05-13 12:09:29 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:12:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,6 +59,12 @@
*
************************************************************************/
+#ifdef PRECOMPILED
+#include "core_pch.hxx"
+#endif
+
+#pragma hdrstop
+
#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
#include <com/sun/star/lang/Locale.hpp>
#endif
@@ -73,12 +79,6 @@
#include <tools/isolang.hxx>
#endif
-#ifdef PRECOMPILED
-#include "core_pch.hxx"
-#endif
-
-#pragma hdrstop
-
#ifndef _HINTIDS_HXX
#include <hintids.hxx>
#endif
@@ -135,6 +135,9 @@
#ifndef _CRSSKIP_HXX
#include <crsskip.hxx>
#endif
+#ifndef _UNDOBJ_HXX
+#include <undobj.hxx>
+#endif
using namespace com::sun::star;
using namespace com::sun::star::lang;
@@ -1462,7 +1465,7 @@ int SwFindParaAttr::IsReplaceMode() const
ULONG SwCursor::Find( const SfxItemSet& rSet, FASTBOOL bNoCollections,
- SwDocPositions nStart, SwDocPositions nEnde,
+ SwDocPositions nStart, SwDocPositions nEnde, BOOL& bCancel,
FindRanges eFndRngs,
const SearchOptions* pSearchOpt, const SfxItemSet* pReplSet )
{
@@ -1481,7 +1484,7 @@ ULONG SwCursor::Find( const SfxItemSet& rSet, FASTBOOL bNoCollections,
SwFindParaAttr aSwFindParaAttr( rSet, bNoCollections, pSearchOpt,
pReplSet, *this );
- ULONG nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs );
+ ULONG nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && bReplace )
pDoc->SetModified();
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index 21618cbee166..54c5a76c343d 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: findcoll.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:08:17 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:01:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,6 +77,9 @@
#ifndef _SWUNDO_HXX
#include <swundo.hxx>
#endif
+#ifndef _UNDOBJ_HXX
+#include <undobj.hxx>
+#endif
//------------------ Methoden der CrsrShell ---------------------------
@@ -123,7 +126,7 @@ int SwFindParaFmtColl::IsReplaceMode() const
ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
- SwDocPositions nStart, SwDocPositions nEnde,
+ SwDocPositions nStart, SwDocPositions nEnde, BOOL& bCancel,
FindRanges eFndRngs, const SwTxtFmtColl* pReplFmtColl )
{
// OLE-Benachrichtigung abschalten !!
@@ -137,7 +140,7 @@ ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
SwFindParaFmtColl aSwFindParaFmtColl( rFmtColl, pReplFmtColl, *this );
- ULONG nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs );
+ ULONG nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && pReplFmtColl )
@@ -145,7 +148,6 @@ ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
if( bSttUndo )
pDoc->EndUndo( UNDO_REPLACE );
-
return nRet;
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index a59589bb15f0..80ef0cc5b2cd 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: findtxt.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fme $ $Date: 2002-08-05 07:00:19 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:01:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -459,6 +459,7 @@ int SwFindParaText::IsReplaceMode() const
ULONG SwCursor::Find( const SearchOptions& rSearchOpt,
SwDocPositions nStart, SwDocPositions nEnde,
+ BOOL& bCancel,
FindRanges eFndRngs, int bReplace )
{
// OLE-Benachrichtigung abschalten !!
@@ -474,14 +475,13 @@ ULONG SwCursor::Find( const SearchOptions& rSearchOpt,
if( bSearchSel )
eFndRngs = (FindRanges)(eFndRngs | FND_IN_SEL);
SwFindParaText aSwFindParaText( rSearchOpt, bReplace, *this );
- ULONG nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs );
+ ULONG nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && bReplace )
pDoc->SetModified();
if( bSttUndo )
pDoc->EndUndo( UNDO_REPLACE );
-
return nRet;
}
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index f54924d1b863..1384420e54a1 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swcrsr.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: os $ $Date: 2002-08-06 14:43:25 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:15:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -135,7 +135,9 @@
#ifndef _CRSSKIP_HXX
#include <crsskip.hxx>
#endif
-
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
#ifndef _MDIEXP_HXX
#include <mdiexp.hxx> // ...Percent()
#endif
@@ -145,7 +147,7 @@
using namespace ::com::sun::star::i18n;
-static const USHORT coSrchRplcThreshold = 500;
+static const USHORT coSrchRplcThreshold = 60000;
struct _PercentHdl
{
@@ -746,7 +748,7 @@ SwMoveFnCollection* SwCursor::MakeFindRange( SwDocPositions nStart,
ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
SwMoveFn fnMove, SwCursor*& pFndRing,
SwPaM& aRegion, FindRanges eFndRngs,
- FASTBOOL bInReadOnly )
+ FASTBOOL bInReadOnly, BOOL& bCancel )
{
SwDoc* pDoc = pCurCrsr->GetDoc();
FASTBOOL bDoesUndo = pDoc->DoesUndo();
@@ -811,11 +813,24 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
}
if( coSrchRplcThreshold == nFound && pDoc->DoesUndo()
- && rParas.IsReplaceMode() &&
- pCurCrsr->MaxReplaceArived() )
+ && rParas.IsReplaceMode())
{
- bEnde = TRUE;
- break;
+ short nRet = pCurCrsr->MaxReplaceArived();
+ if( RET_YES == nRet )
+ {
+ pDoc->DelAllUndoObj();
+ pDoc->DoUndo( FALSE );
+ }
+ else
+ {
+ bEnde = TRUE;
+ if(RET_CANCEL == nRet)
+ {
+ bCancel = TRUE;
+ //unwind() ??
+ }
+ break;
+ }
}
if( bSrchBkwrd )
@@ -919,8 +934,9 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd,
ULONG SwCursor::FindAll( SwFindParas& rParas,
SwDocPositions nStart, SwDocPositions nEnde,
- FindRanges eFndRngs )
+ FindRanges eFndRngs, BOOL& bCancel )
{
+ bCancel = FALSE;
SwCrsrSaveState aSaveState( *this );
// Region erzeugen, ohne das diese in den Ring aufgenommen wird !
@@ -941,7 +957,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas,
// der Cursor beleibt unveraendert
if( 0 == ( nFound = lcl_FindSelection( rParas, this, fnMove,
pFndRing, aRegion, eFndRngs,
- bInReadOnly ) ))
+ bInReadOnly, bCancel ) ))
return nFound;
// der String wurde ein- bis mehrmals gefunden. Das steht alles
@@ -974,7 +990,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas,
GetPoint()->nNode.GetIndex() ))
{
nFound = lcl_FindSelection( rParas, this, fnMove, pFndRing,
- aRegion, eFndRngs, bInReadOnly );
+ aRegion, eFndRngs, bInReadOnly, bCancel );
}
if( !nFound )
@@ -1028,7 +1044,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas,
: lcl_MakeSelFwrd( *pSttNd, rNds.GetEndOfContent(), *this, FALSE ))
{
nFound = lcl_FindSelection( rParas, this, fnMove, pFndRing,
- aRegion, eFndRngs, bInReadOnly );
+ aRegion, eFndRngs, bInReadOnly, bCancel );
}
if( !nFound )
@@ -1121,9 +1137,9 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const
}
}
-FASTBOOL SwCursor::MaxReplaceArived()
+short SwCursor::MaxReplaceArived()
{
- return FALSE;
+ return RET_YES;
}
FASTBOOL SwCursor::IsStartWord() const
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 865d2afa0e14..5e76bcf58e98 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viscrs.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2002-08-01 14:12:36 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:01:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -835,10 +835,9 @@ SwCursor* SwShellCrsr::Create( SwPaM* pRing ) const
}
-FASTBOOL SwShellCrsr::MaxReplaceArived()
+short SwShellCrsr::MaxReplaceArived()
{
- BOOL bRet = FALSE;
- short nRet;
+ short nRet = RET_YES;
Window* pDlg = ::GetSearchDialog();
if( pDlg )
{
@@ -868,15 +867,7 @@ FASTBOOL SwShellCrsr::MaxReplaceArived()
// ansonsten aus dem Basic, und dann auf RET_YES schalten
nRet = RET_YES;
- if( RET_CANCEL == nRet )
- bRet = TRUE;
- else if( RET_YES == nRet )
- {
- SwDoc* pDoc = GetDoc();
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( FALSE );
- }
- return bRet;
+ return nRet;
}
void SwShellCrsr::SaveTblBoxCntnt( const SwPosition* pPos )
@@ -1019,7 +1010,7 @@ SwCursor* SwShellTableCrsr::Create( SwPaM* pRing ) const
{
return SwShellCrsr::Create( pRing );
}
-FASTBOOL SwShellTableCrsr::MaxReplaceArived()
+short SwShellTableCrsr::MaxReplaceArived()
{
return SwShellCrsr::MaxReplaceArived();
}
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 4e021bba248c..cac682e063a0 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: edtox.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: jp $ $Date: 2001-10-18 12:18:53 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:02:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -556,7 +556,8 @@ void SwEditShell::ApplyAutoMark()
aSearchOpt.searchString = sToSelect;
KillPams();
- ULONG nRet = Find( aSearchOpt, DOCPOS_START, DOCPOS_END,
+ BOOL bCancel;
+ ULONG nRet = Find( aSearchOpt, DOCPOS_START, DOCPOS_END, bCancel,
(FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY),
FALSE );
diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx
index fa0ea1c6103b..155954bb66ee 100644
--- a/sw/source/ui/index/idxmrk.cxx
+++ b/sw/source/ui/index/idxmrk.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: idxmrk.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: os $ $Date: 2002-09-11 09:12:06 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:04:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -611,7 +611,8 @@ void lcl_SelectSameStrings(SwWrtShell& rSh, BOOL bWordOnly, BOOL bCaseSensitive)
: TransliterationModules_IGNORE_CASE) );
rSh.ClearMark();
- ULONG nRet = rSh.Find( aSearchOpt, DOCPOS_START, DOCPOS_END,
+ BOOL bCancel;
+ ULONG nRet = rSh.Find( aSearchOpt, DOCPOS_START, DOCPOS_END, bCancel,
(FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY), FALSE );
}
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index ccdf47d7ddc5..21e0e8a99f19 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewsrch.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: mba $ $Date: 2002-06-27 09:01:45 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:05:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -390,7 +390,7 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
nFound = FUNC_Search( aOpts );
pWrtShell->EndAllAction();
}
- rReq.SetReturnValue(SfxBoolItem(nSlot, nFound != 0));
+ rReq.SetReturnValue(SfxBoolItem(nSlot, nFound != 0 && ULONG_MAX != nFound));
if( !nFound )
{
if( !bApi )
@@ -402,7 +402,7 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
return;
}
- if( !bApi )
+ if( !bApi && !ULONG_MAX == nFound)
{
String aText( SW_RES( STR_NB_REPLACED ) );
const xub_StrLen nPos = aText.Search( String::CreateFromAscii("XX") );
@@ -872,6 +872,9 @@ void SwView::StateSearch(SfxItemSet &rSet)
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
+ Revision 1.10 2002/06/27 09:01:45 mba
+ #100714#: macro recording
+
Revision 1.9 2001/10/31 15:55:46 jp
Bug #93764#: ExechSearch - return correct WhichId range
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index ce54be13cf0c..84b1e74e3654 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotxdoc.cxx,v $
*
- * $Revision: 1.61 $
+ * $Revision: 1.62 $
*
- * last change: $Author: tl $ $Date: 2002-09-12 14:46:31 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:19:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -856,8 +856,9 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor >
0);
pSearch->FillSearchItemSet(aSearch);
pSearch->FillReplaceItemSet(aReplace);
+ BOOL bCancel;
nResult = (sal_Int32)pUnoCrsr->Find( aSearch, !pSearch->bStyles,
- eStart, eEnd,
+ eStart, eEnd, bCancel,
(FindRanges)eRanges,
pSearch->sSearchText.Len() ? &aSearchOpt : 0,
&aReplace );
@@ -867,15 +868,17 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor >
SwTxtFmtColl *pSearchColl = lcl_GetParaStyle(pSearch->sSearchText, pUnoCrsr->GetDoc());
SwTxtFmtColl *pReplaceColl = lcl_GetParaStyle(pSearch->sReplaceText, pUnoCrsr->GetDoc());;
+ BOOL bCancel;
nResult = pUnoCrsr->Find( *pSearchColl,
- eStart, eEnd,
+ eStart, eEnd, bCancel,
(FindRanges)eRanges, pReplaceColl );
}
else
{
+ BOOL bCancel;
nResult = pUnoCrsr->Find( aSearchOpt,
- eStart, eEnd,
+ eStart, eEnd, bCancel,
(FindRanges)eRanges,
sal_True );
}
@@ -987,8 +990,9 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor >
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
0);
pSearch->FillSearchItemSet(aSearch);
+ BOOL bCancel;
nResult = (sal_Int32)pUnoCrsr->Find( aSearch, !pSearch->bStyles,
- eStart, eEnd,
+ eStart, eEnd, bCancel,
(FindRanges)eRanges,
pSearch->sSearchText.Len() ? &aSearchOpt : 0,
0 );
@@ -998,15 +1002,16 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor >
SwTxtFmtColl *pSearchColl = lcl_GetParaStyle(pSearch->sSearchText, pUnoCrsr->GetDoc());
//pSearch->sReplaceText
SwTxtFmtColl *pReplaceColl = 0;
-
+ BOOL bCancel;
nResult = (sal_Int32)pUnoCrsr->Find( *pSearchColl,
- eStart, eEnd,
+ eStart, eEnd, bCancel,
(FindRanges)eRanges, pReplaceColl );
}
else
{
+ BOOL bCancel;
nResult = (sal_Int32)pUnoCrsr->Find( aSearchOpt,
- eStart, eEnd,
+ eStart, eEnd, bCancel,
(FindRanges)eRanges,
/*int bReplace =*/sal_False );
}
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 607f748f085f..b306eb1e3455 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: select.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: os $ $Date: 2002-04-23 14:09:52 $
+ * last change: $Author: os $ $Date: 2002-09-13 13:06:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -258,7 +258,14 @@ ULONG SwWrtShell::SearchPattern( const SearchOptions& rSearchOpt,
// keine Erweiterung bestehender Selektionen
if(!(eFlags & FND_IN_SEL))
ClearMark();
- return Find( rSearchOpt, eStt, eEnd, eFlags, bReplace );
+ BOOL bCancel = FALSE;
+ ULONG nRet = Find( rSearchOpt, eStt, eEnd, bCancel, eFlags, bReplace );
+ if(bCancel)
+ {
+ Undo(0, 1);
+ nRet = ULONG_MAX;
+ }
+ return nRet;
}
/*------------------------------------------------------------------------
Beschreibung: Suche nach Vorlagen
@@ -278,8 +285,15 @@ ULONG SwWrtShell::SearchTempl( const String &rTempl,
if( pReplTempl )
pReplaceColl = GetParaStyle(*pReplTempl, SwWrtShell::GETSTYLE_CREATESOME );
- return Find(pColl? *pColl: GetDfltTxtFmtColl(),
- eStt,eEnd,eFlags, pReplaceColl);
+ BOOL bCancel = FALSE;
+ ULONG nRet = Find(pColl? *pColl: GetDfltTxtFmtColl(),
+ eStt,eEnd, bCancel, eFlags, pReplaceColl);
+ if(bCancel)
+ {
+ Undo(0, 1);
+ nRet = ULONG_MAX;
+ }
+ return nRet;
}
// Suche nach Attributen ----------------------------------------------------
@@ -296,7 +310,15 @@ ULONG SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, BOOL bNoColls,
ClearMark();
// Suchen
- return Find( rFindSet, bNoColls, eStart, eEnde, eFlags, pSearchOpt, pReplaceSet);
+ BOOL bCancel = FALSE;
+ ULONG nRet = Find( rFindSet, bNoColls, eStart, eEnde, bCancel, eFlags, pSearchOpt, pReplaceSet);
+
+ if(bCancel)
+ {
+ Undo(0, 1);
+ nRet = ULONG_MAX;
+ }
+ return nRet;
}
// ---------- Selektionsmodi ----------