[Libreoffice-commits] core.git: forms/source

Matteo Casalin (via logerrit) logerrit at kemper.freedesktop.org
Sat Apr 6 21:42:57 UTC 2019


 forms/source/xforms/xpathlib/xpathlib.cxx |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 83f1068ff62f644bc38e54211c48c87362276012
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Mon Mar 4 16:29:53 2019 +0100
Commit:     Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Sat Apr 6 23:42:36 2019 +0200

    Use char version of OString/OStringBuffer methods
    
    Change-Id: I0222e6675f63797f870746fd34a29702ad190311
    Reviewed-on: https://gerrit.libreoffice.org/69240
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx
index ac73ec7990df..6fd72e923bf0 100644
--- a/forms/source/xforms/xpathlib/xpathlib.cxx
+++ b/forms/source/xforms/xpathlib/xpathlib.cxx
@@ -234,22 +234,22 @@ static OString makeDateTimeString (const DateTime& aDateTime)
 {
     OStringBuffer aDateTimeString;
     aDateTimeString.append(static_cast<sal_Int32>(aDateTime.GetYear()));
-    aDateTimeString.append("-");
-    if (aDateTime.GetMonth()<10) aDateTimeString.append("0");
+    aDateTimeString.append('-');
+    if (aDateTime.GetMonth()<10) aDateTimeString.append('0');
     aDateTimeString.append(static_cast<sal_Int32>(aDateTime.GetMonth()));
-    aDateTimeString.append("-");
-    if (aDateTime.GetDay()<10) aDateTimeString.append("0");
+    aDateTimeString.append('-');
+    if (aDateTime.GetDay()<10) aDateTimeString.append('0');
     aDateTimeString.append(static_cast<sal_Int32>(aDateTime.GetDay()));
-    aDateTimeString.append("T");
-    if (aDateTime.GetHour()<10) aDateTimeString.append("0");
+    aDateTimeString.append('T');
+    if (aDateTime.GetHour()<10) aDateTimeString.append('0');
     aDateTimeString.append(static_cast<sal_Int32>(aDateTime.GetHour()));
-    aDateTimeString.append(":");
-    if (aDateTime.GetMin()<10) aDateTimeString.append("0");
+    aDateTimeString.append(':');
+    if (aDateTime.GetMin()<10) aDateTimeString.append('0');
     aDateTimeString.append(static_cast<sal_Int32>(aDateTime.GetMin()));
-    aDateTimeString.append(":");
-    if (aDateTime.GetSec()<10) aDateTimeString.append("0");
+    aDateTimeString.append(':');
+    if (aDateTime.GetSec()<10) aDateTimeString.append('0');
     aDateTimeString.append(static_cast<sal_Int32>(aDateTime.GetSec()));
-    aDateTimeString.append("Z");
+    aDateTimeString.append('Z');
 
     return aDateTimeString.makeStringAndClear();
 }
@@ -305,7 +305,7 @@ static bool parseDateTime(const OUString& aString, DateTime& aDateTime)
     Date tmpDate(static_cast<sal_uInt16>(nDay), static_cast<sal_uInt16>(nMonth), static_cast<sal_uInt16>(nYear));
     tools::Time tmpTime(nHour, nMinute, nSecond);
     DateTime tmpDateTime(tmpDate, tmpTime);
-    if (aString.indexOf("Z") < 0)
+    if (aString.lastIndexOf('Z') < 0)
         tmpDateTime.ConvertToUTC();
 
     aDateTime = tmpDateTime;


More information about the Libreoffice-commits mailing list