diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-19 12:11:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-20 09:00:02 +0200 |
commit | 82a2a8f29e0f4bade59d26a7733f797188f1d57c (patch) | |
tree | e9a67e7281b538aa9b9566fc0c56a815a20f8f1b | |
parent | 8c63897b833df95b2e03b72f62fb180bdcf680ba (diff) |
loplugin:useuniqueptr in XclObj
Change-Id: I2995dfe5fb39ae2e7f3c37992cb3e2147381784e
Reviewed-on: https://gerrit.libreoffice.org/57753
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | compilerplugins/clang/useuniqueptr.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/inc/xcl97rec.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xcl97/xcl97rec.cxx | 14 |
4 files changed, 14 insertions, 12 deletions
diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx index 3f563699e1f6..88bbec4a9d59 100644 --- a/compilerplugins/clang/useuniqueptr.cxx +++ b/compilerplugins/clang/useuniqueptr.cxx @@ -88,6 +88,10 @@ public: // SwHTMLParser::m_pPendStack if (fn == SRCDIR "/sw/source/filter/html/htmlcss1.cxx") return; + // Visual Studio 2017 has trouble with these + if (fn == SRCDIR "/comphelper/source/property/MasterPropertySet.cxx" + || fn == SRCDIR "/comphelper/source/property/MasterPropertySetInfo.cxx") + return; TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 855f28cd0433..b3e97ea16422 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -743,7 +743,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< /* Be sure to construct the MSODRAWING record containing the ClientTextbox atom after the base OBJ's MSODRAWING record data is completed. */ - pClientTextbox = new XclExpMsoDrawing( mrEscherEx ); + pClientTextbox.reset( new XclExpMsoDrawing( mrEscherEx ) ); mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record mrEscherEx.UpdateDffFragmentEnd(); @@ -756,7 +756,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< nXclFont = GetFontBuffer().Insert( aFontData, EXC_COLOR_CTRLTEXT ); } - pTxo = new XclTxo( aString, nXclFont ); + pTxo.reset( new XclTxo( aString, nXclFont ) ); pTxo->SetHorAlign( (mnObjType == EXC_OBJTYPE_BUTTON) ? EXC_OBJ_HOR_CENTER : EXC_OBJ_HOR_LEFT ); pTxo->SetVerAlign( EXC_OBJ_VER_CENTER ); } diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx index a8491bc44791..f97c9b72bf9d 100644 --- a/sc/source/filter/inc/xcl97rec.hxx +++ b/sc/source/filter/inc/xcl97rec.hxx @@ -87,8 +87,8 @@ class XclObj : public XclExpRecord protected: XclEscherEx& mrEscherEx; XclExpMsoDrawing* pMsodrawing; - XclExpMsoDrawing* pClientTextbox; - XclTxo* pTxo; + std::unique_ptr<XclExpMsoDrawing> pClientTextbox; + std::unique_ptr<XclTxo> pTxo; sal_uInt16 mnObjType; sal_uInt16 nObjId; sal_uInt16 nGrbit; diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index b8a9919ca5dd..2e3041662f1a 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -338,8 +338,6 @@ void XclExpObjList::ResetCounters() XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) : XclExpRecord( EXC_ID_OBJ, 26 ), mrEscherEx( rObjMgr.GetEscherEx() ), - pClientTextbox( nullptr ), - pTxo( nullptr ), mnObjType( nObjType ), nObjId(0), nGrbit( 0x6011 ), // AutoLine, AutoFill, Printable, Locked @@ -358,8 +356,8 @@ XclObj::~XclObj() { if ( !bFirstOnSheet ) delete pMsodrawing; - delete pClientTextbox; - delete pTxo; + pClientTextbox.reset(); + pTxo.reset(); } void XclObj::ImplWriteAnchor( const SdrObject* pSdrObj, const tools::Rectangle* pChildAnchor ) @@ -410,10 +408,10 @@ void XclObj::SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj ) if ( !pClientTextbox ) { mrEscherEx.UpdateDffFragmentEnd(); - pClientTextbox = new XclExpMsoDrawing( mrEscherEx ); + pClientTextbox.reset( new XclExpMsoDrawing( mrEscherEx ) ); mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record mrEscherEx.UpdateDffFragmentEnd(); - pTxo = new XclTxo( rRoot, rObj ); + pTxo.reset( new XclTxo( rRoot, rObj ) ); } } @@ -514,7 +512,7 @@ XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const tools::Rectang { ProcessEscherObj( rObjMgr.GetRoot(), rRect, pCaption, bVisible); // TXO - pTxo = new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption ); + pTxo .reset(new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption )); } static void lcl_FillProps( EscherPropertyContainer& rPropOpt, SdrObject* pCaption, bool bVisible ) @@ -584,7 +582,7 @@ void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const tools::Rect //! Be sure to construct the MSODRAWING ClientTextbox record _after_ the //! base OBJ's MSODRAWING record Escher data is completed. - pClientTextbox = new XclExpMsoDrawing( mrEscherEx ); + pClientTextbox.reset( new XclExpMsoDrawing( mrEscherEx ) ); mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record mrEscherEx.UpdateDffFragmentEnd(); mrEscherEx.CloseContainer(); // ESCHER_SpContainer |