diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-12 12:00:44 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-06-27 14:02:12 +0200 |
commit | 3ed6eb923ccab39fdc5f835198200a0b07caf92a (patch) | |
tree | 86d673cef19a3a0b1827ba10b1c78d3260834562 /lotuswordpro | |
parent | 3321b50cbcf2b1d29f1b3c430cf1c164aba343fa (diff) |
ofz: use our own OString instead
Reviewed-on: https://gerrit.libreoffice.org/37535
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@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@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 490a3e3bd98b300b5805891084fb7f09442ac7ea)
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/benlist.cxx | 6 | ||||
-rw-r--r-- | lotuswordpro/source/filter/benname.cxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/bento.hxx | 14 | ||||
-rw-r--r-- | lotuswordpro/source/filter/first.hxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/tocread.cxx | 8 |
5 files changed, 18 insertions, 16 deletions
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; } |