summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-10-27 22:06:18 +0100
committerEike Rathke <erack@redhat.com>2020-10-31 11:46:02 +0100
commita36f606ab319148fef0231e74345001289710feb (patch)
treee9bf4e464cf9abab197e976324b2a0912f1b622d /sc
parent7ca79cfca0667b5173fd96889304d98a5fbb2ce2 (diff)
Reintroduce ScGlobal::FindUnquoted() nStart parameter
That got removed early as unused but will be needed. Change-Id: I71c028bb92f337b10366b3eac44d3eacbf1e1355 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105088 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/global.hxx4
-rw-r--r--sc/source/core/data/global.cxx5
2 files changed, 5 insertions, 4 deletions
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 84f0d9b4c2d8..e4560fd6c359 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -651,10 +651,10 @@ public:
quoted strings with a separator, for example, 's1':'s2'. Embedded
quotes have to be escaped by being doubled. Caller must ensure that
nStart points into an unquoted range or the opening quote. Specialty:
- if cChar==cQuote the first cQuote character from nStart on is found.
+ if cChar=='\'' the first quote character from nStart on is found.
@returns offset if found, else -1
*/
- SC_DLLPUBLIC static sal_Int32 FindUnquoted( const OUString& rString, sal_Unicode cChar);
+ SC_DLLPUBLIC static sal_Int32 FindUnquoted( const OUString& rString, sal_Unicode cChar, sal_Int32 nStart = 0 );
/** Finds an unquoted instance of cChar in null-terminated pString. Same
semantics as FindUnquoted( const String&, ...)
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 8b1dafe94e87..b53afafb6324 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -697,12 +697,13 @@ void ScGlobal::EraseQuotes( OUString& rString, sal_Unicode cQuote, bool bUnescap
}
}
-sal_Int32 ScGlobal::FindUnquoted( const OUString& rString, sal_Unicode cChar)
+sal_Int32 ScGlobal::FindUnquoted( const OUString& rString, sal_Unicode cChar, sal_Int32 nStart )
{
+ assert(nStart >= 0);
const sal_Unicode cQuote = '\'';
const sal_Unicode* const pStart = rString.getStr();
const sal_Unicode* const pStop = pStart + rString.getLength();
- const sal_Unicode* p = pStart;
+ const sal_Unicode* p = pStart + nStart;
bool bQuoted = false;
while (p < pStop)
{