diff options
Diffstat (limited to 'lotuswordpro/source/filter/lwpidxmgr.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwpidxmgr.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx b/lotuswordpro/source/filter/lwpidxmgr.cxx index 94cd789e8fd0..c38c1a16bacf 100644 --- a/lotuswordpro/source/filter/lwpidxmgr.cxx +++ b/lotuswordpro/source/filter/lwpidxmgr.cxx @@ -68,6 +68,7 @@ #include "lwpidxmgr.hxx" #include "lwptools.hxx" +#include <memory> const sal_uInt8 LwpIndexManager::MAXOBJECTIDS = 255; @@ -246,19 +247,17 @@ void LwpIndexManager::ReadObjIndex( LwpSvStream *pStrm ) LwpObjectHeader ObjHdr; ObjHdr.Read(*pStrm); - LwpObjectStream* pObjStrm = new LwpObjectStream(pStrm, ObjHdr.IsCompressed(), - static_cast<sal_uInt16>(ObjHdr.GetSize()) ); + std::unique_ptr<LwpObjectStream> pObjStrm( new LwpObjectStream(pStrm, ObjHdr.IsCompressed(), + static_cast<sal_uInt16>(ObjHdr.GetSize()) ) ); if( (sal_uInt32)VO_OBJINDEX == ObjHdr.GetTag() ) { - ReadObjIndexData( pObjStrm ); + ReadObjIndexData( pObjStrm.get() ); } else if( (sal_uInt32)VO_LEAFOBJINDEX == ObjHdr.GetTag() ) { - ReadLeafData(pObjStrm); + ReadLeafData( pObjStrm.get() ); } - - delete pObjStrm; } /** @@ -268,12 +267,10 @@ void LwpIndexManager::ReadLeafIndex( LwpSvStream *pStrm ) { LwpObjectHeader ObjHdr; ObjHdr.Read(*pStrm); - LwpObjectStream* pObjStrm = new LwpObjectStream(pStrm, ObjHdr.IsCompressed(), - static_cast<sal_uInt16>(ObjHdr.GetSize()) ); - - ReadLeafData(pObjStrm); + std::unique_ptr<LwpObjectStream> pObjStrm( new LwpObjectStream(pStrm, ObjHdr.IsCompressed(), + static_cast<sal_uInt16>(ObjHdr.GetSize()) ) ); - delete pObjStrm; + ReadLeafData(pObjStrm.get()); } /** * @descr Read data in VO_LEAFOBJINDEX |