diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-27 18:22:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-01 19:34:08 +0100 |
commit | 05d6dae5ebd172c6738dc8cd7c94b57f671f698e (patch) | |
tree | e21bb9218d09f52c0c700357ae814797657a6cea /include | |
parent | ee7368f6289ffc46425e4f3db1f7b40b7e6e089e (diff) |
loplugin:refcounting in sfx2
Change-Id: Iba7b1be688f1a7c1b0947c2423cc1965362386b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111682
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/framework/sfxhelperfunctions.hxx | 9 | ||||
-rw-r--r-- | include/sfx2/stbitem.hxx | 10 | ||||
-rw-r--r-- | include/sfx2/tbxctrl.hxx | 13 | ||||
-rw-r--r-- | include/sfx2/thumbnailviewitem.hxx | 3 |
4 files changed, 19 insertions, 16 deletions
diff --git a/include/framework/sfxhelperfunctions.hxx b/include/framework/sfxhelperfunctions.hxx index 0fedd75d11f5..7a30899d97de 100644 --- a/include/framework/sfxhelperfunctions.hxx +++ b/include/framework/sfxhelperfunctions.hxx @@ -22,6 +22,7 @@ #include <framework/fwkdllapi.h> #include <rtl/ustring.hxx> +#include <rtl/ref.hxx> namespace com::sun::star::frame { class XFrame; } namespace com::sun::star::uno { template <typename > class Reference; } @@ -31,13 +32,13 @@ namespace svt { class ToolboxController; } class StatusBar; class ToolBox; -typedef svt::ToolboxController* ( *pfunc_setToolBoxControllerCreator)( +typedef rtl::Reference<svt::ToolboxController> ( *pfunc_setToolBoxControllerCreator)( const css::uno::Reference< css::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL ); -typedef svt::StatusbarController* ( *pfunc_setStatusBarControllerCreator)( +typedef rtl::Reference<svt::StatusbarController> ( *pfunc_setStatusBarControllerCreator)( const css::uno::Reference< css::frame::XFrame >& rFrame, StatusBar* pStatusBar, unsigned short nID, @@ -58,14 +59,14 @@ typedef bool ( *pfunc_isDockingWindowVisible)( namespace framework { FWK_DLLPUBLIC pfunc_setToolBoxControllerCreator SetToolBoxControllerCreator( pfunc_setToolBoxControllerCreator pSetToolBoxControllerCreator ); -FWK_DLLPUBLIC svt::ToolboxController* CreateToolBoxController( +FWK_DLLPUBLIC rtl::Reference<svt::ToolboxController> CreateToolBoxController( const css::uno::Reference< css::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL ); FWK_DLLPUBLIC pfunc_setStatusBarControllerCreator SetStatusBarControllerCreator( pfunc_setStatusBarControllerCreator pSetStatusBarControllerCreator ); -FWK_DLLPUBLIC svt::StatusbarController* CreateStatusBarController( +FWK_DLLPUBLIC rtl::Reference<svt::StatusbarController> CreateStatusBarController( const css::uno::Reference< css::frame::XFrame >& rFrame, StatusBar* pStatusBar, unsigned short nID, diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx index 060866e4c3eb..a77dc04333b7 100644 --- a/include/sfx2/stbitem.hxx +++ b/include/sfx2/stbitem.hxx @@ -29,12 +29,12 @@ class SfxModule; class SfxStatusBarControl; class StatusBar; -svt::StatusbarController* SfxStatusBarControllerFactory( +rtl::Reference<svt::StatusbarController> SfxStatusBarControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, StatusBar* pStatusBar, unsigned short nID, const OUString& aCommandURL ); -typedef SfxStatusBarControl* (*SfxStatusBarControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ); +typedef rtl::Reference<SfxStatusBarControl> (*SfxStatusBarControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ); struct SfxStbCtrlFactory { @@ -111,18 +111,18 @@ public: sal_uInt16 GetId() const { return nId; } StatusBar& GetStatusBar() const { return *pBar; } - static SfxStatusBarControl* CreateControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule const * ); + static rtl::Reference<SfxStatusBarControl> CreateControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule const * ); static void RegisterStatusBarControl(SfxModule*, const SfxStbCtrlFactory&); }; #define SFX_DECL_STATUSBAR_CONTROL() \ - static SfxStatusBarControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ); \ + static rtl::Reference<SfxStatusBarControl> CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ); \ static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=nullptr) #define SFX_IMPL_STATUSBAR_CONTROL(Class, nItemClass) \ - SfxStatusBarControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \ + rtl::Reference<SfxStatusBarControl> Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \ { return new Class( nSlotId, nId, rStb ); } \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ { SfxStatusBarControl::RegisterStatusBarControl( pMod, SfxStbCtrlFactory( \ diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx index 9ce86c659143..daa9d77b84ac 100644 --- a/include/sfx2/tbxctrl.hxx +++ b/include/sfx2/tbxctrl.hxx @@ -26,6 +26,7 @@ #include <svl/poolitem.hxx> #include <svtools/toolboxcontroller.hxx> #include <vcl/window.hxx> +#include <rtl/ref.hxx> namespace com::sun::star::frame { class XDispatchProvider; } namespace com::sun::star::frame { class XFrame; } @@ -34,9 +35,9 @@ class InterimItemWindow; class SfxToolBoxControl; class SfxModule; -svt::ToolboxController* SfxToolBoxControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL ); +rtl::Reference<svt::ToolboxController> SfxToolBoxControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const OUString& aCommandURL ); -typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox ); +typedef rtl::Reference<SfxToolBoxControl> (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox ); struct SfxTbxCtrlFactory { @@ -54,7 +55,7 @@ struct SfxTbxCtrlFactory #define SFX_DECL_TOOLBOX_CONTROL() \ - static SfxToolBoxControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ); \ + static rtl::Reference<SfxToolBoxControl> CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ); \ static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=nullptr) /* For special ToolBox controls, such as a font selection box or toolbox @@ -115,19 +116,19 @@ public: css::uno::Sequence< css::beans::PropertyValue > const & aArgs ); static SfxItemState GetItemState( const SfxPoolItem* pState ); - static SfxToolBoxControl* CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule const *pMod ); + static rtl::Reference<SfxToolBoxControl> CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule const *pMod ); static void RegisterToolBoxControl( SfxModule*, const SfxTbxCtrlFactory&); }; #define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \ - SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ + rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ { return new Class( nSlotId, nId, rTbx ); } \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \ Class::CreateImpl, typeid(nItemClass), nSlotId ) ); } #define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \ - SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ + rtl::Reference<SfxToolBoxControl> Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ { return new Class( nSlotId, nId, rTbx, Arg); } \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \ diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index 0b80df682dbf..82c98e2c482d 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -23,6 +23,7 @@ #include <drawinglayer/attribute/fontattribute.hxx> #include <vcl/bitmapex.hxx> #include <sfx2/dllapi.h> +#include <rtl/ref.hxx> namespace com::sun::star::accessibility { class XAccessible; } namespace drawinglayer::primitive2d { class Primitive2DContainer; } @@ -122,7 +123,7 @@ public: const ThumbnailItemAttributes *pAttrs); void addTextPrimitives (const OUString& rText, const ThumbnailItemAttributes *pAttrs, Point aPos, drawinglayer::primitive2d::Primitive2DContainer& rSeq); - static drawinglayer::primitive2d::PolygonHairlinePrimitive2D* + static rtl::Reference<drawinglayer::primitive2d::PolygonHairlinePrimitive2D> createBorderLine (const basegfx::B2DPolygon &rPolygon); virtual void MouseButtonUp(const MouseEvent&) {} |