[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Tue Jun 20 20:03:33 UTC 2017


 lotuswordpro/source/filter/benlist.cxx |    6 +++---
 lotuswordpro/source/filter/bento.hxx   |    2 +-
 lotuswordpro/source/filter/first.hxx   |    2 +-
 lotuswordpro/source/filter/tocread.cxx |    8 +++++---
 4 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit da2f237ab232f01cb21c9d79c53c6921da4e0135
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 19 09:46:31 2017 +0100

    ofz: use OString instead of bare char*
    
    Change-Id: I2f7bfbd62c0a5477f0cbb38e86684db4fdb9c37f
    Reviewed-on: https://gerrit.libreoffice.org/38953
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx
index c80013ff293a..e092c7cf6cd1 100644
--- a/lotuswordpro/source/filter/benlist.cxx
+++ b/lotuswordpro/source/filter/benlist.cxx
@@ -58,7 +58,7 @@ namespace OpenStormBento
 {
 
 CBenNamedObject *
-FindNamedObject(CUtList * pList, const char * sName,
+FindNamedObject(CUtList * pList, const OString& rName,
   CUtListElmt ** ppPrev)
 {
     CUtListElmt& rTerminating = pList->GetTerminating();
@@ -68,8 +68,8 @@ FindNamedObject(CUtList * pList, const char * sName,
         CBenNamedObjectListElmt * pCurrNamedObjectListElmt =
           static_cast<CBenNamedObjectListElmt *>(pCurr);
 
-        int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()->
-          GetNameCStr());
+        sal_Int32 Comp = rName.compareTo(pCurrNamedObjectListElmt->GetNamedObject()->
+          GetName());
 
         if (Comp == 0)
             return pCurrNamedObjectListElmt->GetNamedObject();
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
index 2082897b09e4..53fce5379622 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -347,7 +347,7 @@ public: // Internal methods
     CUtListElmt * pPrevObject, const OString& rName,
     CUtListElmt * pPrevNamedObjectListElmt);
 
-    const char * GetNameCStr() { return csName.getStr(); }
+    const OString& GetName() { return csName; }
 
 private: // Data
     OString csName;
diff --git a/lotuswordpro/source/filter/first.hxx b/lotuswordpro/source/filter/first.hxx
index 54c55e33e69f..3b412b52e05a 100644
--- a/lotuswordpro/source/filter/first.hxx
+++ b/lotuswordpro/source/filter/first.hxx
@@ -64,7 +64,7 @@ namespace OpenStormBento
 // String constants
 extern const char gsBenMagicBytes[];
 
-CBenNamedObject * FindNamedObject(CUtList * pList, const char * sName,
+CBenNamedObject * FindNamedObject(CUtList * pList, const OString& rName,
   CUtListElmt ** ppPrev);
 
 CBenIDListElmt * FindID(CUtList * pList, BenObjectID ObjectID,
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index ffd1bb52d409..be8a7b1d264c 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -296,9 +296,11 @@ CBenTOCReader::ReadTOC()
                         return Err;
                     }
 
+                    OString sName(sBuffer, Length);
+
                     CUtListElmt * pPrevNamedObjectListElmt;
                     if (FindNamedObject(&cpContainer->GetNamedObjects(),
-                      sBuffer, &pPrevNamedObjectListElmt) != nullptr)
+                      sName, &pPrevNamedObjectListElmt) != nullptr)
                     {
                         delete[] sAllocBuffer;
                         return BenErr_DuplicateName;
@@ -309,9 +311,9 @@ CBenTOCReader::ReadTOC()
 
                     if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME)
                         pObject = new CBenPropertyName(cpContainer, ObjectID,
-                          pPrevObject, OString(sBuffer, Length), pPrevNamedObjectListElmt);
+                          pPrevObject, sName, pPrevNamedObjectListElmt);
                     else pObject = new CBenTypeName(cpContainer, ObjectID,
-                      pPrevObject, OString(sBuffer, Length), pPrevNamedObjectListElmt);
+                      pPrevObject, sName, pPrevNamedObjectListElmt);
 
                     delete[] sAllocBuffer;
                 }


More information about the Libreoffice-commits mailing list