diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-11 13:04:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-16 06:10:36 +0000 |
commit | 0b272cdf0025ce4bca31ee01c8b3aaca042dcb62 (patch) | |
tree | e5d3ec93289598ebfe0121e7a3d0c880c3054844 /include/svx | |
parent | 570d8dab6d6754ab8020cbe6624020dff7b8b624 (diff) |
new loplugin: useuniqueptr: svx
Change-Id: I0eb3d43d7bcfc491df16a72997a0720a6aec2c5c
Reviewed-on: https://gerrit.libreoffice.org/32959
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/galtheme.hxx | 3 | ||||
-rw-r--r-- | include/svx/hlnkitem.hxx | 7 | ||||
-rw-r--r-- | include/svx/langbox.hxx | 3 | ||||
-rw-r--r-- | include/svx/numinf.hxx | 5 | ||||
-rw-r--r-- | include/svx/svdobj.hxx | 3 | ||||
-rw-r--r-- | include/svx/svdoedge.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdogrp.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdorect.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdotext.hxx | 3 | ||||
-rw-r--r-- | include/svx/svdundo.hxx | 6 | ||||
-rw-r--r-- | include/svx/xbitmap.hxx | 2 | ||||
-rw-r--r-- | include/svx/xexch.hxx | 7 |
12 files changed, 26 insertions, 19 deletions
diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx index f93fd1b40df5..003c013fe365 100644 --- a/include/svx/galtheme.hxx +++ b/include/svx/galtheme.hxx @@ -110,13 +110,14 @@ private: SAL_DLLPRIVATE void ImplBroadcast( sal_uIntPtr nUpdatePos ); SAL_DLLPRIVATE GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry ); - SAL_DLLPRIVATE virtual ~GalleryTheme() override; GalleryTheme(GalleryTheme const &) = delete; void operator =(GalleryTheme const &) = delete; public: + SAL_DLLPRIVATE virtual ~GalleryTheme() override; + SAL_DLLPRIVATE static GalleryThemeEntry* CreateThemeEntry( const INetURLObject& rURL, bool bReadOnly ); SAL_DLLPRIVATE size_t GetObjectCount() const { return aObjectList.size(); } diff --git a/include/svx/hlnkitem.hxx b/include/svx/hlnkitem.hxx index 902546d1eeb6..fa70a26fb5f6 100644 --- a/include/svx/hlnkitem.hxx +++ b/include/svx/hlnkitem.hxx @@ -25,6 +25,7 @@ #include <svl/macitem.hxx> #include <svx/svxdllapi.h> #include <o3tl/typed_flags_set.hxx> +#include <memory> enum class HyperDialogEvent { NONE = 0x0000, @@ -52,7 +53,7 @@ class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem SvxLinkInsertMode eType; OUString sIntName; - SvxMacroTableDtor* pMacroTable; + std::unique_ptr<SvxMacroTableDtor> pMacroTable; HyperDialogEvent nMacroEvents; @@ -67,7 +68,7 @@ public: SvxLinkInsertMode eTyp, HyperDialogEvent nEvents = HyperDialogEvent::NONE, SvxMacroTableDtor *pMacroTbl =nullptr ); - virtual ~SvxHyperlinkItem () override { delete pMacroTable; } + virtual ~SvxHyperlinkItem () override {} inline SvxHyperlinkItem& operator=( const SvxHyperlinkItem &rItem ); @@ -94,7 +95,7 @@ public: void SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro ); void SetMacroTable( const SvxMacroTableDtor& rTbl ); - const SvxMacroTableDtor* GetMacroTable() const { return pMacroTable; } + const SvxMacroTableDtor* GetMacroTable() const { return pMacroTable.get(); } void SetMacroEvents (const HyperDialogEvent nEvents) { nMacroEvents = nEvents; } HyperDialogEvent GetMacroEvents() const { return nMacroEvents; } diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx index 6aeb86776d44..4a309e2ee17b 100644 --- a/include/svx/langbox.hxx +++ b/include/svx/langbox.hxx @@ -90,7 +90,8 @@ protected: Image m_aNotCheckedImage; Image m_aCheckedImage; OUString m_aAllString; - css::uno::Sequence< sal_Int16 > *m_pSpellUsedLang; + std::unique_ptr<css::uno::Sequence< sal_Int16 >> + m_pSpellUsedLang; SvxLanguageListFlags m_nLangList; bool m_bHasLangNone; bool m_bLangNoneIsLangAll; diff --git a/include/svx/numinf.hxx b/include/svx/numinf.hxx index 694f8d5a3592..c99f9859c53c 100644 --- a/include/svx/numinf.hxx +++ b/include/svx/numinf.hxx @@ -61,7 +61,7 @@ public: const OUString& GetValueString() const { return aStringVal; } double GetValueDouble() const { return nDoubleVal; } - const sal_uInt32* GetDelArray() const { return pDelFormatArr; } + const sal_uInt32* GetDelArray() const { return pDelFormatArr.get(); } void SetDelFormatArray( const sal_uInt32* pData, const sal_uInt32 nCount ); @@ -74,7 +74,8 @@ private: OUString aStringVal; double nDoubleVal; - sal_uInt32* pDelFormatArr; + std::unique_ptr<sal_uInt32[]> + pDelFormatArr; sal_uInt32 nDelCount; }; diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index ec29c0019c6d..c5988e7dc05e 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -228,7 +228,8 @@ class SVX_DLLPUBLIC SdrObjGeoData public: Rectangle aBoundRect; Point aAnchor; - SdrGluePointList* pGPL; + std::unique_ptr<SdrGluePointList> + pGPL; bool bMovProt; bool bSizProt; bool bNoPrint; diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx index e1e3b64c271b..548d5480262a 100644 --- a/include/svx/svdoedge.hxx +++ b/include/svx/svdoedge.hxx @@ -125,7 +125,7 @@ class SdrEdgeObjGeoData : public SdrTextObjGeoData public: SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs SdrObjConnection aCon2; // Verbindungszustand des Linienendes - XPolygon* pEdgeTrack; + std::unique_ptr<XPolygon> pEdgeTrack; bool bEdgeTrackDirty;// sal_True=Verbindungsverlauf muss neu berechnet werden. bool bEdgeTrackUserDefined; SdrEdgeInfoRec aEdgeInfo; diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx index b1694272d9e9..cc3384c5e4c4 100644 --- a/include/svx/svdogrp.hxx +++ b/include/svx/svdogrp.hxx @@ -42,7 +42,7 @@ protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; - SdrObjList* pSub; // Subliste (Kinder) + std::unique_ptr<SdrObjList> pSub; // Subliste (Kinder) Point aRefPoint; // Referenzpunkt innerhalb der Objektgruppe public: diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx index c8e332b53094..11d6b7d7d55d 100644 --- a/include/svx/svdorect.hxx +++ b/include/svx/svdorect.hxx @@ -46,7 +46,7 @@ protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; - XPolygon* mpXPoly; + std::unique_ptr<XPolygon> mpXPoly; protected: XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const; diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 132a77800c14..1790e48f7201 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -105,7 +105,8 @@ class ImpSdrObjTextLinkUserData : public SdrObjUserData OUString aFileName; // Name des referenzierten Dokuments OUString aFilterName; // ggf. ein Filter DateTime aFileDate0; // Unnoetiges neuladen vermeiden - ImpSdrObjTextLink* pLink; + std::unique_ptr<ImpSdrObjTextLink> + pLink; rtl_TextEncoding eCharSet; public: diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 1949e5d6a767..e53ca9872744 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -587,9 +587,9 @@ class SVX_DLLPUBLIC SdrUndoDelPage : public SdrUndoPageList { // When deleting a MasterPage, we remember all relations of the // Character Page with the MasterPage in this UndoGroup. - SdrUndoGroup* pUndoGroup; - std::unique_ptr<SfxPoolItem> mpFillBitmapItem; - bool mbHasFillBitmap; + std::unique_ptr<SdrUndoGroup> pUndoGroup; + std::unique_ptr<SfxPoolItem> mpFillBitmapItem; + bool mbHasFillBitmap; public: SdrUndoDelPage(SdrPage& rNewPg); diff --git a/include/svx/xbitmap.hxx b/include/svx/xbitmap.hxx index 761e8e1b1861..a20288f9e5e9 100644 --- a/include/svx/xbitmap.hxx +++ b/include/svx/xbitmap.hxx @@ -31,7 +31,7 @@ class SVX_DLLPUBLIC XOBitmap private: XBitmapType eType; std::unique_ptr<GraphicObject> xGraphicObject; - sal_uInt16* pPixelArray; + std::unique_ptr<sal_uInt16[]> pPixelArray; Size aArraySize; Color aPixelColor; Color aBckgrColor; diff --git a/include/svx/xexch.hxx b/include/svx/xexch.hxx index 10844c9be5fe..4722a6ce8621 100644 --- a/include/svx/xexch.hxx +++ b/include/svx/xexch.hxx @@ -22,6 +22,7 @@ #include <svx/svxdllapi.h> +#include <memory> //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Clipboard format for XOutDev filling attributes @@ -35,8 +36,8 @@ class SvStream; class SVX_DLLPUBLIC XFillExchangeData final { private: - XFillAttrSetItem* pXFillAttrSetItem; - SfxItemPool* pPool; + std::unique_ptr<XFillAttrSetItem> pXFillAttrSetItem; + SfxItemPool* pPool; public: XFillExchangeData(const XFillAttrSetItem& rXFillAttrSetItem); @@ -47,7 +48,7 @@ public: SVX_DLLPUBLIC friend SvStream& WriteXFillExchangeData( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData ); SVX_DLLPUBLIC friend SvStream& ReadXFillExchangeData( SvStream& rIStm, XFillExchangeData& rXFillExchangeData ); - XFillAttrSetItem* GetXFillAttrSetItem() { return pXFillAttrSetItem; } + XFillAttrSetItem* GetXFillAttrSetItem() { return pXFillAttrSetItem.get(); } }; #endif // INCLUDED_SVX_XEXCH_HXX |