no need to allocate these on the heap

Change-Id: Ie7b8a5ee280da5dfcb15d217a4daccaf485cfbe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116588
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2021-06-02 13:24:18 +02:00
parent 3a9436ef77
commit 3d9bf9eea5
4 changed files with 18 additions and 18 deletions

View File

@@ -3712,10 +3712,10 @@ void HwpReader::makeFormula(TxtBox * hbox)
} }
mybuf[l] = '\0'; mybuf[l] = '\0';
std::unique_ptr<Formula> form( new Formula(mybuf) ); Formula form( mybuf );
form->setDocumentHandler(m_rxDocumentHandler); form.setDocumentHandler(m_rxDocumentHandler);
form->setAttributeListImpl(mxList.get()); form.setAttributeListImpl(mxList.get());
form->parse(); form.parse();
} }
/** /**

View File

@@ -93,10 +93,10 @@ static bool Decompress(SvStream* pCompressed, SvStream*& pOutDecompressed)
pCompressed->ReadBytes(buffer, 16); pCompressed->ReadBytes(buffer, 16);
aDecompressed->WriteBytes(buffer, 16); aDecompressed->WriteBytes(buffer, 16);
std::unique_ptr<LwpSvStream> aLwpStream(new LwpSvStream(pCompressed)); LwpSvStream aLwpStream(pCompressed);
std::unique_ptr<OpenStormBento::LtcBenContainer> pBentoContainer; std::unique_ptr<OpenStormBento::LtcBenContainer> pBentoContainer;
{ {
sal_uLong ulRet = BenOpenContainer(aLwpStream.get(), &pBentoContainer); sal_uLong ulRet = BenOpenContainer(&aLwpStream, &pBentoContainer);
if (ulRet != BenErr_OK) if (ulRet != BenErr_OK)
return false; return false;
} }
@@ -195,8 +195,8 @@ int ReadWordproFile(SvStream& rStream,
aLwpSvStream.reset(pRawLwpSvStream); aLwpSvStream.reset(pRawLwpSvStream);
std::unique_ptr<IXFStream> pStrm(new XFSaxStream(xHandler)); XFSaxStream aStrm(xHandler);
Lwp9Reader reader(aLwpSvStream.get(), pStrm.get()); Lwp9Reader reader(aLwpSvStream.get(), &aStrm);
//Reset all static objects,because this function may be called many times. //Reset all static objects,because this function may be called many times.
XFGlobalReset(); XFGlobalReset();
const bool bOk = reader.Read(); const bool bOk = reader.Read();

View File

@@ -229,16 +229,16 @@ void LwpIndexManager::ReadObjIndex( LwpSvStream *pStrm )
LwpObjectHeader ObjHdr; LwpObjectHeader ObjHdr;
ObjHdr.Read(*pStrm); ObjHdr.Read(*pStrm);
std::unique_ptr<LwpObjectStream> pObjStrm( new LwpObjectStream(pStrm, ObjHdr.IsCompressed(), LwpObjectStream aObjStrm(pStrm, ObjHdr.IsCompressed(),
static_cast<sal_uInt16>(ObjHdr.GetSize()) ) ); static_cast<sal_uInt16>(ObjHdr.GetSize()) );
if( sal_uInt32(VO_OBJINDEX) == ObjHdr.GetTag() ) if( sal_uInt32(VO_OBJINDEX) == ObjHdr.GetTag() )
{ {
ReadObjIndexData( pObjStrm.get() ); ReadObjIndexData( &aObjStrm );
} }
else if( sal_uInt32(VO_LEAFOBJINDEX) == ObjHdr.GetTag() ) else if( sal_uInt32(VO_LEAFOBJINDEX) == ObjHdr.GetTag() )
{ {
ReadLeafData( pObjStrm.get() ); ReadLeafData( &aObjStrm );
} }
} }
@@ -249,10 +249,10 @@ void LwpIndexManager::ReadLeafIndex( LwpSvStream *pStrm )
{ {
LwpObjectHeader ObjHdr; LwpObjectHeader ObjHdr;
ObjHdr.Read(*pStrm); ObjHdr.Read(*pStrm);
std::unique_ptr<LwpObjectStream> pObjStrm( new LwpObjectStream(pStrm, ObjHdr.IsCompressed(), LwpObjectStream aObjStrm( pStrm, ObjHdr.IsCompressed(),
static_cast<sal_uInt16>(ObjHdr.GetSize()) ) ); static_cast<sal_uInt16>(ObjHdr.GetSize()) );
ReadLeafData(pObjStrm.get()); ReadLeafData(&aObjStrm);
} }
/** /**
* @descr Read data in VO_LEAFOBJINDEX * @descr Read data in VO_LEAFOBJINDEX

View File

@@ -136,9 +136,9 @@ void LwpPara::Read()
{ {
if (Notify) if (Notify)
{ {
std::unique_ptr<LwpForked3NotifyList> pNotifyList( new LwpForked3NotifyList ); LwpForked3NotifyList aNotifyList;
pNotifyList->GetExtraList().Read(m_pObjStrm.get()); aNotifyList.GetExtraList().Read(m_pObjStrm.get());
pNotifyList->Read(m_pObjStrm.get()); aNotifyList.Read(m_pObjStrm.get());
} }
} }
} }