[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwpfrib.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1db17a71b028c392a00393cdf313e1720b93fd2e Author: Caolán McNamaraDate: Fri Apr 13 14:33:27 2018 +0100 ofz#7648 Bad-cast Change-Id: I21aaf36f3d6b6c3054649208de809b99aa384c01 Reviewed-on: https://gerrit.libreoffice.org/52836 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index f97d9041f9c9..c3dd7f176387 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -251,7 +251,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) XFTextStyle* pNamedStyle = nullptr; if (m_pModifiers->HasCharStyle && pFoundry) { -pNamedStyle = static_cast +pNamedStyle = dynamic_cast (pFoundry->GetStyleManager()->GetStyle(m_pModifiers->CharStyleID)); } if (pNamedStyle) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwpbookmarkmgr.cxx | 29 +++--- lotuswordpro/source/filter/lwpbookmarkmgr.hxx |4 +-- 2 files changed, 15 insertions(+), 18 deletions(-) New commits: commit 919ff229ff33b0b23b30ee963e9f96f46fe9e1a2 Author: Caolán McNamaraDate: Thu Mar 22 10:35:18 2018 + ofz#7063 ensure lifecycle Change-Id: I18d62bc3bd409ca65c85ea47e8d5b3930481edf9 Reviewed-on: https://gerrit.libreoffice.org/51734 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lotuswordpro/source/filter/lwpbookmarkmgr.cxx b/lotuswordpro/source/filter/lwpbookmarkmgr.cxx index bfec019fbfd4..19586f4cbe7c 100644 --- a/lotuswordpro/source/filter/lwpbookmarkmgr.cxx +++ b/lotuswordpro/source/filter/lwpbookmarkmgr.cxx @@ -57,44 +57,41 @@ void LwpBookmarkMgr::AddXFBookmarkStart(const OUString& sName,XFBookmarkStart* pMark) { -std::map ::iterator iter; -iter = m_MapStart.find(sName); +auto iter = m_MapStart.find(sName); if (iter == m_MapStart.end())//not find { m_MapStart[sName] = pMark; } else //have exist the same bookmark name { -XFBookmarkStart* pFind = iter->second; -OUString totalName = pFind->GetDivision() + ":"; -totalName += pFind->GetName(); -pFind->SetName(totalName); -m_MapStart[totalName] = pFind; +auto xFind = iter->second; +OUString totalName = xFind->GetDivision() + ":"; +totalName += xFind->GetName(); +xFind->SetName(totalName); +m_MapStart[totalName] = xFind; m_MapStart[sName] = pMark; } } void LwpBookmarkMgr::AddXFBookmarkEnd(const OUString& sName,XFBookmarkEnd* pMark) { -std::map ::iterator iter; -iter = m_MapEnd.find(sName); +auto iter = m_MapEnd.find(sName); if (iter == m_MapEnd.end())//not find { m_MapEnd[sName] = pMark; } else //have exist the same bookmark name { -XFBookmarkEnd* pFind = iter->second; -OUString totalName = pFind->GetDivision() + ":"; -totalName += pFind->GetName(); -pFind->SetName(totalName); -m_MapEnd[totalName] = pFind; +auto xFind = iter->second; +OUString totalName = xFind->GetDivision() + ":"; +totalName += xFind->GetName(); +xFind->SetName(totalName); +m_MapEnd[totalName] = xFind; m_MapEnd[sName] = pMark; } } bool LwpBookmarkMgr::FindBookmark(const OUString& sName) { -std::map ::iterator iter; -iter = m_MapStart.find(sName); +auto iter = m_MapStart.find(sName); return iter != m_MapStart.end(); } diff --git a/lotuswordpro/source/filter/lwpbookmarkmgr.hxx b/lotuswordpro/source/filter/lwpbookmarkmgr.hxx index 6f471b7302b1..509a75ce7a91 100644 --- a/lotuswordpro/source/filter/lwpbookmarkmgr.hxx +++ b/lotuswordpro/source/filter/lwpbookmarkmgr.hxx @@ -75,8 +75,8 @@ public: ~LwpBookmarkMgr(); LwpBookmarkMgr(); private: -std::map m_MapStart; -std::map m_MapEnd; +std::map m_MapStart; +std::map m_MapEnd; }; #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwpchangemgr.cxx |2 ++ lotuswordpro/source/filter/lwpfrib.cxx | 18 +- lotuswordpro/source/filter/lwpfrib.hxx |4 3 files changed, 23 insertions(+), 1 deletion(-) New commits: commit f8a1dd7ae35ea0307a9282378a9300897df6fb42 Author: Caolán McNamaraDate: Fri Jan 12 09:43:41 2018 + ofz#5254 Bad-cast Change-Id: I318d441d841dd4c783f87ac2f3f699852e8b1039 Reviewed-on: https://gerrit.libreoffice.org/47805 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lotuswordpro/source/filter/lwpchangemgr.cxx b/lotuswordpro/source/filter/lwpchangemgr.cxx index 30b272e35ccc..cbd9b58aa805 100644 --- a/lotuswordpro/source/filter/lwpchangemgr.cxx +++ b/lotuswordpro/source/filter/lwpchangemgr.cxx @@ -89,6 +89,7 @@ LwpChangeMgr::LwpChangeMgr() m_pFribMap = _DocFribMap; m_ChangeList.clear(); } + LwpChangeMgr::~LwpChangeMgr() { m_pFribMap=nullptr; @@ -102,6 +103,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib) m_nCounter++; OUString sID = "ct"+ OUString::number(m_nCounter); m_pFribMap->insert(std::pair (pFrib,sID)); +pFrib->Register(m_pFribMap); } OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib) diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index bd951118d48d..baebf753ed03 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -87,7 +87,8 @@ LwpFrib::LwpFrib(LwpPara* pPara) -: m_pPara(pPara) +: m_pFribMap(nullptr) +, m_pPara(pPara) , m_pNext(nullptr) , m_nFribType(0) , m_pModifiers(nullptr) @@ -100,6 +101,7 @@ LwpFrib::LwpFrib(LwpPara* pPara) LwpFrib::~LwpFrib() { +Deregister(); } LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag,sal_uInt8 editID) @@ -447,4 +449,18 @@ XFColor LwpFrib::GetHighlightColor() return pGlobal->GetHighlightColor(m_nEditor); } +void LwpFrib::Register(std::map * pFribMap) +{ +m_pFribMap = pFribMap; +} + +void LwpFrib::Deregister() +{ +if (m_pFribMap) +{ +m_pFribMap->erase(this); +m_pFribMap = nullptr; +} +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/source/filter/lwpfrib.hxx b/lotuswordpro/source/filter/lwpfrib.hxx index 910f85dee08f..6fde006a649e 100644 --- a/lotuswordpro/source/filter/lwpfrib.hxx +++ b/lotuswordpro/source/filter/lwpfrib.hxx @@ -97,6 +97,7 @@ public: OUString GetEditor(); XFColor GetHighlightColor(); protected: +std::map * m_pFribMap; LwpPara* m_pPara; LwpFrib* m_pNext; sal_uInt8 m_nFribType; @@ -119,6 +120,9 @@ public: REV_INSERT =0, REV_DELETE = 1, }; + +void Register(std::map * pFribMap); +void Deregister(); private: static void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* pModInfo); protected: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwpsilverbullet.hxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 44c3ef7aebb13b9c0a2cfcf9a1879fb6158e6e83 Author: Caolán McNamaraDate: Thu Jan 4 10:14:30 2018 + ofz#4946 keep nPos within bounds Change-Id: Ib5dc37b489b7b2101cf852a46f48fff1b7447a30 Reviewed-on: https://gerrit.libreoffice.org/47379 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx index f130d46c6a75..2d49e66b5ee3 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.hxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx @@ -155,7 +155,9 @@ inline const OUString& LwpSilverBullet::GetBulletStyleName() const } inline bool LwpSilverBullet::IsLesserLevel(sal_uInt16 nPos) { -return ((m_pResetPositionFlags[nPos] & LESSERLEVEL) != 0); +if (nPos < SAL_N_ELEMENTS(m_pResetPositionFlags)) +return ((m_pResetPositionFlags[nPos] & LESSERLEVEL) != 0); +return false; } #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwplayout.cxx | 16 +++- lotuswordpro/source/filter/lwplayout.hxx |1 + 2 files changed, 12 insertions(+), 5 deletions(-) New commits: commit a71ce08da071a205aba15c32ae9c42b4b5e44018 Author: Caolán McNamaraDate: Tue Dec 19 09:18:54 2017 + ofz#4689 avoid recurse to death Change-Id: Ie578a767cd8646c4e67c302a67b46ce1f1637122 Reviewed-on: https://gerrit.libreoffice.org/46774 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 6f0fec06c58b..b000fdbda6c1 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -1942,6 +1942,7 @@ rtl::Reference LwpLayout::GetContainerLayout() LwpPlacableLayout::LwpPlacableLayout( LwpObjectHeader , LwpSvStream* pStrm ) : LwpLayout(objHdr, pStrm) , m_bGettingWrapType(false) +, m_bGettingLayoutRelativity(false) , m_nWrapType(0) , m_nBuoyancy(0) , m_nBaseLineOffset(0) @@ -2021,11 +2022,15 @@ sal_uInt8 LwpPlacableLayout::GetWrapType() */ LwpLayoutRelativity* LwpPlacableLayout::GetRelativityPiece() { -if(!m_LayRelativity.IsNull()) +if (m_bGettingLayoutRelativity) +throw std::runtime_error("recursion in layout"); +m_bGettingLayoutRelativity = true; +LwpLayoutRelativity* pRet = nullptr; +if (!m_LayRelativity.IsNull()) { -if(m_nOverrideFlag & OVER_PLACEMENT) +if (m_nOverrideFlag & OVER_PLACEMENT) { -return dynamic_cast (m_LayRelativity.obj().get()); +pRet = dynamic_cast (m_LayRelativity.obj().get()); } } else @@ -2033,10 +2038,11 @@ LwpLayoutRelativity* LwpPlacableLayout::GetRelativityPiece() rtl::Reference xBase(GetBasedOnStyle()); if (LwpPlacableLayout* pLay = dynamic_cast (xBase.get())) { -return pLay->GetRelativityPiece(); +pRet = pLay->GetRelativityPiece(); } } -return nullptr; +m_bGettingLayoutRelativity = false; +return pRet; } /** * @descr: Get relative type diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 2fdfb421362e..1a46b6ab3d07 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -497,6 +497,7 @@ protected: void Read() override; protected: bool m_bGettingWrapType; +bool m_bGettingLayoutRelativity; sal_uInt8 m_nWrapType; sal_uInt8 m_nBuoyancy; sal_Int32 m_nBaseLineOffset; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwplayout.cxx | 14 ++ lotuswordpro/source/filter/lwplayout.hxx |1 + 2 files changed, 11 insertions(+), 4 deletions(-) New commits: commit 465c432599e68f84b86a221c14074830f8c82083 Author: Caolán McNamaraDate: Tue Dec 12 09:51:55 2017 + ofz#4600 avoid recurse to death Change-Id: I3cdced8294b30df5936bf7e167ca8a4950dde652 Reviewed-on: https://gerrit.libreoffice.org/46286 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 6072a6955ab5..6f0fec06c58b 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -1941,6 +1941,7 @@ rtl::Reference LwpLayout::GetContainerLayout() LwpPlacableLayout::LwpPlacableLayout( LwpObjectHeader , LwpSvStream* pStrm ) : LwpLayout(objHdr, pStrm) +, m_bGettingWrapType(false) , m_nWrapType(0) , m_nBuoyancy(0) , m_nBaseLineOffset(0) @@ -1996,19 +1997,24 @@ void LwpPlacableLayout::Read() */ sal_uInt8 LwpPlacableLayout::GetWrapType() { -if(m_nOverrideFlag & OVER_PLACEMENT) +if (m_bGettingWrapType) +throw std::runtime_error("recursion in layout"); +m_bGettingWrapType = true; +sal_uInt8 nWrapType = LAY_WRAP_AROUND; +if (m_nOverrideFlag & OVER_PLACEMENT) { -return m_nWrapType; +nWrapType = m_nWrapType; } else { rtl::Reference xBase(GetBasedOnStyle()); if (LwpPlacableLayout* pLay = dynamic_cast (xBase.get())) { -return pLay->GetWrapType(); +nWrapType = pLay->GetWrapType(); } } -return LAY_WRAP_AROUND; +m_bGettingWrapType = false; +return nWrapType; } /** * @descr: get LayoutRelativity diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 1a66d4e66c72..2fdfb421362e 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -496,6 +496,7 @@ public: protected: void Read() override; protected: +bool m_bGettingWrapType; sal_uInt8 m_nWrapType; sal_uInt8 m_nBuoyancy; sal_Int32 m_nBaseLineOffset; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/lwplayout.cxx | 15 --- lotuswordpro/source/filter/lwplayout.hxx |1 + 2 files changed, 13 insertions(+), 3 deletions(-) New commits: commit 1de1c5ebb450a82b24bf754764a9da041d351c2d Author: Caolán McNamaraDate: Thu Dec 7 08:56:44 2017 + ofz#4548 infinite regress in GetUsePrinterSettings Change-Id: Id4505f9a4ddc47f2eb45cb86d46fdd050b007c26 Reviewed-on: https://gerrit.libreoffice.org/46025 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index c241e84f1898..6072a6955ab5 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -81,6 +81,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader , LwpSvStream* pStrm) , m_bGettingIsProtected(false) , m_bGettingMarginsValue(false) , m_bGettingExtMarginsValue(false) +, m_bGettingUsePrinterSettings(false) , m_nAttributes(0) , m_nAttributes2(0) , m_nAttributes3(0) @@ -1431,19 +1432,27 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage() */ bool LwpMiddleLayout::GetUsePrinterSettings() { +if (m_bGettingUsePrinterSettings) +throw std::runtime_error("recursion in layout"); +m_bGettingUsePrinterSettings = true; + +bool bRet = false; + if(m_nOverrideFlag & OVER_SIZE) { -return (m_nAttributes3 & STYLE3_USEPRINTERSETTINGS) != 0; +bRet = (m_nAttributes3 & STYLE3_USEPRINTERSETTINGS) != 0; } else { rtl::Reference xBase(GetBasedOnStyle()); if (LwpMiddleLayout* pLay = dynamic_cast (xBase.get())) { -return pLay->GetUsePrinterSettings(); +bRet = pLay->GetUsePrinterSettings(); } } -return false; + +m_bGettingUsePrinterSettings = false; +return bRet; } //Check whether there are contents in the layout diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index bfd9dc097aa3..1a66d4e66c72 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -226,6 +226,7 @@ protected: bool m_bGettingIsProtected; bool m_bGettingMarginsValue; bool m_bGettingExtMarginsValue; +bool m_bGettingUsePrinterSettings; sal_uInt32 m_nAttributes; sal_uInt32 m_nAttributes2; sal_uInt32 m_nAttributes3; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
lotuswordpro/source/filter/bento.hxx |2 +- lotuswordpro/source/filter/tocread.cxx |3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) New commits: commit fecc328cc658dfb21caf4d033cb21bd436d7b368 Author: Caolán McNamaraDate: Tue Oct 24 11:52:36 2017 +0100 ofz#3745 Bad-cast Change-Id: I063646c8cce8ad5d62dc327e86e98942e57fc3f7 Reviewed-on: https://gerrit.libreoffice.org/43776 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx index 53fce5379622..f8aefc029ad4 100644 --- a/lotuswordpro/source/filter/bento.hxx +++ b/lotuswordpro/source/filter/bento.hxx @@ -369,7 +369,7 @@ class CBenTypeName : public CBenNamedObject { public: // Internal methods CBenTypeName(LtcBenContainer * pContainer, BenObjectID ObjectID, -CBenObject * pPrevObject, const OString& rName, +CUtListElmt * pPrevObject, const OString& rName, CUtListElmt * pPrevNamedObjectListElmt) : CBenNamedObject(pContainer, ObjectID, pPrevObject, rName, pPrevNamedObjectListElmt) { ; } diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx index be8a7b1d264c..cefdc00b692e 100644 --- a/lotuswordpro/source/filter/tocread.cxx +++ b/lotuswordpro/source/filter/tocread.cxx @@ -306,8 +306,7 @@ CBenTOCReader::ReadTOC() return BenErr_DuplicateName; } -CBenObject * pPrevObject = static_cast( cpContainer-> - GetObjects().GetLast()); +CUtListElmt* pPrevObject = cpContainer->GetObjects().GetLast(); if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME) pObject = new CBenPropertyName(cpContainer, ObjectID, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - lotuswordpro/source
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 McNamaraDate: 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 Reviewed-by: Christian Lohmaier 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(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(>GetNamedObjects(), - sBuffer, ) != nullptr) + sName, ) != 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; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits