summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/chgviset.hxx10
-rw-r--r--sc/inc/global.hxx17
-rw-r--r--sc/inc/table.hxx15
-rw-r--r--sc/source/core/data/global2.cxx12
-rw-r--r--sc/source/core/data/table1.cxx6
-rw-r--r--sc/source/core/data/table3.cxx9
-rw-r--r--sc/source/core/data/table6.cxx28
-rw-r--r--sc/source/core/tool/chgviset.cxx12
-rw-r--r--sc/source/core/tool/interpr1.cxx10
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx9
10 files changed, 76 insertions, 52 deletions
diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx
index ecc3f0691d05..87d595e5a508 100644
--- a/sc/inc/chgviset.hxx
+++ b/sc/inc/chgviset.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: chgviset.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:48 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:26:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,13 +77,15 @@ enum ScChgsDateMode{ SCDM_DATE_BEFORE=0,SCDM_DATE_SINCE=1,SCDM_DATE_EQUAL=2,
SCDM_DATE_NOTEQUAL=3,SCDM_DATE_BETWEEN=4, SCDM_DATE_SAVE=5,
SCDM_NO_DATEMODE=6};
-class SearchText;
+namespace utl {
+ class TextSearch;
+}
class ScChangeViewSettings
{
private:
- SearchText* pCommentSearcher;
+ utl::TextSearch* pCommentSearcher;
DateTime aFirstDateTime;
DateTime aLastDateTime;
String aAuthorToShow;
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 7151ee616b44..25fd5af59d97 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: global.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2000-10-26 18:55:06 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:26:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1376,8 +1376,11 @@ struct ScSortParam
#define SC_EMPTYFIELDS ((double)0x0042)
#define SC_NONEMPTYFIELDS ((double)0x0043)
-class SearchParam;
-class SearchText;
+namespace utl
+{
+ class SearchParam;
+ class TextSearch;
+}
struct ScQueryEntry
{
@@ -1388,15 +1391,15 @@ struct ScQueryEntry
ScQueryConnect eConnect;
String* pStr;
double nVal;
- SearchParam* pSearchParam; // falls RegExp, nicht gespeichert
- SearchText* pSearchText; // falls RegExp, nicht gespeichert
+ utl::SearchParam* pSearchParam; // falls RegExp, nicht gespeichert
+ utl::TextSearch* pSearchText; // falls RegExp, nicht gespeichert
ScQueryEntry();
ScQueryEntry(const ScQueryEntry& r);
~ScQueryEntry();
// legt ggbf. pSearchParam und pSearchText an, immer RegExp!
- SearchText* GetSearchTextPtr( BOOL bCaseSens );
+ utl::TextSearch* GetSearchTextPtr( BOOL bCaseSens );
void Clear();
ScQueryEntry& operator=( const ScQueryEntry& r );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index e384aaf1cceb..0fbff1905f9e 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: table.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:44:50 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:26:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,8 +73,11 @@
#include "column.hxx"
#endif
-class SearchParam;
-class SearchText;
+namespace utl {
+ class SearchParam;
+ class TextSearch;
+}
+
class SfxItemSet;
class SfxStyleSheetBase;
class SvxBoxInfoItem;
@@ -149,8 +152,8 @@ private:
USHORT nTab;
USHORT nRecalcLvl; // Rekursionslevel Size-Recalc
ScDocument* pDocument;
- SearchParam* pSearchParam;
- SearchText* pSearchText;
+ utl::SearchParam* pSearchParam;
+ utl::TextSearch* pSearchText;
// SortierParameter um den Stackbedarf von Quicksort zu Minimieren
ScSortParam aSortParam;
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index bbaba4b53721..42d3c5fe36b9 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: global2.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: nn $ $Date: 2000-10-26 18:58:10 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:28:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,7 +69,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
-#include <svtools/txtcmp.hxx>
+#include <unotools/textsearch.hxx>
#include <svtools/pathoptions.hxx>
#include <svtools/useroptions.hxx>
#include <tools/intn.hxx>
@@ -498,13 +498,13 @@ void ScQueryEntry::Store( SvStream& rStream ) const
rStream.WriteByteString( *pStr, rStream.GetStreamCharSet() );
}
-SearchText* ScQueryEntry::GetSearchTextPtr( BOOL bCaseSens )
+utl::TextSearch* ScQueryEntry::GetSearchTextPtr( BOOL bCaseSens )
{
if ( !pSearchParam )
{
- pSearchParam = new SearchParam( *pStr, SearchParam::SRCH_REGEXP,
+ pSearchParam = new utl::SearchParam( *pStr, utl::SearchParam::SRCH_REGEXP,
bCaseSens, FALSE, FALSE );
- pSearchText = new SearchText( *pSearchParam, *ScGlobal::pScInternational );
+ pSearchText = new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass );
}
return pSearchText;
}
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index d7afea41a45d..84ab5a5d5a40 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: table1.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:16:15 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:28:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -127,7 +127,7 @@
// INCLUDE ---------------------------------------------------------------
#include "scitems.hxx"
-#include <svtools/txtcmp.hxx>
+#include <unotools/textsearch.hxx>
#include <sfx2/objsh.hxx>
#include "attrib.hxx"
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 8fdc072e6351..16769ce85b41 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: table3.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2000-09-29 15:48:30 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:28:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,7 +68,7 @@
// INCLUDE ---------------------------------------------------------------
#include <tools/solmath.hxx>
-#include <svtools/txtcmp.hxx>
+#include <unotools/textsearch.hxx>
#include <svtools/zforlist.hxx>
#include <unotools/charclass.hxx>
#include <stdlib.h>
@@ -933,8 +933,9 @@ BOOL ScTable::ValidQuery(USHORT nRow, const ScQueryParam& rParam, BOOL* pSpecial
xub_StrLen nEnd = aCellStr.Len();
bOk = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens )
->SearchFrwrd( aCellStr, &nStart, &nEnd );
+ // from 614 on, nEnd is behind the found text
if ( bOk && bMatchWholeCell
- && (nStart != 0 || nEnd != aCellStr.Len()-1) )
+ && (nStart != 0 || nEnd != aCellStr.Len()) )
bOk = FALSE; // RegExp muss ganze Zelle matchen
if ( rEntry.eOp == SC_NOT_EQUAL )
bOk = !bOk;
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index d4ae3dcd07b1..5ed4cf76f543 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: table6.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2000-11-10 10:05:10 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:28:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,7 +67,7 @@
// INCLUDE ---------------------------------------------------------------
-#include <svtools/txtcmp.hxx>
+#include <unotools/textsearch.hxx>
#include "table.hxx"
#include "collect.hxx"
@@ -173,9 +173,16 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, USHORT nCol, USHORT n
{
xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp;
bFound = (BOOL)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd));
+ // change results to definition before 614:
+ nTemp=nStart; nStart=nEnd; nEnd=nTemp;
+ ++nStart;
}
else
+ {
bFound = (BOOL)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd));
+ // change results to definition before 614:
+ --nEnd;
+ }
if (bFound && rSearchItem.GetWordOnly())
bFound = (nStart == 0 && nEnd == aString.Len() - 1);
@@ -251,9 +258,16 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, USHORT nCol, USHORT n
{
xub_StrLen nTemp=nStart; nStart=nEnd; nEnd=nTemp;
bRepeat = ((BOOL)(pSearchText->SearchBkwrd(aString, &nStart, &nEnd)));
+ // change results to definition before 614:
+ nTemp=nStart; nStart=nEnd; nEnd=nTemp;
+ ++nStart;
}
else
+ {
bRepeat = ((BOOL)(pSearchText->SearchFrwrd(aString, &nStart, &nEnd)));
+ // change results to definition before 614:
+ --nEnd;
+ }
}
}
while (bRepeat);
@@ -697,18 +711,18 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem,
else
{
if ( rSearchItem.GetRegExp() )
- pSearchParam = new SearchParam(rSearchItem.GetSearchString(), SearchParam::SRCH_REGEXP, rSearchItem.GetExact(), FALSE, FALSE);
+ pSearchParam = new utl::SearchParam(rSearchItem.GetSearchString(), utl::SearchParam::SRCH_REGEXP, rSearchItem.GetExact(), FALSE, FALSE);
else if ( rSearchItem.IsLevenshtein() )
{
- pSearchParam = new SearchParam(rSearchItem.GetSearchString(), SearchParam::SRCH_LEVDIST, rSearchItem.GetExact(), FALSE, FALSE);
+ pSearchParam = new utl::SearchParam(rSearchItem.GetSearchString(), utl::SearchParam::SRCH_LEVDIST, rSearchItem.GetExact(), FALSE, FALSE);
pSearchParam->SetSrchRelaxed( rSearchItem.IsLEVRelaxed() );
pSearchParam->SetLEVOther( rSearchItem.GetLEVOther() );
pSearchParam->SetLEVShorter( rSearchItem.GetLEVShorter() );
pSearchParam->SetLEVLonger( rSearchItem.GetLEVLonger() );
}
else
- pSearchParam = new SearchParam(rSearchItem.GetSearchString(), SearchParam::SRCH_NORMAL, rSearchItem.GetExact(), FALSE, FALSE);
- pSearchText = new SearchText( *pSearchParam, *ScGlobal::pScInternational );
+ pSearchParam = new utl::SearchParam(rSearchItem.GetSearchString(), utl::SearchParam::SRCH_NORMAL, rSearchItem.GetExact(), FALSE, FALSE);
+ pSearchText = new utl::TextSearch( *pSearchParam, *ScGlobal::pCharClass );
if (nCommand == SVX_SEARCHCMD_FIND)
bFound = Search(rSearchItem, rCol, rRow, rMark, rUndoStr, pUndoDoc);
else if (nCommand == SVX_SEARCHCMD_FIND_ALL)
diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx
index f67d793cc4f7..5bddd6be0a5f 100644
--- a/sc/source/core/tool/chgviset.cxx
+++ b/sc/source/core/tool/chgviset.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: chgviset.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:16:17 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:29:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,7 +65,7 @@
#pragma hdrstop
-#include <svtools/txtcmp.hxx>
+#include <unotools/textsearch.hxx>
#include "chgviset.hxx"
#include "rechead.hxx"
@@ -143,10 +143,10 @@ void ScChangeViewSettings::SetTheComment(const String& rString)
if(rString.Len()>0)
{
- SearchParam aSearchParam( rString,
- SearchParam::SRCH_REGEXP,FALSE,FALSE,FALSE );
+ utl::SearchParam aSearchParam( rString,
+ utl::SearchParam::SRCH_REGEXP,FALSE,FALSE,FALSE );
- pCommentSearcher=new SearchText( aSearchParam, *ScGlobal::pScInternational );
+ pCommentSearcher = new utl::TextSearch( aSearchParam, *ScGlobal::pCharClass );
}
}
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 738a6f0911ae..211db575c36b 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: interpr1.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:16:17 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:29:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,7 +75,7 @@
#include "scitems.hxx"
#include <svx/langitem.hxx>
-#include <svtools/txtcmp.hxx>
+#include <unotools/textsearch.hxx>
#include <svtools/zforlist.hxx>
#include <tools/intn.hxx>
#include <tools/solar.h>
@@ -4997,8 +4997,8 @@ void ScInterpreter::ScSearch()
SetNoValue();
else
{
- SearchParam sPar(SearchStr, SearchParam::SRCH_REGEXP, FALSE, FALSE, FALSE);
- SearchText sT( sPar, *ScGlobal::pScInternational );
+ utl::SearchParam sPar(SearchStr, utl::SearchParam::SRCH_REGEXP, FALSE, FALSE, FALSE);
+ utl::TextSearch sT( sPar, *ScGlobal::pCharClass );
int nBool = sT.SearchFrwrd(sStr, &nPos, &nEndPos);
if (!nBool)
SetNoValue();
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 7d6f2be4e2a4..14596db7d269 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acredlin.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: hr $ $Date: 2000-11-14 16:35:36 $
+ * last change: $Author: nn $ $Date: 2000-11-20 10:31:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,7 @@
#pragma hdrstop
#include <svtools/undo.hxx>
+#include <unotools/textsearch.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/app.hxx>
@@ -2126,8 +2127,8 @@ void ScAcceptChgDlg::InitFilter()
pTheView->SetFilterComment(pTPFilter->IsComment());
- SearchParam aSearchParam( pTPFilter->GetComment(),
- SearchParam::SRCH_REGEXP,FALSE,FALSE,FALSE );
+ utl::SearchParam aSearchParam( pTPFilter->GetComment(),
+ utl::SearchParam::SRCH_REGEXP,FALSE,FALSE,FALSE );
pTheView->SetCommentParams(&aSearchParam);