[Libreoffice-commits] core.git: sc/inc sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 31 10:46:36 UTC 2020


 sc/inc/global.hxx              |    4 ++--
 sc/source/core/data/global.cxx |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit a36f606ab319148fef0231e74345001289710feb
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Tue Oct 27 22:06:18 2020 +0100
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Sat Oct 31 11:46:02 2020 +0100

    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 at redhat.com>

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)
     {


More information about the Libreoffice-commits mailing list