summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorSören Möller <soerenmoeller2001@gmail.com>2012-08-18 01:01:08 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-08-18 18:37:28 +0000
commitc1b73536343ae0a7b6dd940b1c8a01784c4d7a30 (patch)
treec6b39d72359be1a568eb502d7020eb9aff2afb81 /sc
parentremoved * accidentially when re-indenting :-/ (diff)
downloadcore-c1b73536343ae0a7b6dd940b1c8a01784c4d7a30.tar.gz
core-c1b73536343ae0a7b6dd940b1c8a01784c4d7a30.zip
Partial replaced String with OUString in ScInterpreter
Added wrapper using OUString instead of String to textsearch Change-Id: I866a109d60085da67ffa2fed3131c4e60b074bbf Reviewed-on: https://gerrit.libreoffice.org/425 Reviewed-by: Kohei Yoshida <kohei.yoshida@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/inc/interpre.hxx3
-rw-r--r--sc/source/core/tool/interpr1.cxx10
2 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index d36f965c00b7..3affc4e2b479 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -31,6 +31,7 @@
#include <math.h>
#include <rtl/math.hxx>
+#include <rtl/ustring.hxx>
#include "formula/errorcodes.hxx"
#include "cell.hxx"
#include "scdll.hxx"
@@ -107,7 +108,7 @@ public:
/// If pDoc!=NULL the document options are taken into account and if
/// RegularExpressions are disabled the function returns false regardless
/// of the string content.
- static bool MayBeRegExp( const String& rStr, const ScDocument* pDoc );
+ static bool MayBeRegExp( const OUString& rStr, const ScDocument* pDoc );
/// Fail safe division, returning an errDivisionByZero coded into a double
/// if denominator is 0.0
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 489a53bd2d28..2fa0bb27aa06 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -7856,7 +7856,7 @@ void ScInterpreter::ScSearch()
else
fAnz = 1.0;
String sStr = GetString();
- String SearchStr = GetString();
+ OUString SearchStr = GetString();
xub_StrLen nPos = (xub_StrLen) fAnz - 1;
xub_StrLen nEndPos = sStr.Len();
if( nPos >= nEndPos )
@@ -8148,15 +8148,15 @@ void ScInterpreter::ScErrorType()
}
-bool ScInterpreter::MayBeRegExp( const String& rStr, const ScDocument* pDoc )
+bool ScInterpreter::MayBeRegExp( const OUString& rStr, const ScDocument* pDoc )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::MayBeRegExp" );
if ( pDoc && !pDoc->GetDocOptions().IsFormulaRegexEnabled() )
return false;
- if ( !rStr.Len() || (rStr.Len() == 1 && rStr.GetChar(0) != '.') )
- return false; // einzelnes Metazeichen kann keine RegExp sein
+ if ( rStr.isEmpty() || (rStr.getLength() == 1 && rStr[0] != '.') )
+ return false; // single meta characters can not be a regexp
static const sal_Unicode cre[] = { '.','*','+','?','[',']','^','$','\\','<','>','(',')','|', 0 };
- const sal_Unicode* p1 = rStr.GetBuffer();
+ const sal_Unicode* p1 = rStr.getStr();
sal_Unicode c1;
while ( ( c1 = *p1++ ) != 0 )
{