diff options
Diffstat (limited to 'include')
95 files changed, 618 insertions, 530 deletions
diff --git a/include/dbaccess/ToolBoxHelper.hxx b/include/dbaccess/ToolBoxHelper.hxx index 4757c8ffb802..d9671b45fe3b 100644 --- a/include/dbaccess/ToolBoxHelper.hxx +++ b/include/dbaccess/ToolBoxHelper.hxx @@ -23,6 +23,7 @@ #include <sal/types.h> #include <tools/link.hxx> #include <vcl/image.hxx> +#include <vcl/vclptr.hxx> #include <dbaccess/dbaccessdllapi.h> class SvtMiscOptions; @@ -34,7 +35,7 @@ namespace dbaui class DBACCESS_DLLPUBLIC OToolBoxHelper { sal_Int16 m_nSymbolsSize; // shows the toolbox large or small bitmaps - ToolBox* m_pToolBox; // our toolbox (may be NULL) + VclPtr<ToolBox> m_pToolBox; // our toolbox (may be NULL) public: OToolBoxHelper(); virtual ~OToolBoxHelper(); diff --git a/include/dbaccess/genericcontroller.hxx b/include/dbaccess/genericcontroller.hxx index 2b6ae5c37452..99a7afa577cc 100644 --- a/include/dbaccess/genericcontroller.hxx +++ b/include/dbaccess/genericcontroller.hxx @@ -59,6 +59,7 @@ #include <boost/optional.hpp> #include <sfx2/userinputinterception.hxx> +#include <vcl/vclptr.hxx> namespace dbtools { @@ -212,7 +213,7 @@ namespace dbaui ::std::unique_ptr< OGenericUnoController_Data > m_pData; - ODataView* m_pView; // our (VCL) "main window" + VclPtr<ODataView> m_pView; // our (VCL) "main window" #ifdef DBG_UTIL bool m_bDescribingSupportedFeatures; @@ -407,8 +408,8 @@ namespace dbaui public: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getORB() const { return m_xContext; } ODataView* getView() const { return m_pView; } - void setView( ODataView& i_rView ) { m_pView = &i_rView; } - void clearView() { m_pView = NULL; } + void setView( ODataView& i_rView ); + void clearView(); // shows a error box if the SQLExceptionInfo is valid void showError(const ::dbtools::SQLExceptionInfo& _rInfo); diff --git a/include/editeng/splwrap.hxx b/include/editeng/splwrap.hxx index 18547e96c6ac..749c836fe273 100644 --- a/include/editeng/splwrap.hxx +++ b/include/editeng/splwrap.hxx @@ -23,6 +23,7 @@ #include <editeng/svxenum.hxx> #include <rtl/ustring.hxx> #include <com/sun/star/uno/Reference.hxx> +#include <vcl/vclptr.hxx> // forward --------------------------------------------------------------- @@ -48,7 +49,7 @@ private: friend class SvxHyphenWordDialog; friend struct SvxHyphenWordDialog_Impl; - vcl::Window* pWin; + VclPtr<vcl::Window> pWin; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xLast; // result of last spelling/hyphenation attempt ::com::sun::star::uno::Reference< diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index 17713a7bdc7f..400a49b79876 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -34,7 +34,7 @@ class FORMULA_DLLPUBLIC RefEdit : public Edit private: Idle aIdle; IControlReferenceHandler* pAnyRefDlg; // parent dialog - vcl::Window* pLabelWidget; + VclPtr<vcl::Window> pLabelWidget; DECL_LINK( UpdateHdl, void* ); @@ -87,7 +87,7 @@ private: OUString aShrinkQuickHelp; OUString aExpandQuickHelp; IControlReferenceHandler* pAnyRefDlg; // parent dialog - RefEdit* pRefEdit; // zugeordnetes Edit-Control + VclPtr<RefEdit> pRefEdit; // zugeordnetes Edit-Control protected: virtual void Click() SAL_OVERRIDE; @@ -97,6 +97,8 @@ protected: public: RefButton(vcl::Window* _pParent, WinBits nStyle = 0); + virtual ~RefButton(); + virtual void dispose() SAL_OVERRIDE; void SetReferences( IControlReferenceHandler* pDlg, RefEdit* pEdit ); void SetStartImage(); void SetEndImage(); diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 438a2b57171e..99feed27df20 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -164,16 +164,12 @@ public: struct SingleTabDlgImpl { - SfxTabPage* m_pSfxPage; - FixedLine* m_pLine; + VclPtr<SfxTabPage> m_pSfxPage; + VclPtr<FixedLine> m_pLine; OUString m_sInfoURL; Link m_aInfoLink; - SingleTabDlgImpl() - : m_pSfxPage(NULL) - , m_pLine(NULL) - { - } + SingleTabDlgImpl(); }; typedef const sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte @@ -201,9 +197,9 @@ public: protected: GetTabPageRanges fnGetRanges; - OKButton* pOKBtn; - CancelButton* pCancelBtn; - HelpButton* pHelpBtn; + VclPtr<OKButton> pOKBtn; + VclPtr<CancelButton> pCancelBtn; + VclPtr<HelpButton> pHelpBtn; SingleTabDlgImpl* pImpl; diff --git a/include/sfx2/checkin.hxx b/include/sfx2/checkin.hxx index c5d93f68846d..54d2dffa2174 100644 --- a/include/sfx2/checkin.hxx +++ b/include/sfx2/checkin.hxx @@ -16,15 +16,17 @@ class SfxCheckinDialog : public ModalDialog { private: - Edit* m_pCommentED; - CheckBox* m_pMajorCB; + VclPtr<Edit> m_pCommentED; + VclPtr<CheckBox> m_pMajorCB; - OKButton* m_pOKBtn; + VclPtr<OKButton> m_pOKBtn; DECL_DLLPRIVATE_LINK(OKHdl, void *); public: SfxCheckinDialog( vcl::Window* pParent ); + virtual ~SfxCheckinDialog(); + virtual void dispose() SAL_OVERRIDE; OUString GetComment( ); bool IsMajor( ); diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index a74b236a3f63..eb43f8e38343 100644 --- a/include/sfx2/childwin.hxx +++ b/include/sfx2/childwin.hxx @@ -124,7 +124,7 @@ struct SfxChildWindow_Impl; class SFX2_DLLPUBLIC SfxChildWindowContext { friend class SfxChildWindow; - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; sal_uInt16 nContextId; protected: @@ -148,12 +148,12 @@ public: class SFX2_DLLPUBLIC SfxChildWindow { - vcl::Window* pParent; // parent window ( Topwindow ) - sal_uInt16 nType; // ChildWindow-Id + VclPtr<vcl::Window> pParent; // parent window ( Topwindow ) + sal_uInt16 nType; // ChildWindow-Id protected: SfxChildAlignment eChildAlignment; // Current ::com::sun::star::drawing::Alignment - vcl::Window* pWindow; // actual contents + VclPtr<vcl::Window> pWindow; // actual contents SfxChildWindow_Impl* pImp; // Implementation data private: diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index e5496c090d93..77f13dc30494 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -180,27 +180,27 @@ public: class SfxDocumentPage : public SfxTabPage { private: - FixedImage* m_pBmp; - SelectableFixedText* m_pNameED; - PushButton* m_pChangePassBtn; + VclPtr<FixedImage> m_pBmp; + VclPtr<SelectableFixedText> m_pNameED; + VclPtr<PushButton> m_pChangePassBtn; - SelectableFixedText* m_pShowTypeFT; - Edit* m_pFileValEd; - SelectableFixedText* m_pShowSizeFT; + VclPtr<SelectableFixedText> m_pShowTypeFT; + VclPtr<Edit> m_pFileValFt; + VclPtr<SelectableFixedText> m_pShowSizeFT; - SelectableFixedText* m_pCreateValFt; - SelectableFixedText* m_pChangeValFt; - SelectableFixedText* m_pSignedValFt; - PushButton* m_pSignatureBtn; - SelectableFixedText* m_pPrintValFt; - SelectableFixedText* m_pTimeLogValFt; - SelectableFixedText* m_pDocNoValFt; + VclPtr<SelectableFixedText> m_pCreateValFt; + VclPtr<SelectableFixedText> m_pChangeValFt; + VclPtr<SelectableFixedText> m_pSignedValFt; + VclPtr<PushButton> m_pSignatureBtn; + VclPtr<SelectableFixedText> m_pPrintValFt; + VclPtr<SelectableFixedText> m_pTimeLogValFt; + VclPtr<SelectableFixedText> m_pDocNoValFt; - CheckBox* m_pUseUserDataCB; - PushButton* m_pDeleteBtn; + VclPtr<CheckBox> m_pUseUserDataCB; + VclPtr<PushButton> m_pDeleteBtn; - FixedText* m_pTemplFt; - SelectableFixedText* m_pTemplValFt; + VclPtr<FixedText> m_pTemplFt; + VclPtr<SelectableFixedText> m_pTemplValFt; OUString m_aUnknownSize; OUString m_aMultiSignedStr; @@ -216,6 +216,8 @@ private: protected: SfxDocumentPage( vcl::Window* pParent, const SfxItemSet& ); + virtual ~SfxDocumentPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE; @@ -231,14 +233,16 @@ public: class SfxDocumentDescPage : public SfxTabPage { private: - Edit* m_pTitleEd; - Edit* m_pThemaEd; - Edit* m_pKeywordsEd; - VclMultiLineEdit* m_pCommentEd; - SfxDocumentInfoItem* m_pInfoItem; + VclPtr<Edit> m_pTitleEd; + VclPtr<Edit> m_pThemaEd; + VclPtr<Edit> m_pKeywordsEd; + VclPtr<VclMultiLineEdit> m_pCommentEd; + SfxDocumentInfoItem* m_pInfoItem; protected: SfxDocumentDescPage( vcl::Window* pParent, const SfxItemSet& ); + virtual ~SfxDocumentDescPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE; @@ -414,9 +418,9 @@ struct CustomPropertyLine class CustomPropertiesWindow : public vcl::Window { private: - FixedText* m_pHeaderAccName; - FixedText* m_pHeaderAccType; - FixedText* m_pHeaderAccValue; + VclPtr<FixedText> m_pHeaderAccName; + VclPtr<FixedText> m_pHeaderAccType; + VclPtr<FixedText> m_pHeaderAccValue; VclPtr<ComboBox> m_aNameBox; VclPtr<ListBox> m_aTypeBox; @@ -479,11 +483,11 @@ public: class CustomPropertiesControl : public vcl::Window { private: - VclVBox* m_pVBox; - HeaderBar* m_pHeaderBar; - VclHBox* m_pBody; - CustomPropertiesWindow* m_pPropertiesWin; - ScrollBar* m_pVertScroll; + VclPtr<VclVBox> m_pVBox; + VclPtr<HeaderBar> m_pHeaderBar; + VclPtr<VclHBox> m_pBody; + VclPtr<CustomPropertiesWindow> m_pPropertiesWin; + VclPtr<ScrollBar> m_pVertScroll; sal_Int32 m_nThumbPos; @@ -511,7 +515,7 @@ public: class SfxCustomPropertiesPage : public SfxTabPage { private: - CustomPropertiesControl* m_pPropertiesCtrl; + VclPtr<CustomPropertiesControl> m_pPropertiesCtrl; DECL_LINK(AddHdl, void *); @@ -519,6 +523,8 @@ private: protected: SfxCustomPropertiesPage( vcl::Window* pParent, const SfxItemSet& ); + virtual ~SfxCustomPropertiesPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE; @@ -530,23 +536,23 @@ public: struct CmisValue : public VclBuilderContainer { - Edit* m_aValueEdit; + VclPtr<Edit> m_aValueEdit; CmisValue( vcl::Window* pParent, const OUString& aStr ); }; struct CmisDateTime : public VclBuilderContainer { - DateField* m_aDateField; - TimeField* m_aTimeField; + VclPtr<DateField> m_aDateField; + VclPtr<TimeField> m_aTimeField; CmisDateTime( vcl::Window* pParent, const ::com::sun::star::util::DateTime& aDateTime ); }; struct CmisYesNo : public VclBuilderContainer { - RadioButton* m_aYesButton; - RadioButton* m_aNoButton; + VclPtr<RadioButton> m_aYesButton; + VclPtr<RadioButton> m_aNoButton; CmisYesNo( vcl::Window* pParent, bool bValue); }; @@ -555,15 +561,15 @@ struct CmisYesNo : public VclBuilderContainer struct CmisPropertyLine : public VclBuilderContainer { - VclFrame* m_pFrame; + VclPtr<VclFrame> m_pFrame; OUString m_sId; OUString m_sType; bool m_bUpdatable; bool m_bRequired; bool m_bMultiValued; bool m_bOpenChoice; - FixedText* m_aName; - FixedText* m_aType; + VclPtr<FixedText> m_aName; + VclPtr<FixedText> m_aType; std::vector< CmisValue* > m_aValues; std::vector< CmisDateTime* > m_aDateTimes; std::vector< CmisYesNo* > m_aYesNos; @@ -578,7 +584,7 @@ struct CmisPropertyLine : public VclBuilderContainer class CmisPropertiesWindow { private: - VclBox* m_pBox; + VclPtr<VclBox> m_pBox; sal_Int32 m_nItemHeight; SvNumberFormatter m_aNumberFormatter; std::vector< CmisPropertyLine* > m_aCmisPropertiesLines; diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx index 7e66740176ac..3ae423726ca0 100644 --- a/include/sfx2/fcontnr.hxx +++ b/include/sfx2/fcontnr.hxx @@ -57,14 +57,13 @@ public: class SfxFrameWindow { - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; public: SfxFrameWindow( vcl::Window *pWin ) : pWindow( pWin ) {} - virtual ~SfxFrameWindow() - { delete pWindow; } + virtual ~SfxFrameWindow() {} vcl::Window* GetWindow() const { return pWindow; } void SetWindow( vcl::Window *pWin ) diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx index fcd6c46c748b..d9c3620ee1eb 100644 --- a/include/sfx2/frame.hxx +++ b/include/sfx2/frame.hxx @@ -29,6 +29,7 @@ #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <vcl/vclptr.hxx> namespace com { @@ -103,7 +104,7 @@ private: SfxFrame* pParentFrame; SfxFrameArr_Impl* pChildArr; SfxFrame_Impl* pImp; - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; protected: bool Close(); diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx index 8fe7920473c4..7a89267b3bc5 100644 --- a/include/sfx2/infobar.hxx +++ b/include/sfx2/infobar.hxx @@ -43,15 +43,14 @@ class SFX2_DLLPUBLIC SfxInfoBarContainerChild : public SfxChildWindow class SfxInfoBarWindow : public vcl::Window { private: - OUString m_sId; - - std::unique_ptr<FixedText> m_pMessage; - std::unique_ptr<Button> m_pCloseBtn; - - boost::ptr_vector<PushButton> m_aActionBtns; + OUString m_sId; + VclPtr<FixedText> m_pMessage; + VclPtr<Button> m_pCloseBtn; + std::vector< VclPtr<PushButton> > m_aActionBtns; public: - SfxInfoBarWindow(vcl::Window* parent, const OUString& sId, const OUString& sMessage); + SfxInfoBarWindow( vcl::Window* parent, const OUString& sId, + const OUString& sMessage ); virtual ~SfxInfoBarWindow( ); virtual void dispose() SAL_OVERRIDE; @@ -72,8 +71,8 @@ class SfxInfoBarWindow : public vcl::Window class SfxInfoBarContainerWindow : public vcl::Window { private: - SfxInfoBarContainerChild* m_pChildWin; - boost::ptr_vector<SfxInfoBarWindow> m_pInfoBars; + SfxInfoBarContainerChild* m_pChildWin; + std::vector< VclPtr<SfxInfoBarWindow> > m_pInfoBars; public: SfxInfoBarContainerWindow(SfxInfoBarContainerChild* pChildWin); diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx index 10ab174bbdbd..56282188f45e 100644 --- a/include/sfx2/ipclient.hxx +++ b/include/sfx2/ipclient.hxx @@ -44,7 +44,7 @@ friend class SfxInPlaceClient_Impl; SfxInPlaceClient_Impl* m_pImp; SfxViewShell* m_pViewSh; - vcl::Window* m_pEditWin; + VclPtr<vcl::Window> m_pEditWin; // called after the requested new object area was negotiated SAL_DLLPRIVATE virtual void ObjectAreaChanged(); diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx index 42c265637306..00b8309e1a0b 100644 --- a/include/sfx2/mgetempl.hxx +++ b/include/sfx2/mgetempl.hxx @@ -36,23 +36,23 @@ class SfxStyleSheetBase; class SfxManageStyleSheetPage : public SfxTabPage { - VclMultiLineEdit* m_pNameRo; - Edit* m_pNameRw; + VclPtr<VclMultiLineEdit> m_pNameRo; + VclPtr<Edit> m_pNameRw; - CheckBox* m_pAutoCB; + VclPtr<CheckBox> m_pAutoCB; - FixedText* m_pFollowFt; - ListBox* m_pFollowLb; - PushButton* m_pEditStyleBtn; + VclPtr<FixedText> m_pFollowFt; + VclPtr<ListBox> m_pFollowLb; + VclPtr<PushButton> m_pEditStyleBtn; - FixedText* m_pBaseFt; - ListBox* m_pBaseLb; - PushButton* m_pEditLinkStyleBtn; + VclPtr<FixedText> m_pBaseFt; + VclPtr<ListBox> m_pBaseLb; + VclPtr<PushButton> m_pEditLinkStyleBtn; - FixedText* m_pFilterFt; - ListBox* m_pFilterLb; + VclPtr<FixedText> m_pFilterFt; + VclPtr<ListBox> m_pFilterLb; - FixedText *m_pDescFt; + VclPtr<FixedText> m_pDescFt; SfxStyleSheetBase *pStyle; SfxStyleFamilies *pFamilies; diff --git a/include/sfx2/newstyle.hxx b/include/sfx2/newstyle.hxx index c41744f83eec..1a23a8d78683 100644 --- a/include/sfx2/newstyle.hxx +++ b/include/sfx2/newstyle.hxx @@ -33,8 +33,8 @@ class SfxStyleSheetBasePool; class SFX2_DLLPUBLIC SfxNewStyleDlg : public ModalDialog { private: - ComboBox* m_pColBox; - OKButton* m_pOKBtn; + VclPtr<ComboBox> m_pColBox; + VclPtr<OKButton> m_pOKBtn; VclPtr<MessageDialog> aQueryOverwriteBox; SfxStyleSheetBasePool& rPool; diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx index 363e9b9e1c71..6d0d79adfb2e 100644 --- a/include/sfx2/passwd.hxx +++ b/include/sfx2/passwd.hxx @@ -42,23 +42,23 @@ class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog { private: - VclFrame* mpPassword1Box; - FixedText* mpUserFT; - Edit* mpUserED; - FixedText* mpPassword1FT; - Edit* mpPassword1ED; - FixedText* mpConfirm1FT; - Edit* mpConfirm1ED; + VclPtr<VclFrame> mpPassword1Box; + VclPtr<FixedText> mpUserFT; + VclPtr<Edit> mpUserED; + VclPtr<FixedText> mpPassword1FT; + VclPtr<Edit> mpPassword1ED; + VclPtr<FixedText> mpConfirm1FT; + VclPtr<Edit> mpConfirm1ED; - VclFrame* mpPassword2Box; - FixedText* mpPassword2FT; - Edit* mpPassword2ED; - FixedText* mpConfirm2FT; - Edit* mpConfirm2ED; + VclPtr<VclFrame> mpPassword2Box; + VclPtr<FixedText> mpPassword2FT; + VclPtr<Edit> mpPassword2ED; + VclPtr<FixedText> mpConfirm2FT; + VclPtr<Edit> mpConfirm2ED; - FixedText* mpMinLengthFT; + VclPtr<FixedText> mpMinLengthFT; - OKButton* mpOKBtn; + VclPtr<OKButton> mpOKBtn; OUString maMinLenPwdStr; OUString maMinLenPwdStr1; @@ -75,6 +75,8 @@ private: public: SfxPasswordDialog(vcl::Window* pParent, const OUString* pGroupText = NULL); + virtual ~SfxPasswordDialog(); + virtual void dispose() SAL_OVERRIDE; OUString GetUser() const { diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx index 477e98ef6a48..ecb35c96d8cc 100644 --- a/include/sfx2/printopt.hxx +++ b/include/sfx2/printopt.hxx @@ -41,32 +41,32 @@ class SFX2_DLLPUBLIC SfxCommonPrintOptionsTabPage : public SfxTabPage { private: - RadioButton* m_pPrinterOutputRB; - RadioButton* m_pPrintFileOutputRB; + VclPtr<RadioButton> m_pPrinterOutputRB; + VclPtr<RadioButton> m_pPrintFileOutputRB; - CheckBox* m_pReduceTransparencyCB; - RadioButton* m_pReduceTransparencyAutoRB; - RadioButton* m_pReduceTransparencyNoneRB; + VclPtr<CheckBox> m_pReduceTransparencyCB; + VclPtr<RadioButton> m_pReduceTransparencyAutoRB; + VclPtr<RadioButton> m_pReduceTransparencyNoneRB; - CheckBox* m_pReduceGradientsCB; - RadioButton* m_pReduceGradientsStripesRB; - RadioButton* m_pReduceGradientsColorRB; - NumericField* m_pReduceGradientsStepCountNF; + VclPtr<CheckBox> m_pReduceGradientsCB; + VclPtr<RadioButton> m_pReduceGradientsStripesRB; + VclPtr<RadioButton> m_pReduceGradientsColorRB; + VclPtr<NumericField> m_pReduceGradientsStepCountNF; - CheckBox* m_pReduceBitmapsCB; - RadioButton* m_pReduceBitmapsOptimalRB; - RadioButton* m_pReduceBitmapsNormalRB; - RadioButton* m_pReduceBitmapsResolutionRB; - ListBox* m_pReduceBitmapsResolutionLB; - CheckBox* m_pReduceBitmapsTransparencyCB; + VclPtr<CheckBox> m_pReduceBitmapsCB; + VclPtr<RadioButton> m_pReduceBitmapsOptimalRB; + VclPtr<RadioButton> m_pReduceBitmapsNormalRB; + VclPtr<RadioButton> m_pReduceBitmapsResolutionRB; + VclPtr<ListBox> m_pReduceBitmapsResolutionLB; + VclPtr<CheckBox> m_pReduceBitmapsTransparencyCB; - CheckBox* m_pConvertToGreyscalesCB; + VclPtr<CheckBox> m_pConvertToGreyscalesCB; - CheckBox* m_pPDFCB; + VclPtr<CheckBox> m_pPDFCB; - CheckBox* m_pPaperSizeCB; - CheckBox* m_pPaperOrientationCB; - CheckBox* m_pTransparencyCB; + VclPtr<CheckBox> m_pPaperSizeCB; + VclPtr<CheckBox> m_pPaperOrientationCB; + VclPtr<CheckBox> m_pTransparencyCB; private: @@ -94,7 +94,8 @@ protected: public: SfxCommonPrintOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); - + virtual ~SfxCommonPrintOptionsTabPage(); + virtual void dispose() SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; virtual vcl::Window* GetParentLabeledBy( const vcl::Window* pLabel ) const SAL_OVERRIDE; diff --git a/include/sfx2/prnmon.hxx b/include/sfx2/prnmon.hxx index 22378a52f503..ff42cb0253df 100644 --- a/include/sfx2/prnmon.hxx +++ b/include/sfx2/prnmon.hxx @@ -38,7 +38,7 @@ private: SfxPrintOptDlg_Impl* pDlgImpl; SfxViewShell* pViewSh; SfxItemSet* pOptions; - SfxTabPage* pPage; + VclPtr<SfxTabPage> pPage; public: SfxPrintOptionsDialog( vcl::Window *pParent, diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx index 6215f6d03e64..a3c9cbcaa01e 100644 --- a/include/sfx2/sidebar/SidebarPanelBase.hxx +++ b/include/sfx2/sidebar/SidebarPanelBase.hxx @@ -33,6 +33,7 @@ #include <boost/noncopyable.hpp> #include <boost/function.hpp> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } @@ -111,7 +112,7 @@ protected: throw (css::uno::RuntimeException) SAL_OVERRIDE; private: - vcl::Window* mpControl; + VclPtr<vcl::Window> mpControl; const ::rtl::OUString msResourceURL; const css::ui::LayoutSize maLayoutSize; }; diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx index 835fcff98b46..9e4850a46e15 100644 --- a/include/sfx2/stbitem.hxx +++ b/include/sfx2/stbitem.hxx @@ -59,9 +59,9 @@ class UserDrawEvent; class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController { - sal_uInt16 nSlotId; - sal_uInt16 nId; - StatusBar* pBar; + sal_uInt16 nSlotId; + sal_uInt16 nId; + VclPtr<StatusBar> pBar; protected: // new controller API diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index e30588f25043..d1758879ca5b 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -64,16 +64,16 @@ friend class SfxTabDialogController; SfxViewFrame* pFrame; - VclBox *m_pBox; - TabControl *m_pTabCtrl; + VclPtr<VclBox> m_pBox; + VclPtr<TabControl> m_pTabCtrl; - PushButton* m_pOKBtn; - PushButton* m_pApplyBtn; - PushButton* m_pUserBtn; - CancelButton* m_pCancelBtn; - HelpButton* m_pHelpBtn; - PushButton* m_pResetBtn; - PushButton* m_pBaseFmtBtn; + VclPtr<PushButton> m_pOKBtn; + VclPtr<PushButton> m_pApplyBtn; + VclPtr<PushButton> m_pUserBtn; + VclPtr<CancelButton> m_pCancelBtn; + VclPtr<HelpButton> m_pHelpBtn; + VclPtr<PushButton> m_pResetBtn; + VclPtr<PushButton> m_pBaseFmtBtn; bool m_bOwnsOKBtn; bool m_bOwnsCancelBtn; @@ -106,7 +106,7 @@ protected: virtual void RefreshInputSet(); virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); - VclButtonBox* m_pActionArea; + VclPtr<VclButtonBox> m_pActionArea; SfxItemSet* pExampleSet; SfxItemSet* GetInputSetImpl(); SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const; diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx index 76ea4bda5317..b347744c0de5 100644 --- a/include/sfx2/templatedlg.hxx +++ b/include/sfx2/templatedlg.hxx @@ -143,16 +143,16 @@ private: private: - TabControl *mpTabControl; - - Edit *mpSearchEdit; - ToolBox *mpViewBar; - ToolBox *mpActionBar; - ToolBox *mpTemplateBar; - TemplateSearchView *mpSearchView; - TemplateAbstractView *mpCurView; - TemplateLocalView *mpLocalView; - TemplateRemoteView *mpRemoteView; + VclPtr<TabControl> mpTabControl; + + VclPtr<Edit> mpSearchEdit; + VclPtr<ToolBox> mpViewBar; + VclPtr<ToolBox> mpActionBar; + VclPtr<ToolBox> mpTemplateBar; + VclPtr<TemplateSearchView> mpSearchView; + VclPtr<TemplateAbstractView> mpCurView; + VclPtr<TemplateLocalView> mpLocalView; + VclPtr<TemplateRemoteView> mpRemoteView; PopupMenu *mpActionMenu; PopupMenu *mpRepositoryMenu; PopupMenu *mpTemplateDefaultMenu; diff --git a/include/sfx2/templateinfodlg.hxx b/include/sfx2/templateinfodlg.hxx index fabd7409fd32..97a711c58028 100644 --- a/include/sfx2/templateinfodlg.hxx +++ b/include/sfx2/templateinfodlg.hxx @@ -38,11 +38,11 @@ protected: private: - PushButton* mpBtnClose; - VclBox* mpBox; + VclPtr<PushButton> mpBtnClose; + VclPtr<VclBox> mpBox; - vcl::Window *mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor) - svtools::ODocumentInfoPreview *mpInfoView; + VclPtr<vcl::Window> mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor) + VclPtr<svtools::ODocumentInfoPreview> mpInfoView; ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > m_xFrame; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow; diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index 2191ef5845e9..0e4a7e0af1cf 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -309,7 +309,7 @@ protected: ThumbnailValueItemList mItemList; ThumbnailValueItemList mFilteredItemList; ///< Cache to store the filtered items ThumbnailValueItemList::iterator mpStartSelRange; - ScrollBar* mpScrBar; + VclPtr<ScrollBar> mpScrBar; long mnHeaderHeight; long mnItemWidth; long mnItemHeight; diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index 9136a5688476..a4c7bbcdb920 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -138,7 +138,7 @@ protected: Rectangle maDrawArea; Link maClickHdl; bool mbEditTitle; - VclMultiLineEdit* mpTitleED; + VclPtr<VclMultiLineEdit> mpTitleED; Rectangle maTextEditMaxArea; }; diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 08d3682e8986..bb7379da1a41 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -37,6 +37,7 @@ #include <tools/errcode.hxx> #include <vcl/jobset.hxx> #include <o3tl/typed_flags_set.hxx> +#include <vcl/vclptr.hxx> class SfxBaseController; class Size; @@ -140,7 +141,7 @@ friend class SfxPrinterController; struct SfxViewShell_Impl* pImp; SfxViewFrame* pFrame; SfxShell* pSubShell; - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; bool bNoNewWindow; protected: diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx index 5c8e7ed0c76c..884e08b3e2a2 100644 --- a/include/svtools/GraphicExportOptionsDialog.hxx +++ b/include/svtools/GraphicExportOptionsDialog.hxx @@ -37,9 +37,9 @@ class SVT_DLLPUBLIC GraphicExportOptionsDialog : public ModalDialog { private: - NumericField* mpWidth; - NumericField* mpHeight; - ComboBox* mpResolution; + VclPtr<NumericField> mpWidth; + VclPtr<NumericField> mpHeight; + VclPtr<ComboBox> mpResolution; Size mSize100mm; double mResolution; @@ -62,7 +62,8 @@ private: public: GraphicExportOptionsDialog( vcl::Window* pWindow, const css::uno::Reference<css::lang::XComponent>& rxSourceDocument ); - + virtual ~GraphicExportOptionsDialog(); + virtual void dispose() SAL_OVERRIDE; css::uno::Sequence<css::beans::PropertyValue> getFilterData(); }; diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index de8c9562dd80..a3e4c2caa77b 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -27,15 +27,15 @@ class SVT_DLLPUBLIC PlaceEditDialog : public ModalDialog { private : - Edit* m_pEDServerName; - ListBox* m_pLBServerType; + VclPtr<Edit> m_pEDServerName; + VclPtr<ListBox> m_pLBServerType; std::shared_ptr< DetailsContainer > m_xCurrentDetails; - Edit* m_pEDUsername; - OKButton* m_pBTOk; - CancelButton* m_pBTCancel; + VclPtr<Edit> m_pEDUsername; + VclPtr<OKButton> m_pBTOk; + VclPtr<CancelButton> m_pBTCancel; - PushButton* m_pBTDelete; + VclPtr<PushButton> m_pBTDelete; /** Vector holding the details UI control for each server type. @@ -50,6 +50,7 @@ public : PlaceEditDialog( vcl::Window* pParent); PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place> &rPlace ); virtual ~PlaceEditDialog(); + virtual void dispose() SAL_OVERRIDE; // Returns a place instance with given information std::shared_ptr<Place> GetPlace(); diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index a4997b3113c7..9c17ecea0191 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -25,7 +25,7 @@ class DetailsContainer { private: Link m_aChangeHdl; - VclFrame* m_pFrame; + VclPtr<VclFrame> m_pFrame; public: DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame ); @@ -57,9 +57,9 @@ class HostDetailsContainer : public DetailsContainer OUString m_sScheme; protected: - Edit* m_pEDHost; - NumericField* m_pEDPort; - Edit* m_pEDPath; + VclPtr<Edit> m_pEDHost; + VclPtr<NumericField> m_pEDPort; + VclPtr<Edit> m_pEDPath; public: HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ); @@ -81,7 +81,7 @@ class HostDetailsContainer : public DetailsContainer class DavDetailsContainer : public HostDetailsContainer { private: - CheckBox* m_pCBDavs; + VclPtr<CheckBox> m_pCBDavs; public: DavDetailsContainer( VclBuilderContainer* pBuilder ); @@ -99,9 +99,9 @@ class DavDetailsContainer : public HostDetailsContainer class SmbDetailsContainer : public DetailsContainer { private: - Edit* m_pEDHost; - Edit* m_pEDShare; - Edit* m_pEDPath; + VclPtr<Edit> m_pEDHost; + VclPtr<Edit> m_pEDShare; + VclPtr<Edit> m_pEDPath; public: SmbDetailsContainer( VclBuilderContainer* pBuilder ); @@ -120,11 +120,11 @@ class CmisDetailsContainer : public DetailsContainer std::vector< OUString > m_aRepoIds; OUString m_sRepoId; - Edit* m_pEDBinding; - ListBox* m_pLBRepository; - Button* m_pBTRepoRefresh; - ListBox* m_pLBServerType; - Edit* m_pEDPath; + VclPtr<Edit> m_pEDBinding; + VclPtr<ListBox> m_pLBRepository; + VclPtr<Button> m_pBTRepoRefresh; + VclPtr<ListBox> m_pLBServerType; + VclPtr<Edit> m_pEDPath; public: CmisDetailsContainer( VclBuilderContainer* pBuilder ); diff --git a/include/svtools/accessibleruler.hxx b/include/svtools/accessibleruler.hxx index a3fe1c5a0580..a006de144a2e 100644 --- a/include/svtools/accessibleruler.hxx +++ b/include/svtools/accessibleruler.hxx @@ -38,6 +38,7 @@ #include <comphelper/broadcasthelper.hxx> #include <cppuhelper/implbase5.hxx> #include <comphelper/servicehelper.hxx> +#include <vcl/vclptr.hxx> namespace com { namespace sun { namespace star { namespace awt { struct Point; @@ -198,7 +199,7 @@ private: mxParent; /// pointer to internal representation - Ruler* mpRepr; + VclPtr<Ruler> mpRepr; /// client id in the AccessibleEventNotifier queue sal_uInt32 mnClientId; diff --git a/include/svtools/addresstemplate.hxx b/include/svtools/addresstemplate.hxx index dec91a887b1d..28bc7edfcc1d 100644 --- a/include/svtools/addresstemplate.hxx +++ b/include/svtools/addresstemplate.hxx @@ -48,10 +48,10 @@ namespace svt { private: // Controls - ComboBox* m_pDatasource; - PushButton* m_pAdministrateDatasources; - ComboBox* m_pTable; - ScrollBar* m_pFieldScroller; + VclPtr<ComboBox> m_pDatasource; + VclPtr<PushButton> m_pAdministrateDatasources; + VclPtr<ComboBox> m_pTable; + VclPtr<ScrollBar> m_pFieldScroller; // string to display for "no selection" const OUString m_sNoFieldSelection; diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index 779815cf2e8a..b7d900443466 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -130,9 +130,9 @@ typedef sal_uLong BrowserMode; class BrowseEvent { - vcl::Window* pWin; - long nRow; - Rectangle aRect; + VclPtr<vcl::Window> pWin; + long nRow; + Rectangle aRect; sal_uInt16 nCol; sal_uInt16 nColId; @@ -143,10 +143,10 @@ public: sal_uInt16 nColumn, sal_uInt16 nColumnId, const Rectangle& rRect ); - vcl::Window* GetWindow() const { return pWin; } + vcl::Window* GetWindow() const { return pWin; } long GetRow() const { return nRow; } - sal_uInt16 GetColumn() const { return nCol; } - sal_uInt16 GetColumnId() const { return nColId; } + sal_uInt16 GetColumn() const { return nCol; } + sal_uInt16 GetColumnId() const { return nColId; } const Rectangle& GetRect() const { return aRect; } }; @@ -219,8 +219,8 @@ public: static const sal_uInt16 HandleColumnId = 0; private: - vcl::Window* pDataWin; // window to display data rows - ScrollBar* pVScroll; // vertical scrollbar + VclPtr<vcl::Window> pDataWin; // window to display data rows + VclPtr<ScrollBar> pVScroll; // vertical scrollbar VclPtr<ScrollBar> aHScroll; // horizontal scrollbar long nDataRowHeight; // height of a single data-row diff --git a/include/svtools/brwhead.hxx b/include/svtools/brwhead.hxx index e60949100731..c82ccace0601 100644 --- a/include/svtools/brwhead.hxx +++ b/include/svtools/brwhead.hxx @@ -29,8 +29,11 @@ class BrowseBox; class SVT_DLLPUBLIC BrowserHeader: public HeaderBar { - BrowseBox* _pBrowseBox; + VclPtr<BrowseBox> _pBrowseBox; +public: + virtual ~BrowserHeader(); + virtual void dispose() SAL_OVERRIDE; protected: virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void Select() SAL_OVERRIDE; diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx index 7948150cce1b..189be3aa81e6 100644 --- a/include/svtools/calendar.hxx +++ b/include/svtools/calendar.hxx @@ -401,11 +401,11 @@ method in CalendarField and create an own calendar there ourselves. class SVT_DLLPUBLIC CalendarField : public DateField { private: - ImplCFieldFloatWin* mpFloatWin; - Calendar* mpCalendar; + VclPtr<ImplCFieldFloatWin> mpFloatWin; + VclPtr<Calendar> mpCalendar; WinBits mnCalendarStyle; - PushButton* mpTodayBtn; - PushButton* mpNoneBtn; + VclPtr<PushButton> mpTodayBtn; + VclPtr<PushButton> mpNoneBtn; Date maDefaultDate; bool mbToday; bool mbNone; diff --git a/include/svtools/colrdlg.hxx b/include/svtools/colrdlg.hxx index 1919ba0666c4..4fe31bfa1d8a 100644 --- a/include/svtools/colrdlg.hxx +++ b/include/svtools/colrdlg.hxx @@ -21,7 +21,7 @@ #define INCLUDED_SVTOOLS_COLRDLG_HXX #include <svtools/svtdllapi.h> - +#include <vcl/vclptr.hxx> #include <tools/color.hxx> namespace vcl { class Window; } @@ -50,9 +50,9 @@ public: short Execute(); private: - vcl::Window* mpParent; - Color maColor; - sal_Int16 meMode; + VclPtr<vcl::Window> mpParent; + Color maColor; + sal_Int16 meMode; }; #endif // INCLUDED_SVTOOLS_COLRDLG_HXX diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index eedf170d9a8a..4031d410b8c5 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -80,7 +80,7 @@ namespace svt friend class EditBrowseBox; protected: - Control* pWindow; + VclPtr<Control> pWindow; bool bSuspended; // <true> if the window is hidden and disabled public: @@ -274,7 +274,7 @@ namespace svt class SVT_DLLPUBLIC CheckBoxControl : public Control { - CheckBox* pBox; + VclPtr<CheckBox> pBox; Rectangle aFocusRect; Link m_aClickLink,m_aModifyLink; @@ -475,7 +475,7 @@ namespace svt aOldController; ImplSVEvent * nStartEvent, * nEndEvent, * nCellModifiedEvent; // event ids - vcl::Window* m_pFocusWhileRequest; + VclPtr<vcl::Window> m_pFocusWhileRequest; // In ActivateCell, we grab the focus asynchronously, but if between requesting activation // and the asynchornous event the focus has changed, we won't grab it for ourself. @@ -487,14 +487,14 @@ namespace svt mutable bool bPaintStatus : 1; // paint a status (image) in the handle column bool bActiveBeforeTracking; - CheckBoxControl* pCheckBoxPaint; + VclPtr<CheckBoxControl> pCheckBoxPaint; sal_Int32 m_nBrowserFlags; ImageList m_aStatusImages; ::std::unique_ptr< EditBrowseBoxImpl> m_aImpl; protected: - BrowserHeader* pHeader; + VclPtr<BrowserHeader> pHeader; bool isGetCellFocusPending() const { return nStartEvent != 0; } void cancelGetCellFocus() { if (nStartEvent) Application::RemoveUserEvent(nStartEvent); nStartEvent = 0; } diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx index 6b0dc15e61b3..614d654d8b4d 100644 --- a/include/svtools/fileview.hxx +++ b/include/svtools/fileview.hxx @@ -212,10 +212,12 @@ enum QueryDeleteResult_Impl class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public MessageDialog { private: - PushButton* m_pAllButton; + VclPtr<PushButton> m_pAllButton; public: QueryDeleteDlg_Impl(vcl::Window* pParent, const OUString& rName); + virtual ~QueryDeleteDlg_Impl(); + virtual void dispose() SAL_OVERRIDE; void EnableAllButton() { m_pAllButton->Enable(true); } }; diff --git a/include/svtools/generictoolboxcontroller.hxx b/include/svtools/generictoolboxcontroller.hxx index 15b542cc3458..d5bf7d7fc51d 100644 --- a/include/svtools/generictoolboxcontroller.hxx +++ b/include/svtools/generictoolboxcontroller.hxx @@ -50,8 +50,8 @@ class SVT_DLLPUBLIC GenericToolboxController : public svt::ToolboxController DECL_STATIC_LINK( GenericToolboxController, ExecuteHdl_Impl, ExecuteInfo* ); private: - ToolBox* m_pToolbox; - sal_uInt16 m_nID; + VclPtr<ToolBox> m_pToolbox; + sal_uInt16 m_nID; }; } diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx index f0445ff96405..73fc6eb8f539 100644 --- a/include/svtools/genericunodialog.hxx +++ b/include/svtools/genericunodialog.hxx @@ -38,6 +38,7 @@ #include <comphelper/propertycontainer.hxx> #include <comphelper/broadcasthelper.hxx> #include <tools/link.hxx> +#include <vcl/vclptr.hxx> class Dialog; namespace vcl { class Window; } @@ -73,7 +74,7 @@ namespace svt ::osl::Mutex m_aExecutionMutex; /// access safety for execute/cancel protected: - Dialog* m_pDialog; /// the dialog to execute + VclPtr<Dialog> m_pDialog; /// the dialog to execute bool m_bExecuting : 1; /// we're currently executing the dialog bool m_bCanceled : 1; /// endDialog was called while we were executing bool m_bTitleAmbiguous : 1; /// m_sTitle has not been set yet diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx index 6b87e5d7d5c2..c30062b4aa35 100644 --- a/include/svtools/prnsetup.hxx +++ b/include/svtools/prnsetup.hxx @@ -40,13 +40,13 @@ class QueueInfo; class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog { private: - ListBox* m_pLbName; - PushButton* m_pBtnProperties; - PushButton* m_pBtnOptions; - FixedText* m_pFiStatus; - FixedText* m_pFiType; - FixedText* m_pFiLocation; - FixedText* m_pFiComment; + VclPtr<ListBox> m_pLbName; + VclPtr<PushButton> m_pBtnProperties; + VclPtr<PushButton> m_pBtnOptions; + VclPtr<FixedText> m_pFiStatus; + VclPtr<FixedText> m_pFiType; + VclPtr<FixedText> m_pFiLocation; + VclPtr<FixedText> m_pFiComment; AutoTimer maStatusTimer; Printer* mpPrinter; Printer* mpTempPrinter; diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx index 7670b7f74cc7..1bcb1f773352 100644 --- a/include/svtools/simptabl.hxx +++ b/include/svtools/simptabl.hxx @@ -29,13 +29,15 @@ class SvSimpleTable; class SVT_DLLPUBLIC SvSimpleTableContainer : public Control { private: - SvSimpleTable* m_pTable; + VclPtr<SvSimpleTable> m_pTable; protected: virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; public: SvSimpleTableContainer( vcl::Window* pParent, WinBits nBits = WB_BORDER ); + virtual ~SvSimpleTableContainer(); + virtual void dispose() SAL_OVERRIDE; void SetTable(SvSimpleTable* pTable); diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx index be31ee6bafa0..d2c2783601f2 100644 --- a/include/svtools/tabbar.hxx +++ b/include/svtools/tabbar.hxx @@ -315,6 +315,8 @@ class SVT_DLLPUBLIC TabBar : public vcl::Window private: std::unique_ptr<TabBar_Impl> mpImpl; + ImplTabBarList* mpItemList; + OUString maEditText; Color maSelColor; Color maSelTextColor; diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index cbac8ed98e65..ed81c3700501 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -784,7 +784,7 @@ public: struct SvLBoxDDInfo { Application* pApp; - SvTreeListBox* pSource; + VclPtr<SvTreeListBox> pSource; SvTreeListEntry* pDDStartEntry; // Relative position in the Entry at DragBeginn (IconView) long nMouseRelX,nMouseRelY; @@ -797,7 +797,7 @@ class SvInplaceEdit2 Accelerator aAccReturn; Accelerator aAccEscape; Idle aIdle; - Edit* pEdit; + VclPtr<Edit> pEdit; bool bCanceled; bool bAlreadyInCallBack; diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx index 053acdce08a2..7a83cbdd40b5 100644 --- a/include/svtools/wizardmachine.hxx +++ b/include/svtools/wizardmachine.hxx @@ -155,15 +155,14 @@ namespace svt // So use the travelXXX methods if you need to travel protected: - OKButton* m_pFinish; - CancelButton* m_pCancel; - PushButton* m_pNextPage; - PushButton* m_pPrevPage; - HelpButton* m_pHelp; + VclPtr<OKButton> m_pFinish; + VclPtr<CancelButton> m_pCancel; + VclPtr<PushButton> m_pNextPage; + VclPtr<PushButton> m_pPrevPage; + VclPtr<HelpButton> m_pHelp; private: - WizardMachineImplData* - m_pImpl; + WizardMachineImplData* m_pImpl; // hold members in this structure to allow keeping compatible when members are added SVT_DLLPRIVATE void addButtons(vcl::Window* _pParent, sal_uInt32 _nButtonFlags); diff --git a/include/svtools/wizdlg.hxx b/include/svtools/wizdlg.hxx index 498aa9c437ed..9ae52d1b366c 100644 --- a/include/svtools/wizdlg.hxx +++ b/include/svtools/wizdlg.hxx @@ -202,10 +202,10 @@ private: Size maPageSize; ImplWizPageData* mpFirstPage; ImplWizButtonData* mpFirstBtn; - TabPage* mpCurTabPage; - PushButton* mpPrevBtn; - PushButton* mpNextBtn; - vcl::Window* mpViewWindow; + VclPtr<TabPage> mpCurTabPage; + VclPtr<PushButton> mpPrevBtn; + VclPtr<PushButton> mpNextBtn; + VclPtr<vcl::Window> mpViewWindow; sal_uInt16 mnCurLevel; WindowAlign meViewAlign; Link maActivateHdl; @@ -273,7 +273,7 @@ public: PushButton* GetNextButton() const { return mpNextBtn; } void SetViewWindow( vcl::Window* pWindow ) { mpViewWindow = pWindow; } - vcl::Window* GetViewWindow() const { return mpViewWindow; } + vcl::Window* GetViewWindow() const { return mpViewWindow; } void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; } WindowAlign GetViewAlign() const { return meViewAlign; } diff --git a/include/svx/AccessibleShapeTreeInfo.hxx b/include/svx/AccessibleShapeTreeInfo.hxx index ec316f2498bb..deacfd385c28 100644 --- a/include/svx/AccessibleShapeTreeInfo.hxx +++ b/include/svx/AccessibleShapeTreeInfo.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/frame/XController.hpp> #include <svx/IAccessibleViewForwarder.hxx> #include <svx/svxdllapi.h> +#include <vcl/vclptr.hxx> class SdrView; namespace vcl { class Window; } @@ -188,7 +189,7 @@ private: /** This window is necessary to construct an SvxTextEditSource which in turn is used to create an accessible edit engine. */ - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; /** The view forwarder allows the transformation between internal and pixel coordinates and can be asked for the visible area. diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx index 52e4f1574c4f..41f93b7456bb 100644 --- a/include/svx/bmpmask.hxx +++ b/include/svx/bmpmask.hxx @@ -81,33 +81,33 @@ class SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow friend class MaskData; friend class MaskSet; - ToolBox* m_pTbxPipette; - ColorWindow* m_pCtlPipette; - PushButton* m_pBtnExec; - - CheckBox* m_pCbx1; - MaskSet* m_pQSet1; - MetricField* m_pSp1; - ColorLB* m_pLbColor1; - - CheckBox* m_pCbx2; - MaskSet* m_pQSet2; - MetricField* m_pSp2; - ColorLB* m_pLbColor2; - - CheckBox* m_pCbx3; - MaskSet* m_pQSet3; - MetricField* m_pSp3; - ColorLB* m_pLbColor3; - - CheckBox* m_pCbx4; - MaskSet* m_pQSet4; - MetricField* m_pSp4; - ColorLB* m_pLbColor4; + VclPtr<ToolBox> m_pTbxPipette; + VclPtr<ColorWindow> m_pCtlPipette; + VclPtr<PushButton> m_pBtnExec; + + VclPtr<CheckBox> m_pCbx1; + VclPtr<MaskSet> m_pQSet1; + VclPtr<MetricField> m_pSp1; + VclPtr<ColorLB> m_pLbColor1; + + VclPtr<CheckBox> m_pCbx2; + VclPtr<MaskSet> m_pQSet2; + VclPtr<MetricField> m_pSp2; + VclPtr<ColorLB> m_pLbColor2; + + VclPtr<CheckBox> m_pCbx3; + VclPtr<MaskSet> m_pQSet3; + VclPtr<MetricField> m_pSp3; + VclPtr<ColorLB> m_pLbColor3; + + VclPtr<CheckBox> m_pCbx4; + VclPtr<MaskSet> m_pQSet4; + VclPtr<MetricField> m_pSp4; + VclPtr<ColorLB> m_pLbColor4; MaskData* pData; - CheckBox* m_pCbxTrans; - ColorLB* m_pLbColorTrans; + VclPtr<CheckBox> m_pCbxTrans; + VclPtr<ColorLB> m_pLbColorTrans; XColorListRef pColLst; Color aPipetteColor; diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx index 83e1f6607a37..7cbf1b2db7ff 100644 --- a/include/svx/compressgraphicdialog.hxx +++ b/include/svx/compressgraphicdialog.hxx @@ -33,22 +33,22 @@ class SdrGrafObj; class SVX_DLLPUBLIC CompressGraphicsDialog : public ModalDialog { private: - FixedText* m_pLabelGraphicType; - FixedText* m_pFixedText2; - FixedText* m_pFixedText3; - FixedText* m_pFixedText5; - FixedText* m_pFixedText6; - - CheckBox* m_pReduceResolutionCB; - NumericField* m_pMFNewWidth; - NumericField* m_pMFNewHeight; - ComboBox* m_pResolutionLB; - RadioButton* m_pLosslessRB; - RadioButton* m_pJpegCompRB; - NumericField* m_pCompressionMF; - NumericField* m_pQualityMF; - PushButton* m_pBtnCalculate; - ListBox* m_pInterpolationCombo; + VclPtr<FixedText> m_pLabelGraphicType; + VclPtr<FixedText> m_pFixedText2; + VclPtr<FixedText> m_pFixedText3; + VclPtr<FixedText> m_pFixedText5; + VclPtr<FixedText> m_pFixedText6; + + VclPtr<CheckBox> m_pReduceResolutionCB; + VclPtr<NumericField> m_pMFNewWidth; + VclPtr<NumericField> m_pMFNewHeight; + VclPtr<ComboBox> m_pResolutionLB; + VclPtr<RadioButton> m_pLosslessRB; + VclPtr<RadioButton> m_pJpegCompRB; + VclPtr<NumericField> m_pCompressionMF; + VclPtr<NumericField> m_pQualityMF; + VclPtr<PushButton> m_pBtnCalculate; + VclPtr<ListBox> m_pInterpolationCombo; SdrGrafObj* m_pGraphicObj; Graphic m_aGraphic; @@ -83,6 +83,8 @@ private: public: CompressGraphicsDialog( vcl::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings ); CompressGraphicsDialog( vcl::Window* pParent, Graphic& rGraphic, Size rViewSize100mm, Rectangle& rCropRectangle, SfxBindings& rBindings ); + virtual ~CompressGraphicsDialog(); + virtual void dispose() SAL_OVERRIDE; SdrGrafObj* GetCompressedSdrGrafObj(); Graphic GetCompressedGraphic(); diff --git a/include/svx/contdlg.hxx b/include/svx/contdlg.hxx index 064d0038d468..a6725de153f2 100644 --- a/include/svx/contdlg.hxx +++ b/include/svx/contdlg.hxx @@ -64,17 +64,19 @@ class SVX_DLLPUBLIC SvxContourDlg : public SfxFloatingWindow { using Window::Update; - SvxSuperContourDlg* pSuperClass; + VclPtr<SvxSuperContourDlg> pSuperClass; protected: - void SetSuperClass( SvxSuperContourDlg& rSuperClass ) { pSuperClass = &rSuperClass; } + void SetSuperClass( SvxSuperContourDlg& rSuperClass ); public: SvxContourDlg(SfxBindings *pBindings, SfxChildWindow *pCW, vcl::Window* pParent); + virtual ~SvxContourDlg(); + virtual void dispose() SAL_OVERRIDE; const Graphic& GetGraphic() const; bool IsGraphicChanged() const; diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index f5519bdfe462..3639245fddd0 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -180,25 +180,25 @@ private: Link aRefLink; Link aModifyComLink; - SvxRedlinTable* pRedlinTable; - CheckBox* m_pCbDate; - ListBox* m_pLbDate; - DateField* m_pDfDate; - TimeField* m_pTfDate; - PushButton* m_pIbClock; - FixedText* m_pFtDate2; - DateField* m_pDfDate2; - TimeField* m_pTfDate2; - PushButton* m_pIbClock2; - CheckBox* m_pCbAuthor; - ListBox* m_pLbAuthor; - CheckBox* m_pCbRange; - Edit* m_pEdRange; - PushButton* m_pBtnRange; - CheckBox* m_pCbAction; - ListBox* m_pLbAction; - CheckBox* m_pCbComment; - Edit* m_pEdComment; + VclPtr<SvxRedlinTable> pRedlinTable; + VclPtr<CheckBox> m_pCbDate; + VclPtr<ListBox> m_pLbDate; + VclPtr<DateField> m_pDfDate; + VclPtr<TimeField> m_pTfDate; + VclPtr<PushButton> m_pIbClock; + VclPtr<FixedText> m_pFtDate2; + VclPtr<DateField> m_pDfDate2; + VclPtr<TimeField> m_pTfDate2; + VclPtr<PushButton> m_pIbClock2; + VclPtr<CheckBox> m_pCbAuthor; + VclPtr<ListBox> m_pLbAuthor; + VclPtr<CheckBox> m_pCbRange; + VclPtr<Edit> m_pEdRange; + VclPtr<PushButton> m_pBtnRange; + VclPtr<CheckBox> m_pCbAction; + VclPtr<ListBox> m_pLbAction; + VclPtr<CheckBox> m_pCbComment; + VclPtr<Edit> m_pEdComment; bool bModified; DECL_LINK( SelDateHdl, ListBox* ); @@ -216,6 +216,8 @@ protected: public: SvxTPFilter( vcl::Window * pParent); + virtual ~SvxTPFilter(); + virtual void dispose() SAL_OVERRIDE; virtual void DeactivatePage() SAL_OVERRIDE; void SetRedlinTable(SvxRedlinTable*); @@ -305,12 +307,12 @@ private: Link RejectAllClickLk; Link UndoClickLk; - SvxRedlinTable* m_pViewData; - PushButton* m_pAccept; - PushButton* m_pReject; - PushButton* m_pAcceptAll; - PushButton* m_pRejectAll; - PushButton* m_pUndo; + VclPtr<SvxRedlinTable> m_pViewData; + VclPtr<PushButton> m_pAccept; + VclPtr<PushButton> m_pReject; + VclPtr<PushButton> m_pAcceptAll; + VclPtr<PushButton> m_pRejectAll; + VclPtr<PushButton> m_pUndo; bool bEnableAccept; bool bEnableAcceptAll; @@ -374,8 +376,8 @@ class SVX_DLLPUBLIC SvxAcceptChgCtr { private: - SvxTPFilter* pTPFilter; - SvxTPView* pTPView; + VclPtr<SvxTPFilter> pTPFilter; + VclPtr<SvxTPView> pTPView; sal_uInt16 m_nViewPageId; sal_uInt16 m_nFilterPageId; diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx index a2bc07462921..58ae42a3b8d7 100644 --- a/include/svx/dialcontrol.hxx +++ b/include/svx/dialcontrol.hxx @@ -128,7 +128,7 @@ protected: std::unique_ptr<DialControlBmp> mxBmpDisabled; std::unique_ptr<DialControlBmp> mxBmpBuffered; Link maModifyHdl; - NumericField* mpLinkField; + VclPtr<NumericField> mpLinkField; sal_Int32 mnLinkedFieldValueMultiplyer; Size maWinSize; vcl::Font maWinFont; diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx index 1c164cd30575..fd7e5a0985d6 100644 --- a/include/svx/fillctrl.hxx +++ b/include/svx/fillctrl.hxx @@ -50,9 +50,9 @@ private: XFillHatchItem* mpHatchItem; XFillBitmapItem* mpBitmapItem; - FillControl* mpFillControl; - SvxFillTypeBox* mpFillTypeLB; - SvxFillAttrBox* mpFillAttrLB; + VclPtr<FillControl> mpFillControl; + VclPtr<SvxFillTypeBox> mpFillTypeLB; + VclPtr<SvxFillAttrBox> mpFillAttrLB; css::drawing::FillStyle meLastXFS; @@ -77,8 +77,8 @@ class FillControl : public vcl::Window private: friend class SvxFillToolBoxControl; - SvxFillTypeBox* mpLbFillType; - SvxFillAttrBox* mpLbFillAttr; + VclPtr<SvxFillTypeBox> mpLbFillType; + VclPtr<SvxFillAttrBox> mpLbFillAttr; Size maLogicalFillSize; Size maLogicalAttrSize; diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx index 5c568ded8ed5..b229cb4e1c42 100644 --- a/include/svx/fmshell.hxx +++ b/include/svx/fmshell.hxx @@ -89,7 +89,7 @@ class SVX_DLLPUBLIC FmFormShell : public SfxShell class FormShellWaitObject { - vcl::Window* m_pWindow; + VclPtr<vcl::Window> m_pWindow; public: FormShellWaitObject(const FmFormShell* _pShell); ~FormShellWaitObject(); diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx index c2521a7a81f4..6f24ccb4b272 100644 --- a/include/svx/fontworkgallery.hxx +++ b/include/svx/fontworkgallery.hxx @@ -64,10 +64,12 @@ public: class FontworkCharacterSpacingDialog : public ModalDialog { - MetricField* m_pMtrScale; + VclPtr<MetricField> m_pMtrScale; public: FontworkCharacterSpacingDialog( vcl::Window* pParent, sal_Int32 nScale ); + virtual ~FontworkCharacterSpacingDialog(); + virtual void dispose() SAL_OVERRIDE; sal_Int32 getScale() const; }; @@ -75,8 +77,8 @@ public: class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog { - ValueSet* mpCtlFavorites; - OKButton* mpOKButton; + VclPtr<ValueSet> mpCtlFavorites; + VclPtr<OKButton> mpOKButton; sal_uInt16 mnThemeId; @@ -98,6 +100,8 @@ class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog public: FontWorkGalleryDialog( SdrView* pView, vcl::Window* pParent, sal_uInt16 nSID ); + virtual ~FontWorkGalleryDialog(); + virtual void dispose() SAL_OVERRIDE; // SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog void SetSdrObjectRef( SdrObject**, SdrModel* pModel ); diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx index 719c5aa73033..53a7625507cd 100644 --- a/include/svx/hdft.hxx +++ b/include/svx/hdft.hxx @@ -70,22 +70,22 @@ protected: SvxHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSetId ); - FixedText* m_pPageLbl; - CheckBox* m_pTurnOnBox; - CheckBox* m_pCntSharedBox; - CheckBox* m_pCntSharedFirstBox; - FixedText* m_pLMLbl; - MetricField* m_pLMEdit; - FixedText* m_pRMLbl; - MetricField* m_pRMEdit; - FixedText* m_pDistFT; - MetricField* m_pDistEdit; - CheckBox* m_pDynSpacingCB; - FixedText* m_pHeightFT; - MetricField* m_pHeightEdit; - CheckBox* m_pHeightDynBtn; - SvxPageWindow* m_pBspWin; - PushButton* m_pBackgroundBtn; + VclPtr<FixedText> m_pPageLbl; + VclPtr<CheckBox> m_pTurnOnBox; + VclPtr<CheckBox> m_pCntSharedBox; + VclPtr<CheckBox> m_pCntSharedFirstBox; + VclPtr<FixedText> m_pLMLbl; + VclPtr<MetricField> m_pLMEdit; + VclPtr<FixedText> m_pRMLbl; + VclPtr<MetricField> m_pRMEdit; + VclPtr<FixedText> m_pDistFT; + VclPtr<MetricField> m_pDistEdit; + VclPtr<CheckBox> m_pDynSpacingCB; + VclPtr<FixedText> m_pHeightFT; + VclPtr<MetricField> m_pHeightEdit; + VclPtr<CheckBox> m_pHeightDynBtn; + VclPtr<SvxPageWindow> m_pBspWin; + VclPtr<PushButton> m_pBackgroundBtn; sal_uInt16 nId; SfxItemSet* pBBSet; diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx index d21dc4230a90..fc0b758d3c37 100644 --- a/include/svx/imapdlg.hxx +++ b/include/svx/imapdlg.hxx @@ -82,14 +82,14 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow friend class IMapOwnData; friend class IMapWindow; - ToolBox *m_pTbxIMapDlg1; - FixedText *m_pFtURL; - SvtURLBox *m_pURLBox; - FixedText *m_pFtText; - Edit *m_pEdtText; - FixedText *m_pFtTarget; - ComboBox *m_pCbbTarget; - StatusBar *m_pStbStatus; + VclPtr<ToolBox> m_pTbxIMapDlg1; + VclPtr<FixedText> m_pFtURL; + VclPtr<SvtURLBox> m_pURLBox; + VclPtr<FixedText> m_pFtText; + VclPtr<Edit> m_pEdtText; + VclPtr<FixedText> m_pFtTarget; + VclPtr<ComboBox> m_pCbbTarget; + VclPtr<StatusBar> m_pStbStatus; sal_uInt16 mnApplyId; sal_uInt16 mnOpenId; @@ -110,7 +110,7 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow sal_uInt16 mnPropertyId; Size aLastSize; - IMapWindow* pIMapWnd; + VclPtr<IMapWindow> pIMapWnd; IMapOwnData* pOwnData; void* pCheckObj; SvxIMapDlgItem aIMapItem; diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx index 30a21b37f71a..3fed04437320 100644 --- a/include/svx/lboxctrl.hxx +++ b/include/svx/lboxctrl.hxx @@ -34,7 +34,7 @@ class SvxListBoxControl : public SfxToolBoxControl { protected: OUString aActionStr; - SvxPopupWindowListBox * pPopupWin; + VclPtr<SvxPopupWindowListBox> pPopupWin; void Impl_SetInfo( sal_uInt16 nCount ); diff --git a/include/svx/linkwarn.hxx b/include/svx/linkwarn.hxx index 395b1b6f6367..b832637fc8b9 100644 --- a/include/svx/linkwarn.hxx +++ b/include/svx/linkwarn.hxx @@ -27,7 +27,7 @@ class SVX_DLLPUBLIC SvxLinkWarningDialog : public MessageDialog { private: - CheckBox* m_pWarningOnBox; + VclPtr<CheckBox> m_pWarningOnBox; public: SvxLinkWarningDialog(vcl::Window* pParent, const OUString& _rFileName); diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx index 1d6e62b6c0f5..29e7b6224ac7 100644 --- a/include/svx/optgrid.hxx +++ b/include/svx/optgrid.hxx @@ -101,6 +101,8 @@ class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage public: SvxGridTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + virtual ~SvxGridTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet& rAttrSet ); @@ -111,30 +113,30 @@ public: virtual int DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE; private: - CheckBox* pCbxUseGridsnap; - CheckBox* pCbxGridVisible; + VclPtr<CheckBox> pCbxUseGridsnap; + VclPtr<CheckBox> pCbxGridVisible; - MetricField* pMtrFldDrawX; - MetricField* pMtrFldDrawY; + VclPtr<MetricField> pMtrFldDrawX; + VclPtr<MetricField> pMtrFldDrawY; - NumericField* pNumFldDivisionX; - NumericField* pNumFldDivisionY; + VclPtr<NumericField> pNumFldDivisionX; + VclPtr<NumericField> pNumFldDivisionY; - CheckBox* pCbxSynchronize; + VclPtr<CheckBox> pCbxSynchronize; protected: //these controls are used in draw and impress - VclContainer* pSnapFrames; - CheckBox* pCbxSnapHelplines; - CheckBox* pCbxSnapBorder; - CheckBox* pCbxSnapFrame; - CheckBox* pCbxSnapPoints; - MetricField* pMtrFldSnapArea; - - CheckBox* pCbxOrtho; - CheckBox* pCbxBigOrtho; - CheckBox* pCbxRotate; - MetricField* pMtrFldAngle; - MetricField* pMtrFldBezAngle; + VclPtr<VclContainer> pSnapFrames; + VclPtr<CheckBox> pCbxSnapHelplines; + VclPtr<CheckBox> pCbxSnapBorder; + VclPtr<CheckBox> pCbxSnapFrame; + VclPtr<CheckBox> pCbxSnapPoints; + VclPtr<MetricField> pMtrFldSnapArea; + + VclPtr<CheckBox> pCbxOrtho; + VclPtr<CheckBox> pCbxBigOrtho; + VclPtr<CheckBox> pCbxRotate; + VclPtr<MetricField> pMtrFldAngle; + VclPtr<MetricField> pMtrFldBezAngle; private: bool bAttrModified; diff --git a/include/svx/passwd.hxx b/include/svx/passwd.hxx index 901488c0fc26..89fbbded5221 100644 --- a/include/svx/passwd.hxx +++ b/include/svx/passwd.hxx @@ -33,12 +33,12 @@ class SVX_DLLPUBLIC SvxPasswordDialog : public SfxModalDialog { private: - FixedText* m_pOldFL; - FixedText* m_pOldPasswdFT; - Edit* m_pOldPasswdED; - Edit* m_pNewPasswdED; - Edit* m_pRepeatPasswdED; - OKButton* m_pOKBtn; + VclPtr<FixedText> m_pOldFL; + VclPtr<FixedText> m_pOldPasswdFT; + VclPtr<Edit> m_pOldPasswdED; + VclPtr<Edit> m_pNewPasswdED; + VclPtr<Edit> m_pRepeatPasswdED; + VclPtr<OKButton> m_pOKBtn; OUString aOldPasswdErrStr; OUString aRepeatPasswdErrStr; @@ -52,6 +52,8 @@ private: public: SvxPasswordDialog( vcl::Window* pParent, bool bAllowEmptyPasswords = false, bool bDisableOldPassword = false ); + virtual ~SvxPasswordDialog(); + virtual void dispose() SAL_OVERRIDE; OUString GetOldPassword() const { return m_pOldPasswdED->GetText(); } OUString GetNewPassword() const { return m_pNewPasswdED->GetText(); } diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx index 793fa887c96d..5441c212519f 100644 --- a/include/svx/rubydialog.hxx +++ b/include/svx/rubydialog.hxx @@ -44,10 +44,12 @@ class RubyPreview : public vcl::Window { protected: virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE; - SvxRubyDialog* m_pParentDlg; + VclPtr<SvxRubyDialog> m_pParentDlg; public: RubyPreview(vcl::Window *pParent); + virtual ~RubyPreview(); + virtual void dispose() SAL_OVERRIDE; void setRubyDialog(SvxRubyDialog* pParentDlg) { m_pParentDlg = pParentDlg; @@ -89,33 +91,33 @@ class SvxRubyDialog : public SfxModelessDialog { friend class RubyPreview; - FixedText* m_pLeftFT; - FixedText* m_pRightFT; - RubyEdit* m_pLeft1ED; - RubyEdit* m_pRight1ED; - RubyEdit* m_pLeft2ED; - RubyEdit* m_pRight2ED; - RubyEdit* m_pLeft3ED; - RubyEdit* m_pRight3ED; - RubyEdit* m_pLeft4ED; - RubyEdit* m_pRight4ED; + VclPtr<FixedText> m_pLeftFT; + VclPtr<FixedText> m_pRightFT; + VclPtr<RubyEdit> m_pLeft1ED; + VclPtr<RubyEdit> m_pRight1ED; + VclPtr<RubyEdit> m_pLeft2ED; + VclPtr<RubyEdit> m_pRight2ED; + VclPtr<RubyEdit> m_pLeft3ED; + VclPtr<RubyEdit> m_pRight3ED; + VclPtr<RubyEdit> m_pLeft4ED; + VclPtr<RubyEdit> m_pRight4ED; - RubyEdit* aEditArr[8]; - VclScrolledWindow* m_pScrolledWindow; - ScrollBar* m_pScrollSB; + VclPtr<RubyEdit> aEditArr[8]; + VclPtr<VclScrolledWindow> m_pScrolledWindow; + VclPtr<ScrollBar> m_pScrollSB; - ListBox* m_pAdjustLB; + VclPtr<ListBox> m_pAdjustLB; - ListBox* m_pPositionLB; + VclPtr<ListBox> m_pPositionLB; - FixedText* m_pCharStyleFT; - ListBox* m_pCharStyleLB; - PushButton* m_pStylistPB; + VclPtr<FixedText> m_pCharStyleFT; + VclPtr<ListBox> m_pCharStyleLB; + VclPtr<PushButton> m_pStylistPB; - RubyPreview* m_pPreviewWin; + VclPtr<RubyPreview> m_pPreviewWin; - PushButton* m_pApplyPB; - PushButton* m_pClosePB; + VclPtr<PushButton> m_pApplyPB; + VclPtr<PushButton> m_pClosePB; long nLastPos; long nCurrentEdit; diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx index 9a1195d95875..4c598782d622 100644 --- a/include/svx/ruler.hxx +++ b/include/svx/ruler.hxx @@ -57,7 +57,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener std::unique_ptr<SvxColumnItem> mxColumnItem; // columns std::unique_ptr<SvxObjectItem> mxObjectItem; // object - vcl::Window* pEditWin; + VclPtr<vcl::Window> pEditWin; std::unique_ptr<SvxRuler_Impl> mxRulerImpl; diff --git a/include/svx/sidebar/Popup.hxx b/include/svx/sidebar/Popup.hxx index e11e8c1ee6b0..063e8e6f1e84 100644 --- a/include/svx/sidebar/Popup.hxx +++ b/include/svx/sidebar/Popup.hxx @@ -22,6 +22,7 @@ #include <svx/svxdllapi.h> #include <rtl/ustring.hxx> #include <tools/link.hxx> +#include <vcl/vclptr.hxx> #include <boost/function.hpp> @@ -89,7 +90,7 @@ protected: void CreateContainerAndControl (void); private: - vcl::Window* mpParent; + VclPtr<vcl::Window> mpParent; ::boost::function<PopupControl*(PopupContainer*)> maControlCreator; ::boost::function<void(void)> maPopupModeEndCallback; const ::rtl::OUString msAccessibleName; diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 35e259b5988a..af4d54217e5c 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -89,7 +89,7 @@ enum SearchLabel class SvxSearchDialog; class SVX_DLLPUBLIC SvxSearchDialogWrapper : public SfxChildWindow { - SvxSearchDialog *dialog; + VclPtr<SvxSearchDialog> dialog; public: SvxSearchDialogWrapper( vcl::Window*pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo ); @@ -151,57 +151,57 @@ public: void SetSearchLabel(const OUString& rStr) { m_pSearchLabel->SetText(rStr); } private: - vcl::Window* mpDocWin; + VclPtr<vcl::Window> mpDocWin; bool mbSuccess; - VclFrame* m_pSearchFrame; - ComboBox* m_pSearchLB; - ListBox* m_pSearchTmplLB; - FixedText* m_pSearchAttrText; - FixedText* m_pSearchLabel; - - VclFrame* m_pReplaceFrame; - ComboBox* m_pReplaceLB; - ListBox* m_pReplaceTmplLB; - FixedText* m_pReplaceAttrText; - - PushButton* m_pSearchBtn; - PushButton* m_pSearchAllBtn; - PushButton* m_pReplaceBtn; - PushButton* m_pReplaceAllBtn; - - VclFrame* m_pComponentFrame; - PushButton* m_pSearchComponent1PB; - PushButton* m_pSearchComponent2PB; - - CheckBox* m_pMatchCaseCB; - CheckBox* m_pWordBtn; - - PushButton* m_pCloseBtn; - CheckBox* m_pIgnoreDiacritics; - CheckBox* m_pIgnoreKashida; - CheckBox* m_pSelectionBtn; - CheckBox* m_pBackwardsBtn; - CheckBox* m_pRegExpBtn; - CheckBox* m_pSimilarityBox; - PushButton* m_pSimilarityBtn; - CheckBox* m_pLayoutBtn; - CheckBox* m_pNotesBtn; - CheckBox* m_pJapMatchFullHalfWidthCB; - CheckBox* m_pJapOptionsCB; - PushButton* m_pJapOptionsBtn; - - PushButton* m_pAttributeBtn; - PushButton* m_pFormatBtn; - PushButton* m_pNoFormatBtn; - - VclContainer* m_pCalcGrid; - FixedText* m_pCalcSearchInFT; - ListBox* m_pCalcSearchInLB; - FixedText* m_pCalcSearchDirFT; - RadioButton* m_pRowsBtn; - RadioButton* m_pColumnsBtn; - CheckBox* m_pAllSheetsCB; + VclPtr<VclFrame> m_pSearchFrame; + VclPtr<ComboBox> m_pSearchLB; + VclPtr<ListBox> m_pSearchTmplLB; + VclPtr<FixedText> m_pSearchAttrText; + VclPtr<FixedText> m_pSearchLabel; + + VclPtr<VclFrame> m_pReplaceFrame; + VclPtr<ComboBox> m_pReplaceLB; + VclPtr<ListBox> m_pReplaceTmplLB; + VclPtr<FixedText> m_pReplaceAttrText; + + VclPtr<PushButton> m_pSearchBtn; + VclPtr<PushButton> m_pSearchAllBtn; + VclPtr<PushButton> m_pReplaceBtn; + VclPtr<PushButton> m_pReplaceAllBtn; + + VclPtr<VclFrame> m_pComponentFrame; + VclPtr<PushButton> m_pSearchComponent1PB; + VclPtr<PushButton> m_pSearchComponent2PB; + + VclPtr<CheckBox> m_pMatchCaseCB; + VclPtr<CheckBox> m_pWordBtn; + + VclPtr<PushButton> m_pCloseBtn; + VclPtr<CheckBox> m_pIgnoreDiacritics; + VclPtr<CheckBox> m_pIgnoreKashida; + VclPtr<CheckBox> m_pSelectionBtn; + VclPtr<CheckBox> m_pBackwardsBtn; + VclPtr<CheckBox> m_pRegExpBtn; + VclPtr<CheckBox> m_pSimilarityBox; + VclPtr<PushButton> m_pSimilarityBtn; + VclPtr<CheckBox> m_pLayoutBtn; + VclPtr<CheckBox> m_pNotesBtn; + VclPtr<CheckBox> m_pJapMatchFullHalfWidthCB; + VclPtr<CheckBox> m_pJapOptionsCB; + VclPtr<PushButton> m_pJapOptionsBtn; + + VclPtr<PushButton> m_pAttributeBtn; + VclPtr<PushButton> m_pFormatBtn; + VclPtr<PushButton> m_pNoFormatBtn; + + VclPtr<VclContainer> m_pCalcGrid; + VclPtr<FixedText> m_pCalcSearchInFT; + VclPtr<ListBox> m_pCalcSearchInLB; + VclPtr<FixedText> m_pCalcSearchDirFT; + VclPtr<RadioButton> m_pRowsBtn; + VclPtr<RadioButton> m_pColumnsBtn; + VclPtr<CheckBox> m_pAllSheetsCB; SfxBindings& rBindings; bool bWriter; diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index fb30ff7a428e..4cd05fae0d53 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -66,12 +66,12 @@ protected: SdrPageView* pTextEditPV; SdrOutliner* pTextEditOutliner; // outliner for the TextEdit OutlinerView* pTextEditOutlinerView; // current view of the outliners - vcl::Window* pTextEditWin; // matching window to pTextEditOutlinerView + VclPtr<vcl::Window> pTextEditWin; // matching window to pTextEditOutlinerView vcl::Cursor* pTextEditCursorMerker; // to restore the cursor in each window ImpSdrEditPara* pEditPara; // trashbin for everything else to stay compatible SdrObject* pMacroObj; SdrPageView* pMacroPV; - vcl::Window* pMacroWin; + VclPtr<vcl::Window> pMacroWin; Rectangle aTextEditArea; Rectangle aMinTextEditArea; diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 2bde92fcb243..0959f1c239ab 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -133,7 +133,7 @@ class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, p protected: SdrModel* pMod; #ifdef DBG_UTIL - SdrItemBrowser* pItemBrowser; + VclPtr<SdrItemBrowser> pItemBrowser; #endif const OutputDevice* pActualOutDev; // Nur zum vergleichen OutputDevice* pDragWin; @@ -516,7 +516,7 @@ public: // bei bShow=sal_False wird der Browser destruiert #ifdef DBG_UTIL void ShowItemBrowser(bool bShow=true); - bool IsItemBrowserVisible() const { return pItemBrowser!=NULL && GetItemBrowser()->IsVisible(); } + bool IsItemBrowserVisible() const { return pItemBrowser!=nullptr && GetItemBrowser()->IsVisible(); } vcl::Window* GetItemBrowser() const; #endif diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx index 343d0fe768f5..9f00d1386a64 100644 --- a/include/svx/tbxcolorupdate.hxx +++ b/include/svx/tbxcolorupdate.hxx @@ -24,6 +24,7 @@ #include <tools/gen.hxx> #include <tools/color.hxx> +#include <vcl/vclptr.hxx> class ToolBox; class VirtualDevice; @@ -44,8 +45,8 @@ namespace svx { public: ToolboxButtonColorUpdater( sal_uInt16 nSlotId, - sal_uInt16 nTbxBtnId, - ToolBox* ptrTbx); + sal_uInt16 nTbxBtnId, + ToolBox* ptrTbx); ~ToolboxButtonColorUpdater(); void Update( const Color& rColor ); @@ -53,7 +54,7 @@ namespace svx private: sal_uInt16 mnBtnId; sal_uInt16 mnSlotId; - ToolBox* mpTbx; + VclPtr<ToolBox> mpTbx; Color maCurColor; Rectangle maUpdRect; Size maBmpSize; diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx index a16b56a179f4..ae6e14015e9c 100644 --- a/include/tools/errinf.hxx +++ b/include/tools/errinf.hxx @@ -27,6 +27,7 @@ #include <tools/rtti.hxx> #include <tools/errcode.hxx> #include <tools/toolsdllapi.h> +#include <vcl/vclptr.hxx> class EDcr_Impl; class ErrHdl_Impl; @@ -121,14 +122,14 @@ class TOOLS_DLLPUBLIC ErrorContext private: ErrorContext* pNext; - vcl::Window* pWin; + VclPtr<vcl::Window> pWin; public: ErrorContext(vcl::Window *pWin=0); virtual ~ErrorContext(); virtual bool GetString( sal_uIntPtr nErrId, OUString& rCtxStr ) = 0; - vcl::Window* GetParent() { return pWin; } + vcl::Window* GetParent() { return pWin; } static ErrorContext* GetContext(); }; diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index aba3f0889e60..cdf2a9dd9a21 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -60,7 +60,7 @@ public: void disposeBuilder(); //sID must exist and be of type T - template <typename T> T* get(T*& ret, const OString& sID); + template <typename T> T* get(VclPtr<T>& ret, const OString& sID); //sID may not exist, but must be of type T if it does template <typename T /*= vcl::Window if we had c++11*/> T* get(const OString& sID); @@ -266,7 +266,7 @@ private: } }; - typedef std::map< vcl::Window*, stringmap> AtkMap; + typedef std::map< VclPtr<vcl::Window>, stringmap> AtkMap; struct ParserState { @@ -293,7 +293,7 @@ private: Translations m_aTranslations; - std::map< vcl::Window*, vcl::Window*> m_aRedundantParentWidgets; + std::map< VclPtr<vcl::Window>, VclPtr<vcl::Window> > m_aRedundantParentWidgets; std::vector<SizeGroup> m_aSizeGroups; @@ -301,13 +301,11 @@ private: std::vector<MnemonicWidgetMap> m_aMnemonicWidgetMaps; - std::vector<VclExpander*> m_aExpanderWidgets; + std::vector< VclPtr<VclExpander> > m_aExpanderWidgets; sal_uInt16 m_nLastToolbarId; - ParserState() - : m_nLastToolbarId(0) - {} + ParserState(); }; void loadTranslations(const LanguageTag &rLanguageTag, const OUString &rUri); @@ -316,7 +314,7 @@ private: OString m_sID; OString m_sHelpRoot; ResHookProc m_pStringReplace; - vcl::Window *m_pParent; + VclPtr<vcl::Window> m_pParent; bool m_bToplevelHasDeferredInit; bool m_bToplevelHasDeferredProperties; bool m_bToplevelParentFound; @@ -408,7 +406,7 @@ private: }; template <typename T> -inline T* VclBuilder::get(T*& ret, const OString& sID) +inline T* VclBuilder::get(VclPtr<T>& ret, const OString& sID) { vcl::Window *w = get_by_name(sID); SAL_WARN_IF(!w, "vcl.layout", "widget \"" << sID.getStr() << "\" not found in .ui"); @@ -417,7 +415,7 @@ inline T* VclBuilder::get(T*& ret, const OString& sID) assert(w); assert(dynamic_cast<T*>(w)); ret = static_cast<T*>(w); - return ret; + return ret.get(); } //sID may not exist, but must be of type T if it does @@ -466,7 +464,7 @@ public: css::uno::Reference<css::frame::XFrame> getFrame() { return m_pUIBuilder->getFrame(); } - template <typename T> T* get(T*& ret, const OString& sID) + template <typename T> T* get(VclPtr<T>& ret, const OString& sID) { return m_pUIBuilder->get<T>(ret, sID); } diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 124b314f8f4a..de7fbeea9bd7 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -274,7 +274,7 @@ public: class VCL_DLLPUBLIC RadioButton : public Button { private: - std::shared_ptr< std::vector<RadioButton*> > m_xGroup; + std::shared_ptr< std::vector< VclPtr< RadioButton > > > m_xGroup; Rectangle maStateRect; Rectangle maMouseRect; Image maImage; @@ -389,7 +389,7 @@ public: on return contains the <code>RadioButton</code>s in the same group as this <code>RadioButton</code>. */ - std::vector<RadioButton*> GetRadioButtonGroup(bool bIncludeThis = true) const; + std::vector<VclPtr<RadioButton> > GetRadioButtonGroup(bool bIncludeThis = true) const; virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx index d36db77d8c9c..678dbc5db491 100644 --- a/include/vcl/combobox.hxx +++ b/include/vcl/combobox.hxx @@ -36,9 +36,9 @@ class VCL_DLLPUBLIC ComboBox : public Edit { private: VclPtr<Edit> mpSubEdit; - ImplListBox* mpImplLB; - ImplBtn* mpBtn; - ImplListBoxFloatingWindow* mpFloatWin; + VclPtr<ImplListBox> mpImplLB; + VclPtr<ImplBtn> mpBtn; + VclPtr<ImplListBoxFloatingWindow> mpFloatWin; sal_uInt16 mnDDHeight; sal_Unicode mcMultiSep; bool mbDDAutoSize : 1; diff --git a/include/vcl/controllayout.hxx b/include/vcl/controllayout.hxx index 0856a69946b5..f9167244e0a1 100644 --- a/include/vcl/controllayout.hxx +++ b/include/vcl/controllayout.hxx @@ -42,9 +42,9 @@ struct VCL_DLLPUBLIC ControlLayoutData // start indices of lines std::vector< long > m_aLineIndices; // notify parent control on destruction - const Control* m_pParent; + VclPtr<const Control> m_pParent; - ControlLayoutData() : m_pParent( NULL ) {} + ControlLayoutData(); ~ControlLayoutData(); Rectangle GetCharacterBounds( long nIndex ) const; diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx index 2d3b83c0b119..eecbd0c0ca8a 100644 --- a/include/vcl/cursor.hxx +++ b/include/vcl/cursor.hxx @@ -23,6 +23,7 @@ #include <tools/gen.hxx> #include <tools/link.hxx> #include <vcl/dllapi.h> +#include <vcl/vclptr.hxx> struct ImplCursorData; namespace vcl { class Window; } @@ -40,7 +41,7 @@ class VCL_DLLPUBLIC Cursor { private: ImplCursorData* mpData; - vcl::Window* mpWindow; // only for shadow cursor + VclPtr<vcl::Window> mpWindow; // only for shadow cursor long mnSlant; Size maSize; Point maPos; diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index e5a895fdba6e..652a06965e27 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -40,7 +40,7 @@ class VclButtonBox; class VCL_DLLPUBLIC Dialog : public SystemWindow { private: - Dialog* mpPrevExecuteDlg; + VclPtr<Dialog> mpPrevExecuteDlg; DialogImpl* mpDialogImpl; long mnMousePositioned; bool mbInExecute; diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index 685dcd4624e7..71c81818fa22 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -80,12 +80,12 @@ class ImplDockingWindowWrapper private: // the original 'Docking'window - vcl::Window *mpDockingWindow; + VclPtr<vcl::Window> mpDockingWindow; // the original DockingWindow members - FloatingWindow* mpFloatWin; - vcl::Window* mpOldBorderWin; - vcl::Window* mpParent; + VclPtr<FloatingWindow> mpFloatWin; + VclPtr<vcl::Window> mpOldBorderWin; + VclPtr<vcl::Window> mpParent; Point maFloatPos; Point maDockPos; Point maMouseOff; @@ -225,8 +225,8 @@ class VCL_DLLPUBLIC DockingWindow { class ImplData; private: - FloatingWindow* mpFloatWin; - vcl::Window* mpOldBorderWin; + VclPtr<FloatingWindow> mpFloatWin; + VclPtr<vcl::Window> mpOldBorderWin; ImplData* mpImplData; Point maFloatPos; Point maDockPos; @@ -261,7 +261,7 @@ private: mbIsCalculatingInitialLayoutSize:1, mbInitialLayoutDone:1; - vcl::Window* mpDialogParent; + VclPtr<vcl::Window> mpDialogParent; SAL_DLLPRIVATE void ImplInitDockingWindowData(); SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox); diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx index 05a54dc7dfc5..22361a6f910b 100644 --- a/include/vcl/event.hxx +++ b/include/vcl/event.hxx @@ -26,6 +26,7 @@ #include <vcl/keycod.hxx> #include <vcl/cmdevt.hxx> #include <vcl/settings.hxx> +#include <vcl/vclptr.hxx> class AllSettings; class OutputDevice; @@ -411,7 +412,7 @@ enum class MouseNotifyEvent class VCL_DLLPUBLIC NotifyEvent { private: - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; void* mpData; MouseNotifyEvent mnEventType; long mnRetValue; diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index fc51b627978e..65baa304b245 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -41,7 +41,7 @@ class LanguageTag; class VCL_DLLPUBLIC FormatterBase { private: - Edit* mpField; + VclPtr<Edit> mpField; LocaleDataWrapper* mpLocaleDataWrapper; Link maErrorLink; bool mbReformat; diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx index 19c070ea6c0e..3ba8b2c9fa1c 100644 --- a/include/vcl/fixed.hxx +++ b/include/vcl/fixed.hxx @@ -38,7 +38,7 @@ class VCL_DLLPUBLIC FixedText : public Control private: sal_Int32 m_nMaxWidthChars; sal_Int32 m_nMinWidthChars; - vcl::Window *m_pMnemonicWindow; + VclPtr<vcl::Window> m_pMnemonicWindow; using Control::ImplInitSettings; using Window::ImplInit; diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx index 6c1147d241ce..a9033a22670b 100644 --- a/include/vcl/floatwin.hxx +++ b/include/vcl/floatwin.hxx @@ -73,8 +73,8 @@ class VCL_DLLPUBLIC FloatingWindow : public SystemWindow { class ImplData; private: - FloatingWindow* mpNextFloat; - vcl::Window* mpFirstPopupModeWin; + VclPtr<FloatingWindow> mpNextFloat; + VclPtr<vcl::Window> mpFirstPopupModeWin; ImplData* mpImplData; Rectangle maFloatRect; ImplSVEvent * mnPostId; diff --git a/include/vcl/fltcall.hxx b/include/vcl/fltcall.hxx index 6e7ab514ea5a..48f7ac973534 100644 --- a/include/vcl/fltcall.hxx +++ b/include/vcl/fltcall.hxx @@ -33,7 +33,7 @@ namespace vcl { class Window; } struct FltCallDialogParameter { - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; ResMgr* pResMgr; FieldUnit eFieldUnit; OUString aFilterExt; diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index 1f8555675f53..469c7e4851b0 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -354,7 +354,7 @@ private: struct GridEntry { - vcl::Window *pChild; + VclPtr<vcl::Window> pChild; sal_Int32 nSpanWidth; sal_Int32 nSpanHeight; GridEntry() @@ -456,7 +456,7 @@ public: class VCL_DLLPUBLIC VclFrame : public VclBin { private: - vcl::Window *m_pLabel; + VclPtr<vcl::Window> m_pLabel; private: friend class VclBuilder; void designate_label(vcl::Window *pWindow); @@ -467,6 +467,8 @@ public: , m_pLabel(NULL) { } + virtual ~VclFrame(); + virtual void dispose() SAL_OVERRIDE; void set_label(const OUString &rLabel); OUString get_label() const; virtual vcl::Window *get_child() SAL_OVERRIDE; @@ -520,6 +522,8 @@ public: m_pDisclosureButton->SetToggleHdl(LINK(this, VclExpander, ClickHdl)); m_pDisclosureButton->Show(); } + virtual ~VclExpander() { dispose(); } + void dispose() SAL_OVERRIDE { m_pDisclosureButton.clear(); VclBin::dispose(); } virtual vcl::Window *get_child() SAL_OVERRIDE; virtual const vcl::Window *get_child() const SAL_OVERRIDE; virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; @@ -545,7 +549,6 @@ public: protected: virtual Size calculateRequisition() const SAL_OVERRIDE; virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE; - void dispose() SAL_OVERRIDE { m_pDisclosureButton.disposeAndClear(); VclBin::dispose(); } private: bool m_bResizeTopLevel; VclPtr<DisclosureButton> m_pDisclosureButton; @@ -557,6 +560,8 @@ class VCL_DLLPUBLIC VclScrolledWindow : public VclBin { public: VclScrolledWindow(vcl::Window *pParent, WinBits nStyle = WB_HIDE | WB_CLIPCHILDREN | WB_AUTOHSCROLL | WB_AUTOVSCROLL); + virtual ~VclScrolledWindow() { dispose(); } + void dispose() SAL_OVERRIDE { m_pVScroll.disposeAndClear(); m_pHScroll.disposeAndClear(); m_aScrollBarBox.clear(); VclBin::dispose(); } virtual vcl::Window *get_child() SAL_OVERRIDE; virtual const vcl::Window *get_child() const SAL_OVERRIDE; virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; @@ -572,7 +577,6 @@ protected: DECL_LINK(ScrollBarHdl, void *); void InitScrollBars(const Size &rRequest); virtual bool Notify(NotifyEvent& rNEvt) SAL_OVERRIDE; - void dispose() SAL_OVERRIDE { m_pVScroll.disposeAndClear(); m_pHScroll.disposeAndClear(); m_aScrollBarBox.disposeAndClear(); VclBin::dispose(); } private: bool m_bUserManagedScrolling; VclPtr<ScrollBar> m_pVScroll; @@ -648,7 +652,7 @@ enum VclSizeGroupMode class VCL_DLLPUBLIC VclSizeGroup { private: - std::set<vcl::Window*> m_aWindows; + std::set< VclPtr<vcl::Window> > m_aWindows; bool m_bIgnoreHidden; VclSizeGroupMode m_eMode; @@ -661,17 +665,17 @@ public: } void insert(vcl::Window *pWindow) { - m_aWindows.insert(pWindow); + m_aWindows.insert(VclPtr<vcl::Window>(pWindow)); } void erase(vcl::Window *pWindow) { - m_aWindows.erase(pWindow); + m_aWindows.erase(VclPtr<vcl::Window>(pWindow)); } - const std::set<vcl::Window*>& get_widgets() const + const std::set< VclPtr<vcl::Window> >& get_widgets() const { return m_aWindows; } - std::set<vcl::Window*>& get_widgets() + std::set< VclPtr<vcl::Window> >& get_widgets() { return m_aWindows; } @@ -714,11 +718,11 @@ private: VclPtr<VclBox> m_pOwnedContentArea; VclPtr<VclButtonBox> m_pOwnedActionArea; VclPtr<VclGrid> m_pGrid; - FixedImage* m_pImage; - VclMultiLineEdit* m_pPrimaryMessage; - VclMultiLineEdit* m_pSecondaryMessage; + VclPtr<FixedImage> m_pImage; + VclPtr<VclMultiLineEdit> m_pPrimaryMessage; + VclPtr<VclMultiLineEdit> m_pSecondaryMessage; std::vector<VclPtr<PushButton> > m_aOwnedButtons; - std::map<const vcl::Window*, short> m_aResponses; + std::map< VclPtr<const vcl::Window>, short> m_aResponses; OUString m_sPrimaryString; OUString m_sSecondaryString; DECL_DLLPRIVATE_LINK(ButtonHdl, Button *); diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx index fdbce0795ad9..c62ee8d977f7 100644 --- a/include/vcl/lstbox.hxx +++ b/include/vcl/lstbox.hxx @@ -37,10 +37,10 @@ class ImplWin; class VCL_DLLPUBLIC ListBox : public Control { private: - ImplListBox* mpImplLB; - ImplListBoxFloatingWindow* mpFloatWin; - ImplWin* mpImplWin; - ImplBtn* mpBtn; + VclPtr<ImplListBox> mpImplLB; + VclPtr<ImplListBoxFloatingWindow> mpFloatWin; + VclPtr<ImplWin> mpImplWin; + VclPtr<ImplBtn> mpBtn; sal_uInt16 mnDDHeight; sal_Int32 mnSaveValue; sal_Int32 m_nMaxWidthChars; diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index cd058dbdd539..8cf8c00a60de 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -124,7 +124,7 @@ private: MenuItemList* pItemList; // Liste mit den MenuItems MenuLogo* pLogo; Menu* pStartedFrom; - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; Link aActivateHdl; // Active-Handler Link aDeactivateHdl; // Deactivate-Handler diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx index 15d41614cf0d..8147821280c1 100644 --- a/include/vcl/msgbox.hxx +++ b/include/vcl/msgbox.hxx @@ -32,14 +32,14 @@ class CheckBox; class VCL_DLLPUBLIC MessBox : public ButtonDialog { protected: - VclMultiLineEdit* mpVCLMultiLineEdit; - FixedImage* mpFixedImage; - OUString maMessText; - Image maImage; - bool mbHelpBtn; - CheckBox* mpCheckBox; - OUString maCheckBoxText; - bool mbCheck; + VclPtr<VclMultiLineEdit> mpVCLMultiLineEdit; + VclPtr<FixedImage> mpFixedImage; + OUString maMessText; + Image maImage; + bool mbHelpBtn; + VclPtr<CheckBox> mpCheckBox; + OUString maCheckBoxText; + bool mbCheck; SAL_DLLPRIVATE void ImplInitMessBoxData(); SAL_DLLPRIVATE void ImplInitButtons(); diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index 56c34c0af5a7..b69bda35276c 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -249,10 +249,10 @@ private: #endif GLWindow m_aGLWin; - std::unique_ptr<vcl::Window> m_xWindow; - vcl::Window* mpWindow; //points to m_xWindow or the parent window, don't delete it - SystemChildWindow* m_pChildWindow; - std::unique_ptr<SystemChildWindow> m_xChildWindowGC; + VclPtr<vcl::Window> m_xWindow; + VclPtr<vcl::Window> mpWindow; //points to m_pWindow or the parent window, don't delete it + VclPtr<SystemChildWindow> m_pChildWindow; + boost::scoped_ptr<SystemChildWindow> m_pChildWindowGC; bool mbInitialized; int mnRefCount; bool mbRequestLegacyContext; diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx index cbfd9c3a0970..781527157607 100644 --- a/include/vcl/seleng.hxx +++ b/include/vcl/seleng.hxx @@ -83,7 +83,7 @@ class VCL_DLLPUBLIC SelectionEngine { private: FunctionSet* pFunctionSet; - vcl::Window* pWin; + VclPtr<vcl::Window> pWin; Rectangle aArea; Timer aWTimer; // generate fake mouse moves MouseEvent aLastMove; diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx index c167ce7cc506..86df902692b4 100644 --- a/include/vcl/split.hxx +++ b/include/vcl/split.hxx @@ -28,7 +28,7 @@ class VCL_DLLPUBLIC Splitter : public vcl::Window { private: - vcl::Window* mpRefWin; + VclPtr<vcl::Window> mpRefWin; long mnSplitPos; long mnLastSplitPos; long mnStartSplitPos; diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx index 4f7d5728bb83..f90fb16bfeea 100644 --- a/include/vcl/syswin.hxx +++ b/include/vcl/syswin.hxx @@ -149,7 +149,7 @@ private: Idle maLayoutIdle; protected: bool mbIsDefferedInit; - vcl::Window* mpDialogParent; + VclPtr<vcl::Window> mpDialogParent; public: using Window::ImplIsInTaskPaneList; SAL_DLLPRIVATE bool ImplIsInTaskPaneList( vcl::Window* pWin ); diff --git a/include/vcl/tabdlg.hxx b/include/vcl/tabdlg.hxx index f02e2a79de16..db3f592ea20b 100644 --- a/include/vcl/tabdlg.hxx +++ b/include/vcl/tabdlg.hxx @@ -29,8 +29,8 @@ class TabControl; class VCL_DLLPUBLIC TabDialog : public Dialog { private: - FixedLine* mpFixedLine; - vcl::Window* mpViewWindow; + VclPtr<FixedLine> mpFixedLine; + VclPtr<vcl::Window> mpViewWindow; WindowAlign meViewAlign; bool mbPosControls; diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx index 7294d4896748..702a42c756b6 100644 --- a/include/vcl/tabpage.hxx +++ b/include/vcl/tabpage.hxx @@ -41,7 +41,7 @@ private: public: explicit TabPage( vcl::Window* pParent, WinBits nStyle = 0 ); explicit TabPage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription ); - ~TabPage(); + virtual ~TabPage(); virtual void dispose() SAL_OVERRIDE; virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE; diff --git a/include/vcl/taskpanelist.hxx b/include/vcl/taskpanelist.hxx index c8a6abd0e489..738f2b81f3a9 100644 --- a/include/vcl/taskpanelist.hxx +++ b/include/vcl/taskpanelist.hxx @@ -27,7 +27,7 @@ class VCL_DLLPUBLIC TaskPaneList { - ::std::vector<vcl::Window *> mTaskPanes; + ::std::vector< VclPtr<vcl::Window> > mTaskPanes; vcl::Window *FindNextFloat( vcl::Window *pWindow, bool bForward = true ); vcl::Window *FindNextSplitter( vcl::Window *pWindow, bool bForward = true ); diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 8c72c3cc3aae..269c51883836 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -42,7 +42,7 @@ class PopupMenu; class VCL_DLLPUBLIC ToolBoxCustomizeEvent { private: - ToolBox* mpTargetBox; + VclPtr<ToolBox> mpTargetBox; void* mpData; sal_uInt16 mnIdFrom; sal_uInt16 mnPosTo; @@ -131,7 +131,7 @@ private: Rectangle maOutDockRect; Rectangle maInDockRect; Rectangle maPaintRect; - FloatingWindow* mpFloatWin; + VclPtr<FloatingWindow> mpFloatWin; sal_uInt16 mnKeyModifier; long mnDX; long mnDY; diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx index 4e165a438643..a6a809ffb460 100644 --- a/include/vcl/vclevent.hxx +++ b/include/vcl/vclevent.hxx @@ -24,6 +24,7 @@ #include <tools/rtti.hxx> #include <vcl/dllapi.h> #include <vcl/impdel.hxx> +#include <vcl/vclptr.hxx> #include <com/sun/star/uno/Reference.hxx> @@ -213,12 +214,12 @@ public: class VCL_DLLPUBLIC VclWindowEvent : public VclSimpleEvent { private: - vcl::Window* pWindow; + VclPtr<vcl::Window> pWindow; void* pData; public: - VclWindowEvent( vcl::Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; } - virtual ~VclWindowEvent() {} + VclWindowEvent( vcl::Window* pWin, sal_uLong n, void* pDat = NULL ); + virtual ~VclWindowEvent(); TYPEINFO_OVERRIDE(); vcl::Window* GetWindow() const { return pWindow; } diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 50a87ba247ef..832d608b686f 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -21,6 +21,7 @@ #define INCLUDED_VCL_PTR_HXX #include <rtl/ref.hxx> +#include <cstddef> /// @cond INTERNAL namespace vcl { namespace detail { @@ -68,6 +69,8 @@ public: }; }; // namespace detail, namespace vcl +namespace vcl { class Window; } + /** * A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for references to vcl::Window subclasses. * @@ -91,7 +94,7 @@ public: /** Constructor... */ - explicit inline VclPtr (reference_type * pBody) + inline VclPtr (reference_type * pBody) : m_rInnerRef(pBody) {} @@ -180,6 +183,41 @@ public: } } + /** Returns True if handle points to the same body. + */ + template<class T> + inline bool SAL_CALL operator== (const VclPtr<T> & handle) const + { + return (get() == handle.get()); + } + + /** Needed to place VclPtr's into STL collection. + */ + inline bool SAL_CALL operator!= (const VclPtr<reference_type> & handle) const + { + return (m_rInnerRef != handle.m_rInnerRef); + } + + /** Makes comparing against NULL easier, resolves compile-time ambiguity */ + inline bool SAL_CALL operator!= (::std::nullptr_t ) const + { + return (get() != nullptr); + } + + /** Needed to place VclPtr's into STL collection. + */ + inline bool SAL_CALL operator< (const VclPtr<reference_type> & handle) const + { + return (m_rInnerRef < handle.m_rInnerRef); + } + + + /** Needed to place VclPtr's into STL collection. + */ + inline bool SAL_CALL operator> (const VclPtr<reference_type> & handle) const + { + return (m_rInnerRef > handle.m_rInnerRef); + } }; // class VclPtr #endif // INCLUDED_VCL_PTR_HXX diff --git a/include/vcl/waitobj.hxx b/include/vcl/waitobj.hxx index d6deecf33f29..daf0e2a68a4f 100644 --- a/include/vcl/waitobj.hxx +++ b/include/vcl/waitobj.hxx @@ -26,7 +26,7 @@ class VCL_DLLPUBLIC WaitObject { private: - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; public: WaitObject( vcl::Window* pWindow ) { diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 7d104a4700c2..cb178d2c3571 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -662,7 +662,7 @@ private: SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX(); // retrieves the list of owner draw decorated windows for this window hiearchy - SAL_DLLPRIVATE ::std::vector<vcl::Window *>& ImplGetOwnerDrawList(); + SAL_DLLPRIVATE ::std::vector<VclPtr<vcl::Window> >& ImplGetOwnerDrawList(); SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow(); @@ -1431,7 +1431,7 @@ public: */ void add_mnemonic_label(FixedText *pLabel); void remove_mnemonic_label(FixedText *pLabel); - std::vector<FixedText*> list_mnemonic_labels() const; + std::vector<VclPtr<FixedText> > list_mnemonic_labels() const; /* * Move this widget to be the nNewPosition'd child of its parent |