summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-25 14:09:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 08:37:56 +0200
commit8ceb8e9d9bf352d5a79894ecb04326284b642810 (patch)
treeaff1a6cf2178e48dfb9ba687446da49c038d29f5 /sw
parent337d0a4f602b879e73367586b9090dcc94898eb3 (diff)
loplugin:useuniqueptr in WW8Export
Change-Id: I1211daba231e4c5557dad06e8392a28fca922ab7 Reviewed-on: https://gerrit.libreoffice.org/58018 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx20
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx12
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx4
3 files changed, 18 insertions, 18 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index af43f75ce436..dbf50faa680b 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3270,7 +3270,7 @@ void WW8Export::ExportDocument_Impl()
{
PrepareStorage();
- pFib = new WW8Fib(8, m_bDot);
+ pFib.reset(new WW8Fib(8, m_bDot));
tools::SvRef<SotStorageStream> xWwStrm( GetWriter().GetStorage().OpenSotStream( m_aMainStg ) );
tools::SvRef<SotStorageStream> xTableStrm( xWwStrm ), xDataStrm( xWwStrm );
@@ -3315,10 +3315,10 @@ void WW8Export::ExportDocument_Impl()
}
// Default: "Standard"
- pSepx = new WW8_WrPlcSepx( *this ); // Sections/headers/footers
+ pSepx.reset(new WW8_WrPlcSepx( *this )); // Sections/headers/footers
- pFootnote = new WW8_WrPlcFootnoteEdn( TXT_FTN ); // Footnotes
- pEdn = new WW8_WrPlcFootnoteEdn( TXT_EDN ); // Endnotes
+ pFootnote.reset(new WW8_WrPlcFootnoteEdn( TXT_FTN )); // Footnotes
+ pEdn.reset(new WW8_WrPlcFootnoteEdn( TXT_EDN )); // Endnotes
m_pAtn = new WW8_WrPlcAnnotations; // PostIts
m_pFactoids.reset(new WW8_WrtFactoids); // Smart tags.
m_pTextBxs = new WW8_WrPlcTextBoxes( TXT_TXTBOX );
@@ -3346,7 +3346,7 @@ void WW8Export::ExportDocument_Impl()
m_pGrf = new SwWW8WrGrf( *this );
m_pPiece = new WW8_WrPct( pFib->m_fcMin );
- pDop = new WW8Dop;
+ pDop.reset(new WW8Dop);
pDop->fRevMarking = bool( RedlineFlags::On & m_nOrigRedlineFlags );
pDop->fRMView = bool( RedlineFlags::ShowDelete & m_nOrigRedlineFlags );
@@ -3417,7 +3417,7 @@ void WW8Export::ExportDocument_Impl()
DELETEZ( pO );
DELETEZ( m_pChpPlc );
DELETEZ( m_pPapPlc );
- DELETEZ( pSepx );
+ pSepx.reset();
delete m_pRedlAuthors;
delete m_pSdrObjs;
@@ -3425,12 +3425,12 @@ void WW8Export::ExportDocument_Impl()
delete m_pTextBxs;
delete m_pHFTextBxs;
delete m_pAtn;
- delete pEdn;
- delete pFootnote;
+ pEdn.reset();
+ pFootnote.reset();
delete m_pBkmks;
delete m_pPiece;
- delete pDop;
- delete pFib;
+ pDop.reset();
+ pFib.reset();
GetWriter().SetStream( nullptr );
xWwStrm->SetBufferSize( 0 );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 80cb2404aadf..dde8717443c6 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -959,15 +959,15 @@ private:
class WW8Export : public MSWordExportBase
{
public:
- ww::bytes* pO; ///< Buffer
+ ww::bytes* pO; ///< Buffer
SvStream *pTableStrm, *pDataStrm; ///< Streams for WW97 Export
- WW8Fib* pFib; ///< File Information Block
- WW8Dop* pDop; ///< DOcument Properties
- WW8_WrPlcFootnoteEdn *pFootnote; ///< Footnotes - structure to remember them, and output
- WW8_WrPlcFootnoteEdn *pEdn; ///< Endnotes - structure to remember them, and output
- WW8_WrPlcSepx* pSepx; ///< Sections/headers/footers
+ std::unique_ptr<WW8Fib> pFib; ///< File Information Block
+ std::unique_ptr<WW8Dop> pDop; ///< DOcument Properties
+ std::unique_ptr<WW8_WrPlcFootnoteEdn> pFootnote; ///< Footnotes - structure to remember them, and output
+ std::unique_ptr<WW8_WrPlcFootnoteEdn> pEdn; ///< Endnotes - structure to remember them, and output
+ std::unique_ptr<WW8_WrPlcSepx> pSepx; ///< Sections/headers/footers
bool m_bDot; ///< Template or document.
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index f404d9ab2498..02d96980146e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3462,9 +3462,9 @@ void WW8AttributeOutput::TextFootnote_Impl( const SwFormatFootnote& rFootnote )
{
WW8_WrPlcFootnoteEdn* pFootnoteEnd;
if ( rFootnote.IsEndNote() || GetExport().m_pDoc->GetFootnoteInfo().ePos == FTNPOS_CHAPTER )
- pFootnoteEnd = m_rWW8Export.pEdn;
+ pFootnoteEnd = m_rWW8Export.pEdn.get();
else
- pFootnoteEnd = m_rWW8Export.pFootnote;
+ pFootnoteEnd = m_rWW8Export.pFootnote.get();
pFootnoteEnd->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), rFootnote );
m_rWW8Export.WriteFootnoteBegin( rFootnote, m_rWW8Export.pO );