Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3117

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/17/3117/1

Remove RTL_CONSTASCII_(U)STRINGPARAM in ucb(regexp)

changed matchString() to accept OString

Change-Id: Ib1985f0b8219af139c1cea918f9bf35eeceeb1e3
---
M ucb/source/regexp/regexp.cxx
1 file changed, 14 insertions(+), 12 deletions(-)



diff --git a/ucb/source/regexp/regexp.cxx b/ucb/source/regexp/regexp.cxx
index 58ba065..98ca42f 100644
--- a/ucb/source/regexp/regexp.cxx
+++ b/ucb/source/regexp/regexp.cxx
@@ -297,8 +297,11 @@
 namespace unnamed_ucb_regexp {
 
 bool matchString(sal_Unicode const ** pBegin, sal_Unicode const * pEnd,
-                 sal_Char const * pString, size_t nStringLength)
+                 OString const &rStr )
 {
+    sal_Char const *pString = rStr.getStr();
+    sal_Int32 nStringLength = rStr.getLength();
+
     sal_Unicode const * p = *pBegin;
 
     sal_uChar const * q = reinterpret_cast< sal_uChar const * >(pString);
@@ -374,7 +377,7 @@
     if (p == pEnd)
         throw lang::IllegalArgumentException();
 
-    if (matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM(".*")))
+    if (matchString(&p, pEnd, ".*"))
     {
         if (p != pEnd)
             throw lang::IllegalArgumentException();
@@ -382,19 +385,19 @@
         return Regexp(Regexp::KIND_PREFIX, aPrefix, false, rtl::OUString(),
                       false, rtl::OUString());
     }
-    else if (matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("(.*)->")))
+    else if (matchString(&p, pEnd, "(.*)->"))
     {
         rtl::OUString aReversePrefix;
         scanStringLiteral(&p, pEnd, &aReversePrefix);
 
-        if (!matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("\\1"))
+        if (!matchString(&p, pEnd, "\\1")
             || p != pEnd)
             throw lang::IllegalArgumentException();
 
         return Regexp(Regexp::KIND_PREFIX, aPrefix, false, rtl::OUString(),
                       true, aReversePrefix);
     }
-    else if (matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("([/?#].*)?")))
+    else if (matchString(&p, pEnd, "([/?#].*)?"))
     {
         if (p != pEnd)
             throw lang::IllegalArgumentException();
@@ -402,12 +405,11 @@
         return Regexp(Regexp::KIND_AUTHORITY, aPrefix, false, rtl::OUString(),
                       false, rtl::OUString());
     }
-    else if (matchString(&p, pEnd,
-                         RTL_CONSTASCII_STRINGPARAM("(([/?#].*)?)->")))
+    else if (matchString(&p, pEnd, "(([/?#].*)?)->"))
     {
         rtl::OUString aReversePrefix;
         if (!(scanStringLiteral(&p, pEnd, &aReversePrefix)
-              && matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("\\1"))
+              && matchString(&p, pEnd, "\\1")
               && p == pEnd))
             throw lang::IllegalArgumentException();
 
@@ -423,7 +425,7 @@
             bOpen = true;
         }
 
-        if (!matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("[^/?#]")))
+        if (!matchString(&p, pEnd, "[^/?#]"))
             throw lang::IllegalArgumentException();
 
         if (p == pEnd || (*p != '*' && *p != '+'))
@@ -433,14 +435,14 @@
         rtl::OUString aInfix;
         scanStringLiteral(&p, pEnd, &aInfix);
 
-        if (!matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("([/?#].*)?")))
+        if (!matchString(&p, pEnd, "([/?#].*)?"))
             throw lang::IllegalArgumentException();
 
         rtl::OUString aReversePrefix;
         if (bOpen
-            && !(matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM(")->"))
+            && !(matchString(&p, pEnd, ")->")
                  && scanStringLiteral(&p, pEnd, &aReversePrefix)
-                 && matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("\\1"))))
+                 && matchString(&p, pEnd, "\\1")))
             throw lang::IllegalArgumentException();
 
         if (p != pEnd)

-- 
To view, visit https://gerrit.libreoffice.org/3117
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1985f0b8219af139c1cea918f9bf35eeceeb1e3
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christina Roßmanith <ChrRossmanith@web.de>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.