summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-25 13:58:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 08:37:47 +0200
commit337d0a4f602b879e73367586b9090dcc94898eb3 (patch)
treed0ffe29ab2c116f72017da957bc3d89fda5bfd6b /sw
parentcb91af4c3b1808e14be5e2476f2b6f645807184f (diff)
loplugin:useuniqueptr in MSWordExportBase
Change-Id: I73c43bd95350a8ebb7373872d58fa8911736a0a3 Reviewed-on: https://gerrit.libreoffice.org/58017 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx10
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx6
3 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 3065a98a82a4..011ae61990dd 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -74,7 +74,7 @@ sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule )
{
if ( !m_pUsedNumTable )
{
- m_pUsedNumTable = new SwNumRuleTable;
+ m_pUsedNumTable.reset(new SwNumRuleTable);
m_pUsedNumTable->insert( m_pUsedNumTable->begin(), m_pDoc->GetNumRuleTable().begin(), m_pDoc->GetNumRuleTable().end() );
// Check, if the outline rule is already inserted into <pUsedNumTable>.
// If yes, do not insert it again.
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index cb1af3ce4d68..af43f75ce436 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3173,11 +3173,11 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
if ( rOpt.IsImpress2PowerPoint() )
nSvxMSDffOLEConvFlags |= OLE_STARIMPRESS_2_POWERPOINT;
- m_pOLEExp = new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags );
+ m_pOLEExp.reset(new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags ));
}
if ( !m_pOCXExp && m_pDoc->GetDocShell() )
- m_pOCXExp = new SwMSConvertControls( m_pDoc->GetDocShell(), m_pCurPam );
+ m_pOCXExp.reset(new SwMSConvertControls( m_pDoc->GetDocShell(), m_pCurPam ));
// #i81405# - Collect anchored objects before changing the redline mode.
m_aFrames = GetFrames( *m_pDoc, bWriteAll? nullptr : m_pOrigPam );
@@ -3631,10 +3631,10 @@ MSWordExportBase::~MSWordExportBase()
// - it's an auto delete array, so the rest of the array which are
// duplicated lists that were added during the export will be deleted.
m_pUsedNumTable->erase(m_pUsedNumTable->begin(), m_pUsedNumTable->begin() + m_pUsedNumTable->size() - m_nUniqueList);
- delete m_pUsedNumTable;
+ m_pUsedNumTable.reset();
}
- delete m_pOLEExp;
- delete m_pOCXExp;
+ m_pOLEExp.reset();
+ m_pOCXExp.reset();
}
WW8Export::WW8Export( SwWW8Writer *pWriter,
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index df66ce5f37aa..80cb2404aadf 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -457,15 +457,15 @@ public:
std::vector<const SwTOXType*> m_aTOXArr;
const SfxItemSet* m_pISet; // for double attributes
WW8_WrPct* m_pPiece; // Pointer to Piece-Table
- SwNumRuleTable* m_pUsedNumTable; // all used NumRules
+ std::unique_ptr<SwNumRuleTable> m_pUsedNumTable; // all used NumRules
const SwTextNode *m_pTopNodeOfHdFtPage; ///< Top node of host page when in hd/ft
std::map< sal_uInt16, sal_uInt16 > m_aRuleDuplicates; //map to Duplicated numrules
std::stack< sal_Int32 > m_aCurrentCharPropStarts; ///< To remember the position in a run.
WW8_WrtBookmarks* m_pBkmks;
WW8_WrtRedlineAuthor* m_pRedlAuthors;
std::shared_ptr<NfKeywordTable> m_pKeyMap;
- SvxMSExportOLEObjects* m_pOLEExp;
- SwMSConvertControls* m_pOCXExp;
+ std::unique_ptr<SvxMSExportOLEObjects> m_pOLEExp;
+ std::unique_ptr<SwMSConvertControls> m_pOCXExp;
WW8OleMap m_aOleMap; // To remember all already exported ole objects
ww8::WW8TableInfo::Pointer_t m_pTableInfo;