diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-11 14:26:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-13 08:34:03 +0000 |
commit | a706bb06d5326e7a997dd1d71f3f947bd0ad28e6 (patch) | |
tree | 8ac34dea4e7e4106d3adbccc6a604b611928ffbe /sw/inc | |
parent | 8c73acd101c80a4479f25e35278a451dc3c4b22e (diff) |
new loplugin: useuniqueptr: sw part 1
Change-Id: I2bc55634e80976951ede768c97fbc4b7c4eda46c
Reviewed-on: https://gerrit.libreoffice.org/32963
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/EnhancedPDFExportHelper.hxx | 2 | ||||
-rw-r--r-- | sw/inc/anchoreddrawobject.hxx | 4 | ||||
-rw-r--r-- | sw/inc/calc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/cellfml.hxx | 2 | ||||
-rw-r--r-- | sw/inc/dpage.hxx | 4 | ||||
-rw-r--r-- | sw/inc/expfld.hxx | 6 | ||||
-rw-r--r-- | sw/inc/fmtcntnt.hxx | 4 | ||||
-rw-r--r-- | sw/inc/fmturl.hxx | 7 | ||||
-rw-r--r-- | sw/inc/list.hxx | 3 | ||||
-rw-r--r-- | sw/inc/ndnotxt.hxx | 2 | ||||
-rw-r--r-- | sw/inc/numrule.hxx | 2 | ||||
-rw-r--r-- | sw/inc/redline.hxx | 6 | ||||
-rw-r--r-- | sw/inc/shellio.hxx | 2 |
13 files changed, 24 insertions, 22 deletions
diff --git a/sw/inc/EnhancedPDFExportHelper.hxx b/sw/inc/EnhancedPDFExportHelper.hxx index c1d3e30654f4..0aab23331921 100644 --- a/sw/inc/EnhancedPDFExportHelper.hxx +++ b/sw/inc/EnhancedPDFExportHelper.hxx @@ -196,7 +196,7 @@ class SwEnhancedPDFExportHelper SwEditShell& mrSh; OutputDevice& mrOut; - StringRangeEnumerator* mpRangeEnum; + std::unique_ptr<StringRangeEnumerator> mpRangeEnum; /** The problem is that numbers in StringRangeEnumerator aren't accordant * to real page numbers if mbSkipEmptyPages is true, because in this case * empty pages are excluded from a page range and numbers in diff --git a/sw/inc/anchoreddrawobject.hxx b/sw/inc/anchoreddrawobject.hxx index 1e6388852c39..38561d79e8a8 100644 --- a/sw/inc/anchoreddrawobject.hxx +++ b/sw/inc/anchoreddrawobject.hxx @@ -35,7 +35,7 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject bool mbValidPos; // rectangle, keeping the last object rectangle after the positioning - Rectangle* mpLastObjRect; + std::unique_ptr<Rectangle> mpLastObjRect; // boolean, indicating that anchored drawing object hasn't been attached // to a anchor frame yet. Once, it is attached to a anchor frame the @@ -140,7 +140,7 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject // accessors to the object area and its position virtual const SwRect GetObjRect() const override; // Return value can be NULL. - const Rectangle* GetLastObjRect() const { return mpLastObjRect;} + const Rectangle* GetLastObjRect() const { return mpLastObjRect.get();} void SetLastObjRect( const Rectangle& _rNewObjRect ); diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx index 8f54ab3bb385..630c43cb4a15 100644 --- a/sw/inc/calc.hxx +++ b/sw/inc/calc.hxx @@ -121,7 +121,7 @@ struct SwHash SwHash( const OUString& rStr ); virtual ~SwHash(); OUString aStr; - SwHash *pNext; + std::unique_ptr<SwHash> pNext; }; struct SwCalcExp : public SwHash diff --git a/sw/inc/cellfml.hxx b/sw/inc/cellfml.hxx index 85c8787fb40c..3f918bd2384a 100644 --- a/sw/inc/cellfml.hxx +++ b/sw/inc/cellfml.hxx @@ -37,7 +37,7 @@ class SwTableCalcPara sal_uInt16 nStackCnt, nMaxSize; public: - SwTableSortBoxes *pBoxStack; ///< stack for recognizing recursion + std::unique_ptr<SwTableSortBoxes> pBoxStack; ///< stack for recognizing recursion SwCalc& rCalc; ///< current Calculator const SwTable* pTable; ///< current table diff --git a/sw/inc/dpage.hxx b/sw/inc/dpage.hxx index 75d63b08a03b..a000e7052426 100644 --- a/sw/inc/dpage.hxx +++ b/sw/inc/dpage.hxx @@ -30,8 +30,8 @@ class SwDPage : public FmFormPage, public SdrObjUserCall { SwDPage &operator=(const SwDPage&) = delete; - SdrPageGridFrameList* pGridLst; - SwDoc* pDoc; + std::unique_ptr<SdrPageGridFrameList> pGridLst; + SwDoc* pDoc; public: explicit SwDPage(SwDrawModel& rNewModel, bool bMasterPage); diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index bee8249837ea..fb970dbde735 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -365,9 +365,9 @@ public: bool BuildSortLst(); private: - SwEditShell* pSh; - SetGetExpFields* pSrtLst; - std::set<const SwTextField*> aTmpLst; + SwEditShell* pSh; + std::unique_ptr<SetGetExpFields> pSrtLst; + std::set<const SwTextField*> aTmpLst; }; /// Implementation in tblcalc.cxx. diff --git a/sw/inc/fmtcntnt.hxx b/sw/inc/fmtcntnt.hxx index b8aa2b604dfa..62580c78bb31 100644 --- a/sw/inc/fmtcntnt.hxx +++ b/sw/inc/fmtcntnt.hxx @@ -29,7 +29,7 @@ class SwStartNode; /// Content, content of frame (header, footer, fly). class SW_DLLPUBLIC SwFormatContent: public SfxPoolItem { - SwNodeIndex *pStartNode; + std::unique_ptr<SwNodeIndex> pStartNode; SwFormatContent &operator=( const SwFormatContent & ) = delete; @@ -42,7 +42,7 @@ public: virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; - const SwNodeIndex *GetContentIdx() const { return pStartNode; } + const SwNodeIndex *GetContentIdx() const { return pStartNode.get(); } void SetNewContentIdx( const SwNodeIndex *pIdx ); void dumpAsXml(struct _xmlTextWriter* pWriter) const override; diff --git a/sw/inc/fmturl.hxx b/sw/inc/fmturl.hxx index e6ea18b863a6..b043939b7e5f 100644 --- a/sw/inc/fmturl.hxx +++ b/sw/inc/fmturl.hxx @@ -34,7 +34,8 @@ class SW_DLLPUBLIC SwFormatURL: public SfxPoolItem OUString sTargetFrameName; ///< Target frame for URL. OUString sURL; ///< Simple URL. OUString sName; ///< Name of the anchor. - ImageMap *pMap; ///< ClientSide images. + std::unique_ptr<ImageMap> + pMap; ///< ClientSide images. bool bIsServerMap; ///< A ServerSideImageMap with the URL. @@ -66,8 +67,8 @@ public: const OUString& GetTargetFrameName()const { return sTargetFrameName; } const OUString& GetURL() const { return sURL; } bool IsServerMap() const { return bIsServerMap; } - const ImageMap *GetMap() const { return pMap; } - ImageMap *GetMap() { return pMap; } + const ImageMap *GetMap() const { return pMap.get(); } + ImageMap *GetMap() { return pMap.get(); } const OUString& GetName() const { return sName; } void SetName( const OUString& rNm ) { sName = rNm; } diff --git a/sw/inc/list.hxx b/sw/inc/list.hxx index 2c3daf7d981a..d3ef07c8ea4c 100644 --- a/sw/inc/list.hxx +++ b/sw/inc/list.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SW_INC_LIST_HXX #include <rtl/ustring.hxx> +#include <memory> class SwNumRule; class SwNodes; @@ -57,7 +58,7 @@ class SwList SwList( const SwList& ) = delete; SwList& operator=( const SwList& ) = delete; - SwListImpl* mpListImpl; + std::unique_ptr<SwListImpl> mpListImpl; }; #endif // INCLUDED_SW_INC_LIST_HXX diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx index 7ba253e564b5..531e17c32506 100644 --- a/sw/inc/ndnotxt.hxx +++ b/sw/inc/ndnotxt.hxx @@ -30,7 +30,7 @@ class SW_DLLPUBLIC SwNoTextNode : public SwContentNode friend class SwNodes; friend class SwNoTextFrame; - tools::PolyPolygon *pContour; + std::unique_ptr<tools::PolyPolygon> pContour; bool bAutomaticContour : 1; // automatic contour polygon, not manipulated bool bContourMapModeValid : 1; // contour map mode is not the graphics's // preferred map mode, but either diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx index 88b8d5c35b35..028003c9c2ee 100644 --- a/sw/inc/numrule.hxx +++ b/sw/inc/numrule.hxx @@ -49,7 +49,7 @@ const sal_Unicode cBulletChar = 0x2022; ///< Character for lists. class SW_DLLPUBLIC SwNumFormat : public SvxNumberFormat, public SwClient { - SwFormatVertOrient* m_pVertOrient; + std::unique_ptr<SwFormatVertOrient> m_pVertOrient; //For i120928,record the cp info of graphic within bullet sal_Unicode m_cGrfBulletCP; SAL_DLLPRIVATE void UpdateNumNodes( SwDoc* pDoc ); diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index fe55dd657452..fbe0ccc0ec84 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -51,7 +51,7 @@ public: class SwRedlineExtraData_FormatColl : public SwRedlineExtraData { OUString sFormatNm; - SfxItemSet* pSet; + std::unique_ptr<SfxItemSet> pSet; sal_uInt16 nPoolId; public: SwRedlineExtraData_FormatColl( const OUString& rColl, sal_uInt16 nPoolFormatId, @@ -88,7 +88,7 @@ public: */ class SW_DLLPUBLIC SwRedlineExtraData_FormattingChanges : public SwRedlineExtraData { - SfxItemSet* pSet; + std::unique_ptr<SfxItemSet> pSet; SwRedlineExtraData_FormattingChanges( const SwRedlineExtraData_FormattingChanges& rCpy ); @@ -98,7 +98,7 @@ public: virtual SwRedlineExtraData* CreateNew() const override; virtual void Reject( SwPaM& rPam ) const override; virtual bool operator == ( const SwRedlineExtraData& ) const override; - SfxItemSet* GetItemSet( ) const { return pSet; } + SfxItemSet* GetItemSet( ) const { return pSet.get(); } }; class SW_DLLPUBLIC SwRedlineData diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index ce171924f106..be6b0785486e 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -287,7 +287,7 @@ class SwImpBlocks; class SW_DLLPUBLIC SwTextBlocks { - SwImpBlocks* pImp; + std::unique_ptr<SwImpBlocks> pImp; sal_uLong nErr; public: |