[Libreoffice-commits] core.git: hwpfilter/source lotuswordpro/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 2 16:24:11 UTC 2021


 hwpfilter/source/hwpreader.cxx           |    8 ++++----
 lotuswordpro/source/filter/lwpfilter.cxx |    8 ++++----
 lotuswordpro/source/filter/lwpidxmgr.cxx |   14 +++++++-------
 lotuswordpro/source/filter/lwppara.cxx   |    6 +++---
 4 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 3d9bf9eea5803184da8e5e11477b6eb2f55aff3f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jun 2 13:24:18 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jun 2 18:23:30 2021 +0200

    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 at collabora.co.uk>

diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 06e26f8522c8..3b69da304af4 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3712,10 +3712,10 @@ void HwpReader::makeFormula(TxtBox * hbox)
     }
     mybuf[l] = '\0';
 
-    std::unique_ptr<Formula> form( new Formula(mybuf) );
-    form->setDocumentHandler(m_rxDocumentHandler);
-    form->setAttributeListImpl(mxList.get());
-    form->parse();
+    Formula form( mybuf );
+    form.setDocumentHandler(m_rxDocumentHandler);
+    form.setAttributeListImpl(mxList.get());
+    form.parse();
 }
 
 /**
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx
index ebffb74c0f4e..e8ba358ae8c7 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -93,10 +93,10 @@ static bool Decompress(SvStream* pCompressed, SvStream*& pOutDecompressed)
     pCompressed->ReadBytes(buffer, 16);
     aDecompressed->WriteBytes(buffer, 16);
 
-    std::unique_ptr<LwpSvStream> aLwpStream(new LwpSvStream(pCompressed));
+    LwpSvStream aLwpStream(pCompressed);
     std::unique_ptr<OpenStormBento::LtcBenContainer> pBentoContainer;
     {
-        sal_uLong ulRet = BenOpenContainer(aLwpStream.get(), &pBentoContainer);
+        sal_uLong ulRet = BenOpenContainer(&aLwpStream, &pBentoContainer);
         if (ulRet != BenErr_OK)
             return false;
     }
@@ -195,8 +195,8 @@ int ReadWordproFile(SvStream& rStream,
 
         aLwpSvStream.reset(pRawLwpSvStream);
 
-        std::unique_ptr<IXFStream> pStrm(new XFSaxStream(xHandler));
-        Lwp9Reader reader(aLwpSvStream.get(), pStrm.get());
+        XFSaxStream aStrm(xHandler);
+        Lwp9Reader reader(aLwpSvStream.get(), &aStrm);
         //Reset all static objects,because this function may be called many times.
         XFGlobalReset();
         const bool bOk = reader.Read();
diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx b/lotuswordpro/source/filter/lwpidxmgr.cxx
index 26042fc96840..f999ec79a23b 100644
--- a/lotuswordpro/source/filter/lwpidxmgr.cxx
+++ b/lotuswordpro/source/filter/lwpidxmgr.cxx
@@ -229,16 +229,16 @@ void LwpIndexManager::ReadObjIndex( LwpSvStream *pStrm )
 
     LwpObjectHeader ObjHdr;
     ObjHdr.Read(*pStrm);
-    std::unique_ptr<LwpObjectStream> pObjStrm( new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
-            static_cast<sal_uInt16>(ObjHdr.GetSize()) ) );
+    LwpObjectStream aObjStrm(pStrm, ObjHdr.IsCompressed(),
+            static_cast<sal_uInt16>(ObjHdr.GetSize()) );
 
     if( sal_uInt32(VO_OBJINDEX) == ObjHdr.GetTag() )
     {
-        ReadObjIndexData( pObjStrm.get() );
+        ReadObjIndexData( &aObjStrm );
     }
     else if( sal_uInt32(VO_LEAFOBJINDEX) == ObjHdr.GetTag() )
     {
-        ReadLeafData( pObjStrm.get() );
+        ReadLeafData( &aObjStrm );
     }
 }
 
@@ -249,10 +249,10 @@ void LwpIndexManager::ReadLeafIndex( LwpSvStream *pStrm )
 {
     LwpObjectHeader ObjHdr;
     ObjHdr.Read(*pStrm);
-    std::unique_ptr<LwpObjectStream> pObjStrm( new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
-            static_cast<sal_uInt16>(ObjHdr.GetSize()) ) );
+    LwpObjectStream aObjStrm( pStrm, ObjHdr.IsCompressed(),
+            static_cast<sal_uInt16>(ObjHdr.GetSize()) );
 
-    ReadLeafData(pObjStrm.get());
+    ReadLeafData(&aObjStrm);
 }
 /**
  * @descr   Read data in VO_LEAFOBJINDEX
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index 4d6829cccf8a..a98e4df84707 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -136,9 +136,9 @@ void LwpPara::Read()
         {
             if (Notify)
             {
-                std::unique_ptr<LwpForked3NotifyList> pNotifyList( new LwpForked3NotifyList );
-                pNotifyList->GetExtraList().Read(m_pObjStrm.get());
-                pNotifyList->Read(m_pObjStrm.get());
+                LwpForked3NotifyList aNotifyList;
+                aNotifyList.GetExtraList().Read(m_pObjStrm.get());
+                aNotifyList.Read(m_pObjStrm.get());
             }
         }
     }


More information about the Libreoffice-commits mailing list