Kaydet (Commit) 337d0a4f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in MSWordExportBase

Change-Id: I73c43bd95350a8ebb7373872d58fa8911736a0a3
Reviewed-on: https://gerrit.libreoffice.org/58017
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst cb91af4c
...@@ -74,7 +74,7 @@ sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule ) ...@@ -74,7 +74,7 @@ sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule )
{ {
if ( !m_pUsedNumTable ) 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() ); m_pUsedNumTable->insert( m_pUsedNumTable->begin(), m_pDoc->GetNumRuleTable().begin(), m_pDoc->GetNumRuleTable().end() );
// Check, if the outline rule is already inserted into <pUsedNumTable>. // Check, if the outline rule is already inserted into <pUsedNumTable>.
// If yes, do not insert it again. // If yes, do not insert it again.
......
...@@ -3173,11 +3173,11 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) ...@@ -3173,11 +3173,11 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
if ( rOpt.IsImpress2PowerPoint() ) if ( rOpt.IsImpress2PowerPoint() )
nSvxMSDffOLEConvFlags |= OLE_STARIMPRESS_2_POWERPOINT; nSvxMSDffOLEConvFlags |= OLE_STARIMPRESS_2_POWERPOINT;
m_pOLEExp = new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags ); m_pOLEExp.reset(new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags ));
} }
if ( !m_pOCXExp && m_pDoc->GetDocShell() ) 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. // #i81405# - Collect anchored objects before changing the redline mode.
m_aFrames = GetFrames( *m_pDoc, bWriteAll? nullptr : m_pOrigPam ); m_aFrames = GetFrames( *m_pDoc, bWriteAll? nullptr : m_pOrigPam );
...@@ -3631,10 +3631,10 @@ MSWordExportBase::~MSWordExportBase() ...@@ -3631,10 +3631,10 @@ MSWordExportBase::~MSWordExportBase()
// - it's an auto delete array, so the rest of the array which are // - 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. // 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); m_pUsedNumTable->erase(m_pUsedNumTable->begin(), m_pUsedNumTable->begin() + m_pUsedNumTable->size() - m_nUniqueList);
delete m_pUsedNumTable; m_pUsedNumTable.reset();
} }
delete m_pOLEExp; m_pOLEExp.reset();
delete m_pOCXExp; m_pOCXExp.reset();
} }
WW8Export::WW8Export( SwWW8Writer *pWriter, WW8Export::WW8Export( SwWW8Writer *pWriter,
......
...@@ -457,15 +457,15 @@ public: ...@@ -457,15 +457,15 @@ public:
std::vector<const SwTOXType*> m_aTOXArr; std::vector<const SwTOXType*> m_aTOXArr;
const SfxItemSet* m_pISet; // for double attributes const SfxItemSet* m_pISet; // for double attributes
WW8_WrPct* m_pPiece; // Pointer to Piece-Table 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 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::map< sal_uInt16, sal_uInt16 > m_aRuleDuplicates; //map to Duplicated numrules
std::stack< sal_Int32 > m_aCurrentCharPropStarts; ///< To remember the position in a run. std::stack< sal_Int32 > m_aCurrentCharPropStarts; ///< To remember the position in a run.
WW8_WrtBookmarks* m_pBkmks; WW8_WrtBookmarks* m_pBkmks;
WW8_WrtRedlineAuthor* m_pRedlAuthors; WW8_WrtRedlineAuthor* m_pRedlAuthors;
std::shared_ptr<NfKeywordTable> m_pKeyMap; std::shared_ptr<NfKeywordTable> m_pKeyMap;
SvxMSExportOLEObjects* m_pOLEExp; std::unique_ptr<SvxMSExportOLEObjects> m_pOLEExp;
SwMSConvertControls* m_pOCXExp; std::unique_ptr<SwMSConvertControls> m_pOCXExp;
WW8OleMap m_aOleMap; // To remember all already exported ole objects WW8OleMap m_aOleMap; // To remember all already exported ole objects
ww8::WW8TableInfo::Pointer_t m_pTableInfo; ww8::WW8TableInfo::Pointer_t m_pTableInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment