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

Caolán McNamara caolanm at redhat.com
Thu Jun 22 12:38:31 UTC 2017


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

New commits:
commit 490a3e3bd98b300b5805891084fb7f09442ac7ea
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 12 12:00:44 2017 +0100

    ofz: use our own OString instead
    
    Reviewed-on: https://gerrit.libreoffice.org/37535
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit b5302844af49cc25c0720f3c2dccbdc0380d3b50)
    
    Change-Id: I583a95aea0b29878bf4749a8cb2bb684da6da1e5
    
    ofz: use OString instead of bare char*
    
    Change-Id: I2f7bfbd62c0a5477f0cbb38e86684db4fdb9c37f
    Reviewed-on: https://gerrit.libreoffice.org/38958
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx
index 242d8d14f07e..fb18bd0ea1ea 100644
--- a/lotuswordpro/source/filter/benlist.cxx
+++ b/lotuswordpro/source/filter/benlist.cxx
@@ -58,7 +58,7 @@ namespace OpenStormBento
 {
 
 pCBenNamedObject
-FindNamedObject(pCUtList pList, const char * sName,
+FindNamedObject(pCUtList pList, const OString& rName,
   pCUtListElmt * ppPrev)
 {
     CUtListElmt& rTerminating = pList->GetTerminating();
@@ -68,8 +68,8 @@ FindNamedObject(pCUtList pList, const char * sName,
         pCBenNamedObjectListElmt pCurrNamedObjectListElmt =
           static_cast<pCBenNamedObjectListElmt>(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/benname.cxx b/lotuswordpro/source/filter/benname.cxx
index 32855fbd73a3..19003a0c5f04 100644
--- a/lotuswordpro/source/filter/benname.cxx
+++ b/lotuswordpro/source/filter/benname.cxx
@@ -59,10 +59,10 @@ namespace OpenStormBento
 {
 // changed to remove warning
 CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
-  BenObjectID ObjectID, pCBenObject pPrevObject, const char * sName,
+  BenObjectID ObjectID, pCBenObject pPrevObject, const OString& rName,
   pCUtListElmt pPrevNamedObjectListElmt)
     : CBenObject(pContainer, ObjectID, pPrevObject)
-    , csName(sName)
+    , csName(rName)
     , cNameListElmt(pPrevNamedObjectListElmt)
 {
     cNameListElmt.SetNamedObject(this);
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
index af08bcb1a7ee..cb72273e4e18 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -344,13 +344,13 @@ public: // Methods
 
 public: // Internal methods
     CBenNamedObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
-    pCBenObject pPrevObject, const char * sName,
+    pCBenObject pPrevObject, const OString& rName,
     pCUtListElmt pPrevNamedObjectListElmt);
 
-    const char * GetNameCStr() { return csName.c_str(); }
+    const OString& GetName() { return csName; }
 
 private: // Data
-    std::string csName;
+    OString csName;
     CBenNamedObjectListElmt cNameListElmt;
 };
 
@@ -358,9 +358,9 @@ class CBenPropertyName : public CBenNamedObject
 {
 public: // Internal methods
     CBenPropertyName(pLtcBenContainer pContainer, BenObjectID ObjectID,
-    pCBenObject pPrevObject, const char * sName,
+    pCBenObject pPrevObject, const OString& rName,
     pCUtListElmt pPrevNamedObjectListElmt) :
-    CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
+    CBenNamedObject(pContainer, ObjectID, pPrevObject, rName,
     pPrevNamedObjectListElmt) { ; }
     virtual bool IsPropertyName() override;
 };
@@ -369,9 +369,9 @@ class CBenTypeName : public CBenNamedObject
 {
 public: // Internal methods
     CBenTypeName(pLtcBenContainer pContainer, BenObjectID ObjectID,
-    pCBenObject pPrevObject, const char * sName,
+    pCBenObject pPrevObject, const OString& rName,
     pCUtListElmt pPrevNamedObjectListElmt) :
-    CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
+    CBenNamedObject(pContainer, ObjectID, pPrevObject, rName,
     pPrevNamedObjectListElmt) { ; }
 };
 
diff --git a/lotuswordpro/source/filter/first.hxx b/lotuswordpro/source/filter/first.hxx
index 37311920a0ce..f65ed3248722 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[];
 
-pCBenNamedObject FindNamedObject(pCUtList pList, const char * sName,
+pCBenNamedObject FindNamedObject(pCUtList pList, const OString& rName,
   pCUtListElmt * ppPrev);
 
 pCBenIDListElmt FindID(pCUtList pList, BenObjectID ObjectID,
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index 73f9ccb5f329..335b82abfa0b 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -288,9 +288,11 @@ CBenTOCReader::ReadTOC()
                         return Err;
                     }
 
+                    OString sName(sBuffer, Length);
+
                     pCUtListElmt pPrevNamedObjectListElmt;
                     if (FindNamedObject(&cpContainer->GetNamedObjects(),
-                      sBuffer, &pPrevNamedObjectListElmt) != nullptr)
+                      sName, &pPrevNamedObjectListElmt) != nullptr)
                     {
                         delete[] sAllocBuffer;
                         return BenErr_DuplicateName;
@@ -301,9 +303,9 @@ CBenTOCReader::ReadTOC()
 
                     if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME)
                         pObject = new CBenPropertyName(cpContainer, ObjectID,
-                          pPrevObject, sBuffer, pPrevNamedObjectListElmt);
+                          pPrevObject, sName, pPrevNamedObjectListElmt);
                     else pObject = new CBenTypeName(cpContainer, ObjectID,
-                      pPrevObject, sBuffer, pPrevNamedObjectListElmt);
+                      pPrevObject, sName, pPrevNamedObjectListElmt);
 
                     delete[] sAllocBuffer;
                 }


More information about the Libreoffice-commits mailing list