[Libreoffice-commits] core.git: filter/source include/filter

Noel Grandin noel.grandin at collabora.co.uk
Mon Apr 10 11:39:58 UTC 2017


 filter/source/msfilter/msdffimp.cxx  |   17 +++++++----------
 include/filter/msfilter/msdffimp.hxx |    6 +++---
 2 files changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 748fea983f88752541767affa232b7bcb85f28dd
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Apr 7 16:05:14 2017 +0200

    loplugin:inlinefields in SvxMSDffManager
    
    Change-Id: I30a7f593c1d2f751adcdde1a381fb616c2dfed74
    Reviewed-on: https://gerrit.libreoffice.org/36347
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index e13d0c317294..df8167f6e047 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5524,10 +5524,10 @@ void SvxMSDffManager::StoreShapeOrder(sal_uLong         nId,
                                       SdrObject*    pObject,
                                       SwFlyFrameFormat*  pFly) const
 {
-    sal_uInt16 nShpCnt = m_pShapeOrders->size();
+    sal_uInt16 nShpCnt = m_aShapeOrders.size();
     for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
     {
-        SvxMSDffShapeOrder& rOrder = *(*m_pShapeOrders)[ nShapeNum ];
+        SvxMSDffShapeOrder& rOrder = *m_aShapeOrders[ nShapeNum ];
 
         if( rOrder.nShapeId == nId )
         {
@@ -5543,10 +5543,10 @@ void SvxMSDffManager::ExchangeInShapeOrder( SdrObject*   pOldObject,
                                             sal_uLong    nTxBx,
                                             SdrObject*   pObject) const
 {
-    sal_uInt16 nShpCnt = m_pShapeOrders->size();
+    sal_uInt16 nShpCnt = m_aShapeOrders.size();
     for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
     {
-        SvxMSDffShapeOrder& rOrder = *(*m_pShapeOrders)[ nShapeNum ];
+        SvxMSDffShapeOrder& rOrder = *m_aShapeOrders[ nShapeNum ];
 
         if( rOrder.pObj == pOldObject )
         {
@@ -5560,10 +5560,10 @@ void SvxMSDffManager::ExchangeInShapeOrder( SdrObject*   pOldObject,
 
 void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const
 {
-    sal_uInt16 nShpCnt = m_pShapeOrders->size();
+    sal_uInt16 nShpCnt = m_aShapeOrders.size();
     for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
     {
-        SvxMSDffShapeOrder& rOrder = *(*m_pShapeOrders)[ nShapeNum ];
+        SvxMSDffShapeOrder& rOrder = *m_aShapeOrders[ nShapeNum ];
 
         if( rOrder.pObj == pObject )
         {
@@ -5589,7 +5589,6 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
     :DffPropertyReader( *this ),
      m_pBLIPInfos( new SvxMSDffBLIPInfos ),
      m_xShapeInfosByTxBxComp( new SvxMSDffShapeInfos_ByTxBxComp ),
-     m_pShapeOrders( new SvxMSDffShapeOrders ),
      nOffsDgg( nOffsDgg_ ),
      nBLIPCount(  USHRT_MAX ),              // initialize with error, since we fist check if the
      nGroupShapeFlags(0),                   // ensure initialization here, as some corrupted
@@ -5636,7 +5635,6 @@ SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const OUString& rBaseURL )
     :DffPropertyReader( *this ),
      m_pBLIPInfos( new SvxMSDffBLIPInfos ),
      m_xShapeInfosByTxBxComp( new SvxMSDffShapeInfos_ByTxBxComp ),
-     m_pShapeOrders( new SvxMSDffShapeOrders ),
      nOffsDgg( 0 ),
      nBLIPCount(  USHRT_MAX ),              // initialize with error, since we first have to check
      nGroupShapeFlags(0),
@@ -5660,7 +5658,6 @@ SvxMSDffManager::~SvxMSDffManager()
 {
     delete pSecPropSet;
     delete m_pBLIPInfos;
-    delete m_pShapeOrders;
 }
 
 void SvxMSDffManager::InitSvxMSDffManager( sal_uInt32 nOffsDgg_, SvStream* pStData_, sal_uInt32 nOleConvFlags )
@@ -6188,7 +6185,7 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
         }
         m_xShapeInfosByTxBxComp->insert(std::make_shared<SvxMSDffShapeInfo>(
                     aInfo));
-        m_pShapeOrders->push_back(o3tl::make_unique<SvxMSDffShapeOrder>(
+        m_aShapeOrders.push_back(o3tl::make_unique<SvxMSDffShapeOrder>(
                     aInfo.nShapeId ));
     }
 
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index 92a7b9843052..48c3ce50c254 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -401,7 +401,7 @@ class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
     SvxMSDffBLIPInfos*      m_pBLIPInfos;
     std::unique_ptr<SvxMSDffShapeInfos_ByTxBxComp> m_xShapeInfosByTxBxComp;
     std::unique_ptr<SvxMSDffShapeInfos_ById> m_xShapeInfosById;
-    SvxMSDffShapeOrders*    m_pShapeOrders;
+    SvxMSDffShapeOrders     m_aShapeOrders;
     sal_uInt32              nOffsDgg;
     sal_uInt16              nBLIPCount;
     sal_uInt32              nGroupShapeFlags;
@@ -684,8 +684,8 @@ public:
     const SvxMSDffShapeInfos_ById* GetShapeInfos() const
         { return m_xShapeInfosById.get(); }
 
-    SvxMSDffShapeOrders* GetShapeOrders() const
-        { return m_pShapeOrders; }
+    const SvxMSDffShapeOrders* GetShapeOrders() const
+        { return &m_aShapeOrders; }
 
     void StoreShapeOrder(sal_uLong      nId,
                          sal_uLong      nTxBx,


More information about the Libreoffice-commits mailing list