diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 09:46:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 11:19:20 +0000 |
commit | 2266b436698f28f3869a025f5aa4a356da04a4f1 (patch) | |
tree | a44156984d68252fc5ca4d0088ea5f0a37546e1f /sw/inc | |
parent | feb3b3dbda7af2ba7f2d36dd9174a30912d9cf63 (diff) |
new loplugin: useuniqueptr: sw part 2
Change-Id: Ifa901f75072d8474d8a97ca57c2b5b48d8c6b79d
Reviewed-on: https://gerrit.libreoffice.org/33250
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/fmtinfmt.hxx | 5 | ||||
-rw-r--r-- | sw/inc/shellres.hxx | 2 | ||||
-rw-r--r-- | sw/inc/undobj.hxx | 8 | ||||
-rw-r--r-- | sw/inc/unostyle.hxx | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx index 347a366a4326..db8606322bc2 100644 --- a/sw/inc/fmtinfmt.hxx +++ b/sw/inc/fmtinfmt.hxx @@ -21,6 +21,7 @@ #include <svl/poolitem.hxx> #include "swdllapi.h" +#include <memory> class SvxMacro; class SvxMacroTableDtor; @@ -38,7 +39,7 @@ class SW_DLLPUBLIC SwFormatINetFormat: public SfxPoolItem OUString msINetFormatName; OUString msVisitedFormatName; OUString msHyperlinkName; ///< Name of the link. - SvxMacroTableDtor* mpMacroTable; + std::unique_ptr<SvxMacroTableDtor> mpMacroTable; SwTextINetFormat* mpTextAttr; ///< My TextAttribute. sal_uInt16 mnINetFormatId; sal_uInt16 mnVisitedFormatId; @@ -126,7 +127,7 @@ public: void SetMacroTable( const SvxMacroTableDtor* pTable ); const SvxMacroTableDtor* GetMacroTable() const { - return mpMacroTable; + return mpMacroTable.get(); } /// Macro getter and setter. diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx index 80b9c61cdf14..f324299a69b7 100644 --- a/sw/inc/shellres.hxx +++ b/sw/inc/shellres.hxx @@ -84,7 +84,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource private: void GetAutoFormatNameLst_() const; - mutable std::vector<OUString> *pAutoFormatNameLst; + mutable std::unique_ptr<std::vector<OUString>> pAutoFormatNameLst; OUString sPageDescFirstName; OUString sPageDescFollowName; OUString sPageDescName; diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index fedc5673f4b9..284e3160d26b 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -55,7 +55,7 @@ class SwUndo protected: bool bCacheComment; - mutable OUString * pComment; + mutable std::unique_ptr<OUString> pComment; static void RemoveIdxFromSection( SwDoc&, sal_uLong nSttIdx, sal_uLong* pEndIdx = nullptr ); static void RemoveIdxFromRange( SwPaM& rPam, bool bMoveNext ); @@ -150,7 +150,7 @@ class SwUndoSaveContent { protected: - SwHistory* pHistory; + std::unique_ptr<SwHistory> pHistory; // Needed for deletion of content. For Redo content is moved into the // UndoNodesArray. These methods always create a new node to insert @@ -202,8 +202,8 @@ public: void RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx, sal_uInt16 nSectType ); void RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos ); - const SwHistory* GetHistory() const { return pHistory; } - SwHistory* GetHistory() { return pHistory; } + const SwHistory* GetHistory() const { return pHistory.get(); } + SwHistory* GetHistory() { return pHistory.get(); } }; // This class saves the PaM as sal_uInt16's and is able to restore it diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 9806d2f79d5f..58bf8c74cb97 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -172,7 +172,7 @@ public: class SwXAutoStylesEnumerator : public cppu::WeakImplHelper< css::container::XEnumeration >, public SwClient { - SwAutoStylesEnumImpl *m_pImpl; + std::unique_ptr<SwAutoStylesEnumImpl> m_pImpl; public: SwXAutoStylesEnumerator( SwDoc* pDoc, IStyleAccess::SwAutoStyleFamily eFam ); virtual ~SwXAutoStylesEnumerator() override; |