[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Mar 30 00:10:58 PDT 2015


 sw/source/filter/ww8/docxattributeoutput.cxx |    8 +++-----
 sw/source/filter/ww8/docxattributeoutput.hxx |    2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit f8380bfdc89cd0ca8d47e188146641bf884e794f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Mar 30 09:10:08 2015 +0200

    DocxAttributeOutput::m_pTableWrt: use std::unique_ptr
    
    Change-Id: Ic6c519536a362256d993b0eaf76b5c107f25ea7a

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 286c48d..eb78b33 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2921,9 +2921,9 @@ void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t
 
     const SwHTMLTableLayout *pLayout = pTable->GetHTMLTableLayout();
     if( pLayout && pLayout->IsExportable() )
-        m_pTableWrt = new SwWriteTable( pLayout );
+        m_pTableWrt.reset(new SwWriteTable(pLayout));
     else
-        m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), nPageSize, nTblSz, false);
+        m_pTableWrt.reset(new SwWriteTable(pTable->GetTabLines(), nPageSize, nTblSz, false));
 }
 
 void DocxAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
@@ -2955,7 +2955,7 @@ void DocxAttributeOutput::EndTable()
         m_tableReference->m_bTableCellOpen = true;
 
     // Cleans the table helper
-    delete m_pTableWrt, m_pTableWrt = NULL;
+    m_pTableWrt.reset(0);
 
     m_aTableStyleConf.clear();
 }
@@ -8279,7 +8279,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
       m_sFieldBkm( ),
       m_nNextBookmarkId( 0 ),
       m_nNextAnnotationMarkId( 0 ),
-      m_pTableWrt( NULL ),
       m_pCurrentFrame( NULL ),
       m_bParagraphOpened( false ),
       m_bParagraphFrameOpen( false ),
@@ -8323,7 +8322,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
 
 DocxAttributeOutput::~DocxAttributeOutput()
 {
-    delete m_pTableWrt, m_pTableWrt = NULL;
 }
 
 DocxExport& DocxAttributeOutput::GetExport()
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 037bdf4..c43b391 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -796,7 +796,7 @@ private:
     std::vector<css::beans::PropertyValue> m_aTextEffectsGrabBag;
 
     /// The current table helper
-    SwWriteTable *m_pTableWrt;
+    std::unique_ptr<SwWriteTable> m_pTableWrt;
 
     sw::Frame* m_pCurrentFrame;
 


More information about the Libreoffice-commits mailing list