diff options
Diffstat (limited to 'sd/source')
90 files changed, 1213 insertions, 601 deletions
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 4a36503c83b2..200e62b432a1 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -347,12 +347,13 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes class SdDesignNameDlg : public ModalDialog { private: - Edit* m_pEdit; - OKButton* m_pBtnOK; + VclPtr<Edit> m_pEdit; + VclPtr<OKButton> m_pBtnOK; public: SdDesignNameDlg(vcl::Window* pWindow, const OUString& aName ); - + virtual ~SdDesignNameDlg(); + virtual void dispose() SAL_OVERRIDE; OUString GetDesignName(); DECL_LINK(ModifyHdl, void *); }; @@ -483,8 +484,97 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType) SdPublishingDlg::~SdPublishingDlg() { + dispose(); +} + +void SdPublishingDlg::dispose() +{ + pPage1.clear(); + pPage1_Titel.clear(); + pPage1_NewDesign.clear(); + pPage1_OldDesign.clear(); + pPage1_Designs.clear(); + pPage1_DelDesign.clear(); + pPage1_Desc.clear(); + pPage2.clear(); + pPage2Frame2.clear(); + pPage2Frame3.clear(); + pPage2Frame4.clear(); + pPage2_Titel.clear(); + pPage2_Standard.clear(); + pPage2_Frames.clear(); + pPage2_SingleDocument.clear(); + pPage2_Kiosk.clear(); + pPage2_WebCast.clear(); + pPage2_Standard_FB.clear(); + pPage2_Frames_FB.clear(); + pPage2_Kiosk_FB.clear(); + pPage2_WebCast_FB.clear(); + pPage2_Titel_Html.clear(); + pPage2_Content.clear(); + pPage2_Notes.clear(); + pPage2_Titel_WebCast.clear(); + pPage2_ASP.clear(); + pPage2_PERL.clear(); + pPage2_URL_txt.clear(); + pPage2_URL.clear(); + pPage2_CGI_txt.clear(); + pPage2_CGI.clear(); + pPage2_Index_txt.clear(); + pPage2_Index.clear(); + pPage2_Titel_Kiosk.clear(); + pPage2_ChgDefault.clear(); + pPage2_ChgAuto.clear(); + pPage2_Duration_txt.clear(); + pPage2_Duration.clear(); + pPage2_Endless.clear(); + pPage3.clear(); + pPage3_Titel1.clear(); + pPage3_Png.clear(); + pPage3_Gif.clear(); + pPage3_Jpg.clear(); + pPage3_Quality_txt.clear(); + pPage3_Quality.clear(); + pPage3_Titel2.clear(); + pPage3_Resolution_1.clear(); + pPage3_Resolution_2.clear(); + pPage3_Resolution_3.clear(); + pPage3_Titel3.clear(); + pPage3_SldSound.clear(); + pPage3_HiddenSlides.clear(); + pPage4.clear(); + pPage4_Titel1.clear(); + pPage4_Author_txt.clear(); + pPage4_Author.clear(); + pPage4_Email_txt.clear(); + pPage4_Email.clear(); + pPage4_WWW_txt.clear(); + pPage4_WWW.clear(); + pPage4_Titel2.clear(); + pPage4_Misc.clear(); + pPage4_Download.clear(); + pPage5.clear(); + pPage5_Titel.clear(); + pPage5_TextOnly.clear(); + pPage5_Buttons.clear(); + pPage6.clear(); + pPage6_Titel.clear(); + pPage6_Default.clear(); + pPage6_User.clear(); + pPage6_Back.clear(); + pPage6_Text.clear(); + pPage6_Link.clear(); + pPage6_VLink.clear(); + pPage6_ALink.clear(); + pPage6_DocColors.clear(); + pPage6_Preview.clear(); + pLastPageButton.clear(); + pNextPageButton.clear(); + pFinishButton.clear(); + ModalDialog::dispose(); } + // Generate dialog controls and embed them in the pages void SdPublishingDlg::CreatePages() { @@ -1542,6 +1632,18 @@ SdDesignNameDlg::SdDesignNameDlg(vcl::Window* pWindow, const OUString& aName) m_pBtnOK->Enable(!aName.isEmpty()); } +SdDesignNameDlg::~SdDesignNameDlg() +{ + dispose(); +} + +void SdDesignNameDlg::dispose() +{ + m_pEdit.clear(); + m_pBtnOK.clear(); + ModalDialog::dispose(); +} + OUString SdDesignNameDlg::GetDesignName() { return m_pEdit->GetText(); diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index 8d04f48fe315..dc6aa03db0a4 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -96,7 +96,7 @@ private: sal_Int32 mnFirstVisibleChild; sal_Int32 mnLastVisibleChild; bool mbListeningToDocument; - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; sal_Int32 mnFocusedIndex; bool mbModelChangeLocked; ImplSVEvent * mnUpdateChildrenUserEventId; @@ -221,7 +221,7 @@ Reference<XAccessible > SAL_CALL AccessibleSlideSorterView::getAccessibleParent const SolarMutexGuard aSolarGuard; Reference<XAccessible> xParent; - if (mpContentWindow != NULL) + if (mpContentWindow != nullptr) { vcl::Window* pParent = mpContentWindow->GetAccessibleParentWindow(); if (pParent != NULL) @@ -302,7 +302,7 @@ Reference<XAccessibleStateSet > SAL_CALL pStateSet->AddState(AccessibleStateType::ACTIVE); pStateSet->AddState(AccessibleStateType::MULTI_SELECTABLE); pStateSet->AddState(AccessibleStateType::OPAQUE); - if (mpContentWindow!=NULL) + if (mpContentWindow!=nullptr) { if (mpContentWindow->IsVisible()) pStateSet->AddState(AccessibleStateType::VISIBLE); @@ -416,7 +416,7 @@ awt::Rectangle SAL_CALL AccessibleSlideSorterView::getBounds (void) const SolarMutexGuard aSolarGuard; awt::Rectangle aBBox; - if (mpContentWindow != NULL) + if (mpContentWindow != nullptr) { const Point aPosition (mpContentWindow->GetPosPixel()); const Size aSize (mpContentWindow->GetOutputSizePixel()); @@ -436,7 +436,7 @@ awt::Point SAL_CALL AccessibleSlideSorterView::getLocation (void) ThrowIfDisposed(); awt::Point aLocation; - if (mpContentWindow != NULL) + if (mpContentWindow != nullptr) { const Point aPosition (mpContentWindow->GetPosPixel()); aLocation.X = aPosition.X(); @@ -478,7 +478,7 @@ awt::Size SAL_CALL AccessibleSlideSorterView::getSize (void) ThrowIfDisposed(); awt::Size aSize; - if (mpContentWindow != NULL) + if (mpContentWindow != nullptr) { const Size aOutputSize (mpContentWindow->GetOutputSizePixel()); aSize.Width = aOutputSize.Width(); @@ -813,7 +813,7 @@ void AccessibleSlideSorterView::Implementation::ConnectListeners (void) StartListening (*mrSlideSorter.GetViewShell()); mbListeningToDocument = true; - if (mpWindow != NULL) + if (mpWindow != nullptr) mpWindow->AddEventListener( LINK(this,AccessibleSlideSorterView::Implementation,WindowEventListener)); @@ -834,7 +834,7 @@ void AccessibleSlideSorterView::Implementation::ReleaseListeners (void) mrSlideSorter.GetView().RemoveVisibilityChangeListener( LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener)); - if (mpWindow != NULL) + if (mpWindow != nullptr) mpWindow->RemoveEventListener( LINK(this,AccessibleSlideSorterView::Implementation,WindowEventListener)); diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx index 5e7c988e148e..358ce0705cc9 100644 --- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx @@ -165,6 +165,7 @@ class CustomAnimationCreateTabPage : public TabPage public: CustomAnimationCreateTabPage( vcl::Window* pParent, CustomAnimationCreateDialog* pDialogParent, sal_uInt16 nTabId, const PresetCategoryList& rCategoryList, bool bHasText, bool bIsMotionPath = false ); virtual ~CustomAnimationCreateTabPage(); + virtual void dispose() SAL_OVERRIDE; PathKind getCreatePathKind() const; CustomAnimationPresetPtr getSelectedPreset() const; @@ -187,12 +188,12 @@ private: void clearEffects(); private: - CategoryListBox* mpLBEffects; - FixedText* mpFTSpeed; - ListBox* mpCBSpeed; - CheckBox* mpCBXPReview; + VclPtr<CategoryListBox> mpLBEffects; + VclPtr<FixedText> mpFTSpeed; + VclPtr<ListBox> mpCBSpeed; + VclPtr<CheckBox> mpCBXPReview; - CustomAnimationCreateDialog* mpParent; + VclPtr<CustomAnimationCreateDialog> mpParent; sal_uInt16 mnId; @@ -296,7 +297,18 @@ CustomAnimationCreateTabPage::CustomAnimationCreateTabPage( vcl::Window* pParent CustomAnimationCreateTabPage::~CustomAnimationCreateTabPage() { + dispose(); +} + +void CustomAnimationCreateTabPage::dispose() +{ clearEffects(); + mpLBEffects.clear(); + mpFTSpeed.clear(); + mpCBSpeed.clear(); + mpCBXPReview.clear(); + mpParent.clear(); + TabPage::dispose(); } IMPL_LINK( CustomAnimationCreateTabPage, implSelectHdl, Control*, pControl ) @@ -548,6 +560,8 @@ void CustomAnimationCreateDialog::dispose() delete mpTabPages[MOTIONPATH]; delete mpTabPages[MISCEFFECTS]; + mpTabControl.clear(); + mpPane.clear(); TabDialog::dispose(); } diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.hxx b/sd/source/ui/animations/CustomAnimationCreateDialog.hxx index 7ae2ec75a9fd..974b3f34de17 100644 --- a/sd/source/ui/animations/CustomAnimationCreateDialog.hxx +++ b/sd/source/ui/animations/CustomAnimationCreateDialog.hxx @@ -57,13 +57,13 @@ private: DECL_LINK(implDeactivatePagekHdl, void *); private: - CustomAnimationPane* mpPane; + VclPtr<CustomAnimationPane> mpPane; const std::vector< ::com::sun::star::uno::Any >& mrTargets; double mfDuration; bool mbIsPreview; - TabControl* mpTabControl; + VclPtr<TabControl> mpTabControl; CustomAnimationCreateTabPage* mpTabPages[5]; sal_uInt16 mnEntranceId, mnEmphasisId, mnExitId, mnMPathId, mnMiscId; diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index c5e3a2e6b2c4..ce65a000ebcd 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -107,7 +107,7 @@ public: private: std::map< sal_uInt16, OUString > maPropertyValues; - ListBox* mpControl; + VclPtr<ListBox> mpControl; }; PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const OUString& aPresetId, const Link& rModifyHdl ) @@ -159,7 +159,7 @@ void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId ) PresetPropertyBox::~PresetPropertyBox() { - delete mpControl; + mpControl.clear(); } Any PresetPropertyBox::getValue() @@ -183,7 +183,7 @@ public: virtual Control* getControl() SAL_OVERRIDE; private: - ColorListBox* mpControl; + VclPtr<ColorListBox> mpControl; }; ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl ) @@ -219,7 +219,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent ColorPropertyBox::~ColorPropertyBox() { - delete mpControl; + mpControl.clear(); } void ColorPropertyBox::setValue( const Any& rValue, const OUString& ) @@ -256,7 +256,7 @@ public: virtual Control* getControl() SAL_OVERRIDE; private: - FontNameBox* mpControl; + VclPtr<FontNameBox> mpControl; }; FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl ) @@ -303,7 +303,7 @@ void FontPropertyBox::setValue( const Any& rValue, const OUString& ) FontPropertyBox::~FontPropertyBox() { - delete mpControl; + mpControl.clear(); } Any FontPropertyBox::getValue() @@ -331,7 +331,7 @@ public: private: VclPtr<Edit> mpSubControl; - MenuButton* mpDropdownButton; + VclPtr<MenuButton> mpDropdownButton; PopupMenu* mpMenu; }; @@ -356,8 +356,8 @@ DropdownMenuBox::~DropdownMenuBox() void DropdownMenuBox::dispose() { - SetSubEdit(VclPtr<Edit>()); - delete mpDropdownButton; + SetSubEdit(nullptr); + mpDropdownButton.clear(); delete mpMenu; mpSubControl.disposeAndClear(); Edit::dispose(); @@ -412,7 +412,7 @@ public: DECL_LINK( implMenuSelectHdl, MenuButton* ); private: - DropdownMenuBox* mpControl; + VclPtr<DropdownMenuBox> mpControl; PopupMenu* mpMenu; VclPtr<MetricField> mpMetric; }; @@ -437,7 +437,7 @@ CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Windo CharHeightPropertyBox::~CharHeightPropertyBox() { - delete mpControl; + mpControl.clear(); } IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb ) @@ -492,7 +492,7 @@ public: void updateMenu(); private: - DropdownMenuBox* mpControl; + VclPtr<DropdownMenuBox> mpControl; PopupMenu* mpMenu; VclPtr<MetricField> mpMetric; Link maModifyHdl; @@ -528,7 +528,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W TransparencyPropertyBox::~TransparencyPropertyBox() { - delete mpControl; + mpControl.clear(); } void TransparencyPropertyBox::updateMenu() @@ -596,7 +596,7 @@ public: void updateMenu(); private: - DropdownMenuBox* mpControl; + VclPtr<DropdownMenuBox> mpControl; PopupMenu* mpMenu; VclPtr<MetricField> mpMetric; Link maModifyHdl; @@ -626,7 +626,7 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p RotationPropertyBox::~RotationPropertyBox() { - delete mpControl; + mpControl.clear(); } void RotationPropertyBox::updateMenu() @@ -721,7 +721,7 @@ public: void updateMenu(); private: - DropdownMenuBox* mpControl; + VclPtr<DropdownMenuBox> mpControl; PopupMenu* mpMenu; VclPtr<MetricField> mpMetric; Link maModifyHdl; @@ -751,7 +751,7 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent ScalePropertyBox::~ScalePropertyBox() { - delete mpControl; + mpControl.clear(); } void ScalePropertyBox::updateMenu() @@ -883,7 +883,7 @@ public: void update(); private: - DropdownMenuBox* mpControl; + VclPtr<DropdownMenuBox> mpControl; PopupMenu* mpMenu; VclPtr<Edit> mpEdit; Link maModifyHdl; @@ -911,7 +911,7 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window* FontStylePropertyBox::~FontStylePropertyBox() { - delete mpControl; + mpControl.clear(); } void FontStylePropertyBox::update() @@ -993,6 +993,7 @@ class CustomAnimationEffectTabPage : public TabPage public: CustomAnimationEffectTabPage( vcl::Window* pParent, const STLPropertySet* pSet ); virtual ~CustomAnimationEffectTabPage(); + virtual void dispose() SAL_OVERRIDE; void update( STLPropertySet* pSet ); DECL_LINK( implSelectHdl, Control* ); @@ -1010,24 +1011,24 @@ private: bool mbHasText; const STLPropertySet* mpSet; - VclFrame* mpSettings; - FixedText* mpFTProperty1; - PropertyControl* mpLBProperty1; - VclHBox* mpPlaceholderBox; - CheckBox* mpCBSmoothStart; - CheckBox* mpCBSmoothEnd; - - FixedText* mpFTSound; - ListBox* mpLBSound; - PushButton* mpPBSoundPreview; - FixedText* mpFTAfterEffect; - ListBox* mpLBAfterEffect; - FixedText* mpFTDimColor; - ColorListBox* mpCLBDimColor; - FixedText* mpFTTextAnim; - ListBox* mpLBTextAnim; - MetricField* mpMFTextDelay; - FixedText* mpFTTextDelay; + VclPtr<VclFrame> mpSettings; + VclPtr<FixedText> mpFTProperty1; + VclPtr<PropertyControl> mpLBProperty1; + VclPtr<VclHBox> mpPlaceholderBox; + VclPtr<CheckBox> mpCBSmoothStart; + VclPtr<CheckBox> mpCBSmoothEnd; + + VclPtr<FixedText> mpFTSound; + VclPtr<ListBox> mpLBSound; + VclPtr<PushButton> mpPBSoundPreview; + VclPtr<FixedText> mpFTAfterEffect; + VclPtr<ListBox> mpLBAfterEffect; + VclPtr<FixedText> mpFTDimColor; + VclPtr<ColorListBox> mpCLBDimColor; + VclPtr<FixedText> mpFTTextAnim; + VclPtr<ListBox> mpLBTextAnim; + VclPtr<MetricField> mpMFTextDelay; + VclPtr<FixedText> mpFTTextDelay; ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer; }; @@ -1262,7 +1263,30 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent CustomAnimationEffectTabPage::~CustomAnimationEffectTabPage() { + dispose(); +} + +void CustomAnimationEffectTabPage::dispose() +{ clearSoundListBox(); + mpSettings.clear(); + mpFTProperty1.clear(); + mpLBProperty1.clear(); + mpPlaceholderBox.clear(); + mpCBSmoothStart.clear(); + mpCBSmoothEnd.clear(); + mpFTSound.clear(); + mpLBSound.clear(); + mpPBSoundPreview.clear(); + mpFTAfterEffect.clear(); + mpLBAfterEffect.clear(); + mpFTDimColor.clear(); + mpCLBDimColor.clear(); + mpFTTextAnim.clear(); + mpLBTextAnim.clear(); + mpMFTextDelay.clear(); + mpFTTextDelay.clear(); + TabPage::dispose(); } void CustomAnimationEffectTabPage::updateControlStates() @@ -1565,6 +1589,7 @@ class CustomAnimationDurationTabPage : public TabPage public: CustomAnimationDurationTabPage( vcl::Window* pParent, const STLPropertySet* pSet ); virtual ~CustomAnimationDurationTabPage(); + virtual void dispose() SAL_OVERRIDE; void update( STLPropertySet* pSet ); @@ -1573,18 +1598,18 @@ public: private: const STLPropertySet* mpSet; - FixedText* mpFTStart; - ListBox* mpLBStart; - FixedText* mpFTStartDelay; - MetricField* mpMFStartDelay; - FixedText* mpFTDuration; - ListBox* mpCBDuration; - FixedText* mpFTRepeat; - ListBox* mpCBRepeat; - CheckBox* mpCBXRewind; - RadioButton* mpRBClickSequence; - RadioButton* mpRBInteractive; - ListBox* mpLBTrigger; + VclPtr<FixedText> mpFTStart; + VclPtr<ListBox> mpLBStart; + VclPtr<FixedText> mpFTStartDelay; + VclPtr<MetricField> mpMFStartDelay; + VclPtr<FixedText> mpFTDuration; + VclPtr<ListBox> mpCBDuration; + VclPtr<FixedText> mpFTRepeat; + VclPtr<ListBox> mpCBRepeat; + VclPtr<CheckBox> mpCBXRewind; + VclPtr<RadioButton> mpRBClickSequence; + VclPtr<RadioButton> mpRBInteractive; + VclPtr<ListBox> mpLBTrigger; }; CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pParent, const STLPropertySet* pSet) @@ -1762,6 +1787,24 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar CustomAnimationDurationTabPage::~CustomAnimationDurationTabPage() { + dispose(); +} + +void CustomAnimationDurationTabPage::dispose() +{ + mpFTStart.clear(); + mpLBStart.clear(); + mpFTStartDelay.clear(); + mpMFStartDelay.clear(); + mpFTDuration.clear(); + mpCBDuration.clear(); + mpFTRepeat.clear(); + mpCBRepeat.clear(); + mpCBXRewind.clear(); + mpRBClickSequence.clear(); + mpRBInteractive.clear(); + mpLBTrigger.clear(); + TabPage::dispose(); } IMPL_LINK( CustomAnimationDurationTabPage, implControlHdl, Control*, pControl ) @@ -1931,6 +1974,8 @@ class CustomAnimationTextAnimTabPage : public TabPage { public: CustomAnimationTextAnimTabPage( vcl::Window* pParent, const STLPropertySet* pSet ); + virtual ~CustomAnimationTextAnimTabPage(); + virtual void dispose() SAL_OVERRIDE; void update( STLPropertySet* pSet ); @@ -1938,12 +1983,12 @@ public: DECL_LINK(implSelectHdl, void *); private: - FixedText* maFTGroupText; - ListBox* maLBGroupText; - CheckBox* maCBXGroupAuto; - MetricField* maMFGroupAuto; - CheckBox* maCBXAnimateForm; - CheckBox* maCBXReverse; + VclPtr<FixedText> maFTGroupText; + VclPtr<ListBox> maLBGroupText; + VclPtr<CheckBox> maCBXGroupAuto; + VclPtr<MetricField> maMFGroupAuto; + VclPtr<CheckBox> maCBXAnimateForm; + VclPtr<CheckBox> maCBXReverse; const STLPropertySet* mpSet; @@ -2030,6 +2075,22 @@ CustomAnimationTextAnimTabPage::CustomAnimationTextAnimTabPage(vcl::Window* pPar updateControlStates(); } +CustomAnimationTextAnimTabPage::~CustomAnimationTextAnimTabPage() +{ + dispose(); +} + +void CustomAnimationTextAnimTabPage::dispose() +{ + maFTGroupText.clear(); + maLBGroupText.clear(); + maCBXGroupAuto.clear(); + maMFGroupAuto.clear(); + maCBXAnimateForm.clear(); + maCBXReverse.clear(); + TabPage::dispose(); +} + void CustomAnimationTextAnimTabPage::update( STLPropertySet* pSet ) { sal_Int32 nPos = maLBGroupText->GetSelectEntryPos(); @@ -2151,13 +2212,14 @@ CustomAnimationDialog::~CustomAnimationDialog() void CustomAnimationDialog::dispose() { - delete mpEffectTabPage; - delete mpDurationTabPage; - delete mpTextAnimTabPage; + mpEffectTabPage.clear(); + mpDurationTabPage.clear(); + mpTextAnimTabPage.clear(); delete mpSet; delete mpResultSet; + mpTabControl.clear(); TabDialog::dispose(); } diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx b/sd/source/ui/animations/CustomAnimationDialog.hxx index 897a22946c9d..3754d93ffdbf 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.hxx +++ b/sd/source/ui/animations/CustomAnimationDialog.hxx @@ -156,11 +156,11 @@ private: STLPropertySet* mpResultSet; CustomAnimationEffectPtr mpEffect; - TabControl* mpTabControl; + VclPtr<TabControl> mpTabControl; - CustomAnimationDurationTabPage* mpDurationTabPage; - CustomAnimationEffectTabPage* mpEffectTabPage; - CustomAnimationTextAnimTabPage* mpTextAnimTabPage; + VclPtr<CustomAnimationDurationTabPage> mpDurationTabPage; + VclPtr<CustomAnimationEffectTabPage> mpEffectTabPage; + VclPtr<CustomAnimationTextAnimTabPage> mpTextAnimTabPage; }; } diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 43f3c3451bb8..24bf4e892471 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -210,7 +210,7 @@ public: virtual void Paint( const Point&, SvTreeListBox& rDev, const SvViewDataEntry* pView,const SvTreeListEntry* pEntry) SAL_OVERRIDE; private: - CustomAnimationList* mpParent; + VclPtr<CustomAnimationList> mpParent; OUString maDescription; CustomAnimationEffectPtr mpEffect; }; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index c64a1f28bcf2..c83dc7155be2 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -240,6 +240,23 @@ void CustomAnimationPane::dispose() for( aIter = aTags.begin(); aIter != aTags.end(); ++aIter ) (*aIter)->Dispose(); + mpPBAddEffect.clear(); + mpPBChangeEffect.clear(); + mpPBRemoveEffect.clear(); + mpFTEffect.clear(); + mpFTStart.clear(); + mpLBStart.clear(); + mpFTProperty.clear(); + mpPlaceholderBox.clear(); + mpLBProperty.clear(); + mpPBPropertyMore.clear(); + mpFTSpeed.clear(); + mpCBSpeed.clear(); + mpCustomAnimationList.clear(); + mpPBMoveUp.clear(); + mpPBMoveDown.clear(); + mpPBPlay.clear(); + mpCBAutoPreview.clear(); PanelLayout::dispose(); } @@ -815,11 +832,11 @@ void CustomAnimationPane::UpdateLook (void) ::sfx2::sidebar::Theme::GetWallpaper( ::sfx2::sidebar::Theme::Paint_PanelBackground)); SetBackground(aBackground); - if (mpFTStart != NULL) + if (mpFTStart != nullptr) mpFTStart->SetBackground(aBackground); - if (mpFTProperty != NULL) + if (mpFTProperty != nullptr) mpFTProperty->SetBackground(aBackground); - if (mpFTSpeed != NULL) + if (mpFTSpeed != nullptr) mpFTSpeed->SetBackground(aBackground); } diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index bdf29dd1cf9e..f1e75d387af6 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -126,23 +126,23 @@ private: const CustomAnimationPresets* mpCustomAnimationPresets; - PushButton* mpPBAddEffect; - PushButton* mpPBChangeEffect; - PushButton* mpPBRemoveEffect; - FixedText* mpFTEffect; - FixedText* mpFTStart; - ListBox* mpLBStart; - FixedText* mpFTProperty; - VclHBox* mpPlaceholderBox; - PropertyControl* mpLBProperty; - PushButton* mpPBPropertyMore; - FixedText* mpFTSpeed; - ListBox* mpCBSpeed; - CustomAnimationList* mpCustomAnimationList; - PushButton* mpPBMoveUp; - PushButton* mpPBMoveDown; - PushButton* mpPBPlay; - CheckBox* mpCBAutoPreview; + VclPtr<PushButton> mpPBAddEffect; + VclPtr<PushButton> mpPBChangeEffect; + VclPtr<PushButton> mpPBRemoveEffect; + VclPtr<FixedText> mpFTEffect; + VclPtr<FixedText> mpFTStart; + VclPtr<ListBox> mpLBStart; + VclPtr<FixedText> mpFTProperty; + VclPtr<VclHBox> mpPlaceholderBox; + VclPtr<PropertyControl> mpLBProperty; + VclPtr<PushButton> mpPBPropertyMore; + VclPtr<FixedText> mpFTSpeed; + VclPtr<ListBox> mpCBSpeed; + VclPtr<CustomAnimationList> mpCustomAnimationList; + VclPtr<PushButton> mpPBMoveUp; + VclPtr<PushButton> mpPBMoveDown; + VclPtr<PushButton> mpPBPlay; + VclPtr<CheckBox> mpCBAutoPreview; OUString maStrModify; OUString maStrProperty; diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 5d5682bb3363..ce7e18773e43 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -386,7 +386,7 @@ struct lcl_AppendSoundToListBox : public ::std::unary_function< OUString, void > } private: - ListBox* mrListBox; + VclPtr<ListBox> mrListBox; }; void lcl_FillSoundListBox( @@ -490,6 +490,19 @@ void SlideTransitionPane::dispose() { maLateInitTimer.Stop(); removeListener(); + mpLB_SLIDE_TRANSITIONS.clear(); + mpFT_SPEED.clear(); + mpLB_SPEED.clear(); + mpFT_SOUND.clear(); + mpLB_SOUND.clear(); + mpCB_LOOP_SOUND.clear(); + mpRB_ADVANCE_ON_MOUSE.clear(); + mpRB_ADVANCE_AUTO.clear(); + mpMF_ADVANCE_AUTO_AFTER.clear(); + mpPB_APPLY_TO_ALL.clear(); + mpPB_PLAY.clear(); + mpPB_SLIDE_SHOW.clear(); + mpCB_AUTO_PREVIEW.clear(); PanelLayout::dispose(); } diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx index 1cf22541dc68..00642e6c4d9c 100644 --- a/sd/source/ui/animations/SlideTransitionPane.hxx +++ b/sd/source/ui/animations/SlideTransitionPane.hxx @@ -105,19 +105,19 @@ private: SdDrawDocument * mpDrawDoc; Size maMinSize; - ListBox* mpLB_SLIDE_TRANSITIONS; - FixedText* mpFT_SPEED; - ListBox* mpLB_SPEED; - FixedText* mpFT_SOUND; - ListBox* mpLB_SOUND; - CheckBox* mpCB_LOOP_SOUND; - RadioButton* mpRB_ADVANCE_ON_MOUSE; - RadioButton* mpRB_ADVANCE_AUTO; - MetricField* mpMF_ADVANCE_AUTO_AFTER; - PushButton* mpPB_APPLY_TO_ALL; - PushButton* mpPB_PLAY; - PushButton* mpPB_SLIDE_SHOW; - CheckBox* mpCB_AUTO_PREVIEW; + VclPtr<ListBox> mpLB_SLIDE_TRANSITIONS; + VclPtr<FixedText> mpFT_SPEED; + VclPtr<ListBox> mpLB_SPEED; + VclPtr<FixedText> mpFT_SOUND; + VclPtr<ListBox> mpLB_SOUND; + VclPtr<CheckBox> mpCB_LOOP_SOUND; + VclPtr<RadioButton> mpRB_ADVANCE_ON_MOUSE; + VclPtr<RadioButton> mpRB_ADVANCE_AUTO; + VclPtr<MetricField> mpMF_ADVANCE_AUTO_AFTER; + VclPtr<PushButton> mpPB_APPLY_TO_ALL; + VclPtr<PushButton> mpPB_PLAY; + VclPtr<PushButton> mpPB_SLIDE_SHOW; + VclPtr<CheckBox> mpCB_AUTO_PREVIEW; ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel; diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx index 96085f253fcb..34645274499e 100644 --- a/sd/source/ui/annotations/annotationtag.hxx +++ b/sd/source/ui/annotations/annotationtag.hxx @@ -85,7 +85,7 @@ private: const ::vcl::Font& mrFont; Size maSize; ImplSVEvent * mnClosePopupEvent; - vcl::Window* mpListenWindow; + VclPtr<vcl::Window> mpListenWindow; Point maMouseDownPos; }; diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 491142fb8895..f17151d0e6df 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -118,6 +118,13 @@ AnnotationTextWindow::AnnotationTextWindow( AnnotationWindow* pParent, WinBits n AnnotationTextWindow::~AnnotationTextWindow() { + dispose(); +} + +void AnnotationTextWindow::dispose() +{ + mpAnnotationWindow.clear(); + Control::dispose(); } void AnnotationTextWindow::Paint( const Rectangle& rRect) @@ -289,11 +296,11 @@ AnnotationWindow::~AnnotationWindow() void AnnotationWindow::dispose() { - delete mpMeta; + mpMeta.clear(); delete mpOutlinerView; delete mpOutliner; - delete mpVScrollbar; - delete mpTextWindow; + mpVScrollbar.clear(); + mpTextWindow.clear(); FloatingWindow::dispose(); } diff --git a/sd/source/ui/annotations/annotationwindow.hxx b/sd/source/ui/annotations/annotationwindow.hxx index a29ca421e522..54334b1f4ea3 100644 --- a/sd/source/ui/annotations/annotationwindow.hxx +++ b/sd/source/ui/annotations/annotationwindow.hxx @@ -50,7 +50,7 @@ class AnnotationTextWindow : public Control { private: OutlinerView* mpOutlinerView; - AnnotationWindow* mpAnnotationWindow; + VclPtr<AnnotationWindow> mpAnnotationWindow; protected: virtual void Paint( const Rectangle& rRect) SAL_OVERRIDE; @@ -64,6 +64,7 @@ protected: public: AnnotationTextWindow( AnnotationWindow* pParent, WinBits nBits ); virtual ~AnnotationTextWindow(); + virtual void dispose() SAL_OVERRIDE; void SetOutlinerView( OutlinerView* pOutlinerView ) { mpOutlinerView = pOutlinerView; } @@ -83,13 +84,13 @@ class AnnotationWindow : public FloatingWindow OutlinerView* mpOutlinerView; Outliner* mpOutliner; - ScrollBar* mpVScrollbar; + VclPtr<ScrollBar> mpVScrollbar; ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > mxAnnotation; bool mbReadonly; bool mbProtected; bool mbMouseOverButton; - AnnotationTextWindow* mpTextWindow; - MultiLineEdit* mpMeta; + VclPtr<AnnotationTextWindow> mpTextWindow; + VclPtr<MultiLineEdit> mpMeta; Rectangle maRectMetaButton; basegfx::B2DPolygon maPopupTriangle; diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 7c8d02a46819..53a7d6d87714 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -67,6 +67,7 @@ class LayoutToolbarMenu : public svtools::ToolbarMenu public: LayoutToolbarMenu( SlideLayoutController& rController, const Reference< XFrame >& xFrame, vcl::Window* pParent, const bool bInsertPage ); virtual ~LayoutToolbarMenu(); + virtual void dispose() SAL_OVERRIDE; protected: DECL_LINK( SelectHdl, void * ); @@ -75,8 +76,8 @@ private: SlideLayoutController& mrController; Reference< XFrame > mxFrame; bool mbInsertPage; - ValueSet* mpLayoutSet1; - ValueSet* mpLayoutSet2; + VclPtr<ValueSet> mpLayoutSet1; + VclPtr<ValueSet> mpLayoutSet2; }; struct snewfoil_value_info @@ -256,6 +257,14 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const LayoutToolbarMenu::~LayoutToolbarMenu() { + dispose(); +} + +void LayoutToolbarMenu::dispose() +{ + mpLayoutSet1.clear(); + mpLayoutSet2.clear(); + svtools::ToolbarMenu::dispose(); } IMPL_LINK( LayoutToolbarMenu, SelectHdl, void *, pControl ) diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 15908461a011..26606bc20e2b 100644 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -62,7 +62,7 @@ PaneChildWindow::PaneChildWindow ( pParentWindow, SD_RESSTR(nTitleBarResId)); eChildAlignment = eAlignment; - static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo); + static_cast<SfxDockingWindow*>(pWindow.get())->Initialize(pInfo); SetHideNotDelete(true); ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame()); @@ -75,7 +75,7 @@ PaneChildWindow::PaneChildWindow ( PaneChildWindow::~PaneChildWindow (void) { ViewShellBase* pBase = NULL; - PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow); + PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow.get()); if (pDockingWindow != NULL) pBase = ViewShellBase::GetViewShellBase( pDockingWindow->GetBindings().GetDispatcher()->GetFrame()); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index 4d75e6c8142c..5a81ddcf72db 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -76,6 +76,23 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* pAc SdPhotoAlbumDialog::~SdPhotoAlbumDialog() { + dispose(); +} + +void SdPhotoAlbumDialog::dispose() +{ + pCancelBtn.clear(); + pCreateBtn.clear(); + pAddBtn.clear(); + pUpBtn.clear(); + pDownBtn.clear(); + pRemoveBtn.clear(); + pImagesLst.clear(); + pImg.clear(); + pInsTypeCombo.clear(); + pASRCheck.clear(); + pCapCheck.clear(); + ModalDialog::dispose(); } IMPL_LINK_NOARG(SdPhotoAlbumDialog, CancelHdl) diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.hxx b/sd/source/ui/dlg/PhotoAlbumDialog.hxx index c7d12e47bcc8..44b1f5c97a1e 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.hxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.hxx @@ -46,25 +46,27 @@ class SdPhotoAlbumDialog : public ModalDialog public: SdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* pActDoc); virtual ~SdPhotoAlbumDialog(); + virtual void dispose() SAL_OVERRIDE; virtual short Execute() SAL_OVERRIDE; private: static OUString sDirUrl; - CancelButton* pCancelBtn; - PushButton* pCreateBtn; + VclPtr<CancelButton> pCancelBtn; + VclPtr<PushButton> pCreateBtn; - PushButton* pAddBtn; - PushButton* pUpBtn; - PushButton* pDownBtn; - PushButton* pRemoveBtn; + VclPtr<PushButton> pAddBtn; + VclPtr<PushButton> pUpBtn; + VclPtr<PushButton> pDownBtn; + VclPtr<PushButton> pRemoveBtn; - ListBox* pImagesLst; - FixedImage* pImg; + VclPtr<ListBox> pImagesLst; + VclPtr<FixedImage> pImg; + + VclPtr<ListBox> pInsTypeCombo; + VclPtr<CheckBox> pASRCheck; + VclPtr<CheckBox> pCapCheck; - ListBox* pInsTypeCombo; - CheckBox* pASRCheck; - CheckBox* pCapCheck; SdDrawDocument* pDoc; GraphicFilter* mpGraphicFilter; diff --git a/sd/source/ui/dlg/RemoteDialog.cxx b/sd/source/ui/dlg/RemoteDialog.cxx index f9cd67cb8dad..625cc04cd7f4 100644 --- a/sd/source/ui/dlg/RemoteDialog.cxx +++ b/sd/source/ui/dlg/RemoteDialog.cxx @@ -30,6 +30,19 @@ RemoteDialog::RemoteDialog( vcl::Window *pWindow ) m_pButtonClose->SetClickHdl( LINK( this, RemoteDialog, CloseHdl ) ); } +RemoteDialog::~RemoteDialog() +{ + dispose(); +} + +void RemoteDialog::dispose() +{ + m_pButtonConnect.clear(); + m_pButtonClose.clear(); + m_pClientBox.clear(); + ModalDialog::dispose(); +} + IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton) { // setBusy( true ); diff --git a/sd/source/ui/dlg/RemoteDialog.hxx b/sd/source/ui/dlg/RemoteDialog.hxx index 7334c4bea548..3c936eb10a1a 100644 --- a/sd/source/ui/dlg/RemoteDialog.hxx +++ b/sd/source/ui/dlg/RemoteDialog.hxx @@ -24,14 +24,16 @@ namespace sd class RemoteDialog : public ModalDialog { private: - PushButton* m_pButtonConnect; - CloseButton* m_pButtonClose; - ClientBox* m_pClientBox; + VclPtr<PushButton> m_pButtonConnect; + VclPtr<CloseButton> m_pButtonClose; + VclPtr<ClientBox> m_pClientBox; DECL_DLLPRIVATE_LINK( HandleConnectButton, void * ); DECL_LINK( CloseHdl, void * ); public: RemoteDialog( vcl::Window* pWindow ); + virtual ~RemoteDialog(); + virtual void dispose() SAL_OVERRIDE; }; } diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.hxx b/sd/source/ui/dlg/RemoteDialogClientBox.hxx index c40ac96212c1..63bf2db5a577 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.hxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.hxx @@ -69,7 +69,7 @@ class ClientBox; class ClientRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener > { - ClientBox *m_pParent; + VclPtr<ClientBox> m_pParent; public: diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index a84cfd9d0ddd..c7bba27e3eab 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -224,8 +224,26 @@ void AnimationWindow::dispose() // delete the clones delete pMyDoc; - delete m_pCtlDisplay; - + m_pCtlDisplay.clear(); + m_pBtnFirst.clear(); + m_pBtnReverse.clear(); + m_pBtnStop.clear(); + m_pBtnPlay.clear(); + m_pBtnLast.clear(); + m_pNumFldBitmap.clear(); + m_pTimeField.clear(); + m_pLbLoopCount.clear(); + m_pBtnGetOneObject.clear(); + m_pBtnGetAllObjects.clear(); + m_pBtnRemoveBitmap.clear(); + m_pBtnRemoveAll.clear(); + m_pFiCount.clear(); + m_pRbtGroup.clear(); + m_pRbtBitmap.clear(); + m_pFtAdjustment.clear(); + m_pLbAdjustment.clear(); + m_pBtnCreateGroup.clear(); + pWin.clear(); SfxDockingWindow::dispose(); } diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx index 92c83eac13c7..bd6cad52decf 100644 --- a/sd/source/ui/dlg/brkdlg.cxx +++ b/sd/source/ui/dlg/brkdlg.cxx @@ -72,8 +72,10 @@ BreakDlg::~BreakDlg() void BreakDlg::dispose() { - delete mpProgress; - delete pProgrInfo; + m_pFiObjInfo.clear(); + m_pFiActInfo.clear(); + m_pFiInsInfo.clear(); + m_pBtnCancel.clear(); SfxModalDialog::dispose(); } diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index a66d6a041807..7fcd27804f12 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -89,31 +89,17 @@ CopyDlg::~CopyDlg() void CopyDlg::dispose() { - OUString& rStr = GetExtraData(); - - rStr = OUString::number(m_pNumFldCopies->GetValue()); - rStr += OUString(TOKEN); - - rStr += OUString::number(m_pMtrFldMoveX->GetValue()); - rStr += OUString( TOKEN ); - - rStr += OUString::number(m_pMtrFldMoveY->GetValue()); - rStr += OUString( TOKEN ); - - rStr += OUString::number(m_pMtrFldAngle->GetValue()); - rStr += OUString( TOKEN ); - - rStr += OUString::number(m_pMtrFldWidth->GetValue()); - rStr += OUString( TOKEN ); - - rStr += OUString::number(m_pMtrFldHeight->GetValue()); - rStr += OUString( TOKEN ); - - rStr += OUString::number( m_pLbStartColor->GetSelectEntryColor().GetColor() ); - rStr += OUString( TOKEN ); - - rStr += OUString::number( m_pLbEndColor->GetSelectEntryColor().GetColor() ); - + m_pNumFldCopies.clear(); + m_pBtnSetViewData.clear(); + m_pMtrFldMoveX.clear(); + m_pMtrFldMoveY.clear(); + m_pMtrFldAngle.clear(); + m_pMtrFldWidth.clear(); + m_pMtrFldHeight.clear(); + m_pLbStartColor.clear(); + m_pFtEndColor.clear(); + m_pLbEndColor.clear(); + m_pBtnSetDefault.clear(); SfxModalDialog::dispose(); } diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 8cfd56d0a583..95132d4c5e4f 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -85,6 +85,21 @@ SdCustomShowDlg::SdCustomShowDlg( vcl::Window* pWindow, SdCustomShowDlg::~SdCustomShowDlg() { + dispose(); +} + +void SdCustomShowDlg::dispose() +{ + m_pLbCustomShows.clear(); + m_pCbxUseCustomShow.clear(); + m_pBtnNew.clear(); + m_pBtnEdit.clear(); + m_pBtnRemove.clear(); + m_pBtnCopy.clear(); + m_pBtnHelp.clear(); + m_pBtnStartShow.clear(); + m_pBtnOK.clear(); + ModalDialog::dispose(); } void SdCustomShowDlg::CheckState() @@ -336,6 +351,20 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow, SdDefineCustomShowDlg::~SdDefineCustomShowDlg() { + dispose(); +} + +void SdDefineCustomShowDlg::dispose() +{ + m_pEdtName.clear(); + m_pLbPages.clear(); + m_pBtnAdd.clear(); + m_pBtnRemove.clear(); + m_pLbCustomPages.clear(); + m_pBtnOK.clear(); + m_pBtnCancel.clear(); + m_pBtnHelp.clear(); + ModalDialog::dispose(); } // CheckState diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 757028a0f4fc..bec74ca9a16f 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -101,8 +101,8 @@ public: void Enable (bool bEnable); private: - PushButton* mpNextButton1; - PushButton* mpNextButton2; + VclPtr<PushButton> mpNextButton1; + VclPtr<PushButton> mpNextButton2; bool mbIsFirstButtonActive; }; @@ -160,7 +160,7 @@ public: */ bool mbPreviewUpdating; - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; void SavePassword( SfxObjectShellLock xDoc, const OUString& rPath ); void RestorePassword( SfxItemSet* pSet, const OUString& rPath ); @@ -247,74 +247,74 @@ public: // Common Assistent maAssistentFunc; - CheckBox* mpPreviewFlag; - CheckBox* mpStartWithFlag; - PushButton* mpLastPageButton; - NextButton* mpNextPageButton; - PushButton* mpFinishButton; - SdDocPreviewWin* mpPreview; - VclContainer* mpPage1235; + VclPtr<CheckBox> mpPreviewFlag; + VclPtr<CheckBox> mpStartWithFlag; + VclPtr<PushButton> mpLastPageButton; + NextButton* mpNextPageButton; + VclPtr<PushButton> mpFinishButton; + VclPtr<SdDocPreviewWin> mpPreview; + VclPtr<VclContainer> mpPage1235; // page 1 - VclContainer* mpPage1; - FixedImage* mpPage1FB; - FixedText* mpPage1ArtFL; - RadioButton* mpPage1EmptyRB; - RadioButton* mpPage1TemplateRB; - ListBox* mpPage1RegionLB; - ListBox* mpPage1TemplateLB; - RadioButton* mpPage1OpenRB; - ListBox* mpPage1OpenLB; - PushButton* mpPage1OpenPB; + VclPtr<VclContainer> mpPage1; + VclPtr<FixedImage> mpPage1FB; + VclPtr<FixedText> mpPage1ArtFL; + VclPtr<RadioButton> mpPage1EmptyRB; + VclPtr<RadioButton> mpPage1TemplateRB; + VclPtr<ListBox> mpPage1RegionLB; + VclPtr<ListBox> mpPage1TemplateLB; + VclPtr<RadioButton> mpPage1OpenRB; + VclPtr<ListBox> mpPage1OpenLB; + VclPtr<PushButton> mpPage1OpenPB; // page 2 - VclContainer* mpPage2; - FixedImage* mpPage2FB; - FixedText* mpPage2LayoutFL; - ListBox* mpPage2RegionLB; - ListBox* mpPage2LayoutLB; - FixedText* mpPage2OutTypesFL; - RadioButton* mpPage2Medium1RB; - RadioButton* mpPage2Medium2RB; - RadioButton* mpPage2Medium3RB; - RadioButton* mpPage2Medium4RB; - RadioButton* mpPage2Medium5RB; - RadioButton* mpPage2Medium6RB; + VclPtr<VclContainer> mpPage2; + VclPtr<FixedImage> mpPage2FB; + VclPtr<FixedText> mpPage2LayoutFL; + VclPtr<ListBox> mpPage2RegionLB; + VclPtr<ListBox> mpPage2LayoutLB; + VclPtr<FixedText> mpPage2OutTypesFL; + VclPtr<RadioButton> mpPage2Medium1RB; + VclPtr<RadioButton> mpPage2Medium2RB; + VclPtr<RadioButton> mpPage2Medium3RB; + VclPtr<RadioButton> mpPage2Medium4RB; + VclPtr<RadioButton> mpPage2Medium5RB; + VclPtr<RadioButton> mpPage2Medium6RB; // page 3 - VclContainer* mpPage3; - FixedImage* mpPage3FB; - FixedText* mpPage3EffectFL; - FixedText* mpPage3EffectFT; - FadeEffectLB* mpPage3EffectLB; - FixedText* mpPage3SpeedFT; - ListBox* mpPage3SpeedLB; - FixedText* mpPage3PresTypeFL; - RadioButton* mpPage3PresTypeLiveRB; - RadioButton* mpPage3PresTypeKioskRB; - FixedText* mpPage3PresTimeFT; - TimeField* mpPage3PresTimeTMF; - FixedText* mpPage3BreakFT; - TimeField* mpPage3BreakTMF; - CheckBox* mpPage3LogoCB; + VclPtr<VclContainer> mpPage3; + VclPtr<FixedImage> mpPage3FB; + VclPtr<FixedText> mpPage3EffectFL; + VclPtr<FixedText> mpPage3EffectFT; + VclPtr<FadeEffectLB> mpPage3EffectLB; + VclPtr<FixedText> mpPage3SpeedFT; + VclPtr<ListBox> mpPage3SpeedLB; + VclPtr<FixedText> mpPage3PresTypeFL; + VclPtr<RadioButton> mpPage3PresTypeLiveRB; + VclPtr<RadioButton> mpPage3PresTypeKioskRB; + VclPtr<FixedText> mpPage3PresTimeFT; + VclPtr<TimeField> mpPage3PresTimeTMF; + VclPtr<FixedText> mpPage3BreakFT; + VclPtr<TimeField> mpPage3BreakTMF; + VclPtr<CheckBox> mpPage3LogoCB; // page 4 - VclContainer* mpPage4; - FixedImage* mpPage4FB; - FixedText* mpPage4PersonalFL; - FixedText* mpPage4AskNameFT; - Edit* mpPage4AskNameEDT; - FixedText* mpPage4AskTopicFT; - Edit* mpPage4AskTopicEDT; - FixedText* mpPage4AskInfoFT; - VclMultiLineEdit* mpPage4AskInfoEDT; + VclPtr<VclContainer> mpPage4; + VclPtr<FixedImage> mpPage4FB; + VclPtr<FixedText> mpPage4PersonalFL; + VclPtr<FixedText> mpPage4AskNameFT; + VclPtr<Edit> mpPage4AskNameEDT; + VclPtr<FixedText> mpPage4AskTopicFT; + VclPtr<Edit> mpPage4AskTopicEDT; + VclPtr<FixedText> mpPage4AskInfoFT; + VclPtr<VclMultiLineEdit> mpPage4AskInfoEDT; // page 5 - VclContainer* mpPage5; - FixedImage* mpPage5FB; - FixedText* mpPage5PageListFT; - SdPageListControl* mpPage5PageListCT; - CheckBox* mpPage5SummaryCB; + VclPtr<VclContainer> mpPage5; + VclPtr<FixedImage> mpPage5FB; + VclPtr<FixedText> mpPage5PageListFT; + VclPtr<SdPageListControl> mpPage5PageListCT; + VclPtr<CheckBox> mpPage5SummaryCB; }; diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index 64e4d476baa7..e236cd133048 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -53,6 +53,21 @@ SdModifyFieldDlg::SdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pI FillControls(); } +SdModifyFieldDlg::~SdModifyFieldDlg() +{ + dispose(); +} + +void SdModifyFieldDlg::dispose() +{ + m_pRbtFix.clear(); + m_pRbtVar.clear(); + m_pLbLanguage.clear(); + m_pLbFormat.clear(); + ModalDialog::dispose(); +} + + /** * Returns the new field, owned by caller. * Returns NULL if nothing has changed. diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index 07d6e2c2886d..2e590fa9a8cf 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -111,6 +111,25 @@ SdSnapLineDlg::SdSnapLineDlg( m_pRbPoint->Check(); } +SdSnapLineDlg::~SdSnapLineDlg() +{ + dispose(); +} + +void SdSnapLineDlg::dispose() +{ + m_pFtX.clear(); + m_pMtrFldX.clear(); + m_pFtY.clear(); + m_pMtrFldY.clear(); + m_pRadioGroup.clear(); + m_pRbPoint.clear(); + m_pRbVert.clear(); + m_pRbHorz.clear(); + m_pBtnDelete.clear(); + ModalDialog::dispose(); +} + /** * fills provided item sets with dialog box attributes */ diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index b7c95485fff2..f2ea08902841 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -115,29 +115,29 @@ class HeaderFooterTabPage : public TabPage { private: - FixedText* mpFTIncludeOn; + VclPtr<FixedText> mpFTIncludeOn; - CheckBox* mpCBHeader; - VclContainer* mpHeaderBox; - Edit* mpTBHeader; + VclPtr<CheckBox> mpCBHeader; + VclPtr<VclContainer> mpHeaderBox; + VclPtr<Edit> mpTBHeader; - CheckBox* mpCBDateTime; - RadioButton* mpRBDateTimeFixed; - RadioButton* mpRBDateTimeAutomatic; - Edit* mpTBDateTimeFixed; - ListBox* mpCBDateTimeFormat; - FixedText* mpFTDateTimeLanguage; - SvxLanguageBox* mpCBDateTimeLanguage; + VclPtr<CheckBox> mpCBDateTime; + VclPtr<RadioButton> mpRBDateTimeFixed; + VclPtr<RadioButton> mpRBDateTimeAutomatic; + VclPtr<Edit> mpTBDateTimeFixed; + VclPtr<ListBox> mpCBDateTimeFormat; + VclPtr<FixedText> mpFTDateTimeLanguage; + VclPtr<SvxLanguageBox> mpCBDateTimeLanguage; - CheckBox* mpCBFooter; - VclContainer* mpFooterBox; - Edit* mpTBFooter; + VclPtr<CheckBox> mpCBFooter; + VclPtr<VclContainer> mpFooterBox; + VclPtr<Edit> mpTBFooter; - CheckBox* mpCBSlideNumber; + VclPtr<CheckBox> mpCBSlideNumber; - CheckBox* mpCBNotOnTitle; + VclPtr<CheckBox> mpCBNotOnTitle; - PresLayoutPreview* mpCTPreview; + VclPtr<PresLayoutPreview> mpCTPreview; SdDrawDocument* mpDoc; LanguageType meOldLanguage; @@ -155,6 +155,7 @@ private: public: HeaderFooterTabPage( vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pActualPage, bool bHandoutMode ); virtual ~HeaderFooterTabPage(); + virtual void dispose() SAL_OVERRIDE; void init( const HeaderFooterSettings& rSettings, bool bNotOnTitle ); void getData( HeaderFooterSettings& rSettings, bool& rNotOnTitle ); @@ -245,8 +246,12 @@ HeaderFooterDialog::~HeaderFooterDialog() void HeaderFooterDialog::dispose() { - delete mpSlideTabPage; - delete mpNotesHandoutsTabPage; + mpSlideTabPage.clear(); + mpNotesHandoutsTabPage.clear(); + mpTabCtrl.clear(); + maPBApplyToAll.clear(); + maPBApply.clear(); + maPBCancel.clear(); TabDialog::dispose(); } @@ -457,6 +462,29 @@ HeaderFooterTabPage::HeaderFooterTabPage( vcl::Window* pWindow, SdDrawDocument* HeaderFooterTabPage::~HeaderFooterTabPage() { + dispose(); +} + +void HeaderFooterTabPage::dispose() +{ + mpFTIncludeOn.clear(); + mpCBHeader.clear(); + mpHeaderBox.clear(); + mpTBHeader.clear(); + mpCBDateTime.clear(); + mpRBDateTimeFixed.clear(); + mpRBDateTimeAutomatic.clear(); + mpTBDateTimeFixed.clear(); + mpCBDateTimeFormat.clear(); + mpFTDateTimeLanguage.clear(); + mpCBDateTimeLanguage.clear(); + mpCBFooter.clear(); + mpFooterBox.clear(); + mpTBFooter.clear(); + mpCBSlideNumber.clear(); + mpCBNotOnTitle.clear(); + mpCTPreview.clear(); + TabPage::dispose(); } IMPL_LINK_NOARG(HeaderFooterTabPage, LanguageChangeHdl) diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx index a256990697e0..833b471d140a 100644 --- a/sd/source/ui/dlg/ins_paste.cxx +++ b/sd/source/ui/dlg/ins_paste.cxx @@ -28,6 +28,18 @@ SdInsertPasteDlg::SdInsertPasteDlg(vcl::Window* pWindow) m_pRbAfter->Check( true ); } +SdInsertPasteDlg::~SdInsertPasteDlg() +{ + dispose(); +} + +void SdInsertPasteDlg::dispose() +{ + m_pRbBefore.clear(); + m_pRbAfter.clear(); + ModalDialog::dispose(); +} + bool SdInsertPasteDlg::IsInsertBefore() const { return( m_pRbBefore->IsChecked() ); diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx index 5593562947c1..0d5e29c1c6ce 100644 --- a/sd/source/ui/dlg/inspagob.cxx +++ b/sd/source/ui/dlg/inspagob.cxx @@ -55,6 +55,15 @@ SdInsertPagesObjsDlg::SdInsertPagesObjsDlg( SdInsertPagesObjsDlg::~SdInsertPagesObjsDlg() { + dispose(); +} + +void SdInsertPagesObjsDlg::dispose() +{ + m_pLbTree.clear(); + m_pCbxLink.clear(); + m_pCbxMasters.clear(); + ModalDialog::dispose(); } /** diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx index 86df27c22cb1..12b3e4d1aa9c 100644 --- a/sd/source/ui/dlg/layeroptionsdlg.cxx +++ b/sd/source/ui/dlg/layeroptionsdlg.cxx @@ -50,6 +50,22 @@ SdInsertLayerDlg::SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInA get<VclContainer>("nameframe")->Enable(bDeletable); } +SdInsertLayerDlg::~SdInsertLayerDlg() +{ + dispose(); +} + +void SdInsertLayerDlg::dispose() +{ + m_pEdtName.clear(); + m_pEdtTitle.clear(); + m_pEdtDesc.clear(); + m_pCbxVisible.clear(); + m_pCbxPrintable.clear(); + m_pCbxLocked.clear(); + ModalDialog::dispose(); +} + void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs ) { rAttrs.Put( SdAttrLayerName( m_pEdtName->GetText() ) ); diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx index d10f8224ad8b..898ca5b2e4eb 100644 --- a/sd/source/ui/dlg/masterlayoutdlg.cxx +++ b/sd/source/ui/dlg/masterlayoutdlg.cxx @@ -75,6 +75,21 @@ MasterLayoutDialog::MasterLayoutDialog( vcl::Window* pParent, SdDrawDocument* pD mpCBPageNumber->Check( mbOldPageNumber ); } +MasterLayoutDialog::~MasterLayoutDialog() +{ + dispose(); +} + +void MasterLayoutDialog::dispose() +{ + mpCBDate.clear(); + mpCBPageNumber.clear(); + mpCBSlideNumber.clear(); + mpCBHeader.clear(); + mpCBFooter.clear(); + ModalDialog::dispose(); +} + short MasterLayoutDialog::Execute() { if ( ModalDialog::Execute() ) diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index d21de6f97c27..8ea2b1856965 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -66,6 +66,15 @@ MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObjec MorphDlg::~MorphDlg() { + dispose(); +} + +void MorphDlg::dispose() +{ + m_pMtfSteps.clear(); + m_pCbxAttributes.clear(); + m_pCbxOrientation.clear(); + ModalDialog::dispose(); } void MorphDlg::LoadSettings() diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index 53fb0adb873e..6714cb0ba55e 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -39,6 +39,7 @@ class SdParagraphNumTabPage : public SfxTabPage public: SdParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet ); virtual ~SdParagraphNumTabPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges(); @@ -47,9 +48,9 @@ public: virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; private: - TriStateBox* m_pNewStartCB; - TriStateBox* m_pNewStartNumberCB; - NumericField* m_pNewStartNF; + VclPtr<TriStateBox> m_pNewStartCB; + VclPtr<TriStateBox> m_pNewStartNumberCB; + VclPtr<NumericField> m_pNewStartNF; bool mbModified; DECL_LINK( ImplNewStartHdl, void* ); @@ -72,6 +73,15 @@ SdParagraphNumTabPage::SdParagraphNumTabPage(vcl::Window* pParent, const SfxItem SdParagraphNumTabPage::~SdParagraphNumTabPage() { + dispose(); +} + +void SdParagraphNumTabPage::dispose() +{ + m_pNewStartCB.clear(); + m_pNewStartNumberCB.clear(); + m_pNewStartNF.clear(); + SfxTabPage::dispose(); } SfxTabPage* SdParagraphNumTabPage::Create(vcl::Window *pParent, const SfxItemSet * rAttrSet) diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index c4b95a9d2458..72d30c31b6c1 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -150,6 +150,39 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow, ChangePauseHdl( NULL ); } +SdStartPresentationDlg::~SdStartPresentationDlg() +{ + dispose(); +} + +void SdStartPresentationDlg::dispose() +{ + aRbtAll.clear(); + aRbtAtDia.clear(); + aRbtCustomshow.clear(); + aLbDias.clear(); + aLbCustomshow.clear(); + aRbtStandard.clear(); + aRbtWindow.clear(); + aRbtAuto.clear(); + aTmfPause.clear(); + aCbxAutoLogo.clear(); + aCbxManuel.clear(); + aCbxMousepointer.clear(); + aCbxPen.clear(); + aCbxNavigator.clear(); + aCbxAnimationAllowed.clear(); + aCbxChangePage.clear(); + aCbxAlwaysOnTop.clear(); + maFtMonitor.clear(); + maLBMonitor.clear(); + msMonitor.clear(); + msAllMonitors.clear(); + msMonitorExternal.clear(); + msExternal.clear(); + ModalDialog::dispose(); +} + OUString SdStartPresentationDlg::GetDisplayName( sal_Int32 nDisplay, DisplayType eType ) { diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx index 943144be7a53..b9cdc6e06ce7 100644 --- a/sd/source/ui/dlg/prntopts.cxx +++ b/sd/source/ui/dlg/prntopts.cxx @@ -30,7 +30,7 @@ */ SdPrintOptions::SdPrintOptions( vcl::Window* pParent, const SfxItemSet& rInAttrs ) : SfxTabPage ( pParent, "prntopts" , "modules/simpress/ui/prntopts.ui" , &rInAttrs ), - rOutAttrs ( rInAttrs ) + rOutAttrs ( rInAttrs ) { get( m_pFrmContent , "contentframe" ); get( m_pCbxDraw , "drawingcb" ); @@ -74,6 +74,31 @@ SdPrintOptions::SdPrintOptions( vcl::Window* pParent, const SfxItemSet& rInAttrs SdPrintOptions::~SdPrintOptions() { + dispose(); +} + +void SdPrintOptions::dispose() +{ + m_pFrmContent.clear(); + m_pCbxDraw.clear(); + m_pCbxNotes.clear(); + m_pCbxHandout.clear(); + m_pCbxOutline.clear(); + m_pRbtColor.clear(); + m_pRbtGrayscale.clear(); + m_pRbtBlackWhite.clear(); + m_pCbxPagename.clear(); + m_pCbxDate.clear(); + m_pCbxTime.clear(); + m_pCbxHiddenPages.clear(); + m_pRbtDefault.clear(); + m_pRbtPagesize.clear(); + m_pRbtPagetile.clear(); + m_pRbtBooklet.clear(); + m_pCbxFront.clear(); + m_pCbxBack.clear(); + m_pCbxPaperbin.clear(); + SfxTabPage::dispose(); } bool SdPrintOptions::FillItemSet( SfxItemSet* rAttrs ) diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 8e5c87a381d3..3e4c4a9a4155 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -121,37 +121,37 @@ OUString SdAbstractTabDialog_Impl::GetText() const void AbstractBulletDialog_Impl::SetCurPageId( sal_uInt16 nId ) { - static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetCurPageId( nId ); + static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetCurPageId( nId ); } void AbstractBulletDialog_Impl::SetCurPageId( const OString& rName ) { - static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetCurPageId( rName ); + static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetCurPageId( rName ); } const SfxItemSet* AbstractBulletDialog_Impl::GetOutputItemSet() const { - return static_cast< ::sd::OutlineBulletDlg*>(pDlg)->GetOutputItemSet(); + return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetOutputItemSet(); } const sal_uInt16* AbstractBulletDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) { - return static_cast< ::sd::OutlineBulletDlg*>(pDlg)->GetInputRanges( pItem ); + return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetInputRanges( pItem ); } void AbstractBulletDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) { - static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetInputSet( pInSet ); + static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetInputSet( pInSet ); } void AbstractBulletDialog_Impl::SetText( const OUString& rStr ) { - static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetText( rStr ); + static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetText( rStr ); } OUString AbstractBulletDialog_Impl::GetText() const { - return static_cast< ::sd::OutlineBulletDlg*>(pDlg)->GetText(); + return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetText(); } void SdPresLayoutTemplateDlg_Impl::SetCurPageId( sal_uInt16 nId ) diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 38d6d1e4c1e7..b7fe5347e91a 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -23,7 +23,7 @@ #include <sfx2/basedlgs.hxx> #define DECL_ABSTDLG_BASE(Class,DialogClass) \ - DialogClass* pDlg; \ + VclPtr<DialogClass> pDlg; \ public: \ Class( DialogClass* p) \ : pDlg(p) \ @@ -34,7 +34,6 @@ public: \ #define IMPL_ABSTDLG_BASE(Class) \ Class::~Class() \ { \ - delete pDlg; \ } \ short Class::Execute() \ { \ diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 21d8a89afb6f..6c9691affc69 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -55,6 +55,16 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* pDocShell, SdPresLayoutDlg::~SdPresLayoutDlg() { + dispose(); +} + +void SdPresLayoutDlg::dispose() +{ + m_pVS.clear(); + m_pCbxMasterPage.clear(); + m_pCbxCheckMasters.clear(); + m_pBtnLoad.clear(); + ModalDialog::dispose(); } /** diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 184cc15081d8..e7473b16e39a 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -265,6 +265,8 @@ void SdPageObjsTLB::dispose() else // no document was created from mpMedium, so this object is still the owner of it delete mpMedium; + mpParent.clear(); + mpDropNavWin.clear(); SvTreeListBox::dispose(); } @@ -1349,7 +1351,7 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt ) OUString aFile; if( aDataHelper.GetString( SotClipboardFormatId::SIMPLE_FILE, aFile ) && - static_cast<SdNavigatorWin*>(mpParent)->InsertFile( aFile ) ) + static_cast<SdNavigatorWin*>(mpParent.get())->InsertFile( aFile ) ) { nRet = rEvt.mnAction; } diff --git a/sd/source/ui/dlg/sduiexp.cxx b/sd/source/ui/dlg/sduiexp.cxx index 3c526380a538..84127950fcd2 100644 --- a/sd/source/ui/dlg/sduiexp.cxx +++ b/sd/source/ui/dlg/sduiexp.cxx @@ -18,6 +18,21 @@ */ #include "sddlgfact.hxx" +#include "morphdlg.hxx" +#include "present.hxx" +#include "inspagob.hxx" +#include "vectdlg.hxx" +#include "sdpreslt.hxx" +#include "headerfooterdlg.hxx" +#include "pubdlg.hxx" +#include "ins_paste.hxx" +#include "layeroptionsdlg.hxx" +#include "dlgsnap.hxx" +#include "dlgfield.hxx" +#include "dlgass.hxx" +#include "prltempl.hxx" +#include "custsdlg.hxx" +#include "copydlg.hxx" #include "sal/types.h" extern "C" diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 521a9c64bcb7..f4ae36271b57 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -142,6 +142,25 @@ SdTPAction::SdTPAction(vcl::Window* pWindow, const SfxItemSet& rInAttrs) SdTPAction::~SdTPAction() { + dispose(); +} + +void SdTPAction::dispose() +{ + m_pLbAction.clear(); + m_pFtTree.clear(); + m_pLbTree.clear(); + m_pLbTreeDocument.clear(); + m_pLbOLEAction.clear(); + m_pFrame.clear(); + m_pEdtSound.clear(); + m_pEdtBookmark.clear(); + m_pEdtDocument.clear(); + m_pEdtProgram.clear(); + m_pEdtMacro.clear(); + m_pBtnSearch.clear(); + m_pBtnSeek.clear(); + SfxTabPage::dispose(); } void SdTPAction::SetView( const ::sd::View* pSdView ) diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 6383700d0bb7..eefac3577a77 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -122,6 +122,16 @@ SdTpOptionsContents::SdTpOptionsContents( vcl::Window* pParent, const SfxItemSet SdTpOptionsContents::~SdTpOptionsContents() { + dispose(); +} + +void SdTpOptionsContents::dispose() +{ + m_pCbxRuler.clear(); + m_pCbxDragStripes.clear(); + m_pCbxHandlesBezier.clear(); + m_pCbxMoveOutline.clear(); + SfxTabPage::dispose(); } bool SdTpOptionsContents::FillItemSet( SfxItemSet* rAttrs ) @@ -276,6 +286,38 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr SdTpOptionsMisc::~SdTpOptionsMisc() { + dispose(); +} + +void SdTpOptionsMisc::dispose() +{ + m_pCbxQuickEdit.clear(); + m_pCbxPickThrough.clear(); + m_pNewDocumentFrame.clear(); + m_pCbxStartWithTemplate.clear(); + m_pCbxMasterPageCache.clear(); + m_pCbxCopy.clear(); + m_pCbxMarkedHitMovesAlways.clear(); + m_pPresentationFrame.clear(); + m_pLbMetric.clear(); + m_pMtrFldTabstop.clear(); + m_pCbxEnableSdremote.clear(); + m_pCbxEnablePresenterScreen.clear(); + m_pCbxUsePrinterMetrics.clear(); + m_pCbxCompatibility.clear(); + m_pScaleFrame.clear(); + m_pCbScale.clear(); + m_pNewDocLb.clear(); + m_pFiInfo1.clear(); + m_pMtrFldOriginalWidth.clear(); + m_pWidthLb.clear(); + m_pHeightLb.clear(); + m_pFiInfo2.clear(); + m_pMtrFldOriginalHeight.clear(); + m_pCbxDistrot.clear(); + m_pMtrFldInfo1.clear(); + m_pMtrFldInfo2.clear(); + SfxTabPage::dispose(); } void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet ) diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 71d6ed9dd558..99f86cb9d239 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -72,6 +72,22 @@ SdVectorizeDlg::SdVectorizeDlg(vcl::Window* pParent, const Bitmap& rBmp, ::sd::D SdVectorizeDlg::~SdVectorizeDlg() { + dispose(); +} + +void SdVectorizeDlg::dispose() +{ + m_pNmLayers.clear(); + m_pMtReduce.clear(); + m_pFtFillHoles.clear(); + m_pMtFillHoles.clear(); + m_pCbFillHoles.clear(); + m_pBmpWin.clear(); + m_pMtfWin.clear(); + m_pPrgs.clear(); + m_pBtnOK.clear(); + m_pBtnPreview.clear(); + ModalDialog::dispose(); } Rectangle SdVectorizeDlg::GetRect( const Size& rDispSize, const Size& rBmpSize ) const diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx index 7e6da77b9cbf..d0c0766588ea 100644 --- a/sd/source/ui/framework/factories/ChildWindowPane.cxx +++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx @@ -188,7 +188,7 @@ void SAL_CALL ChildWindowPane::disposing (void) Reference<awt::XWindow> SAL_CALL ChildWindowPane::getWindow (void) throw (RuntimeException, std::exception) { - if (mpWindow == NULL || ! mxWindow.is()) + if (mpWindow == nullptr || ! mxWindow.is()) GetWindow(); return Pane::getWindow(); } diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index ae8698c4f503..ba1a0131734c 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -103,11 +103,7 @@ FullScreenPane::~FullScreenPane (void) throw() void SAL_CALL FullScreenPane::disposing (void) { - // We have created the window pointed to by mpWindow, we delete it. - if (mpWindow != NULL) - { - delete mpWindow; - } + mpWindow.clear(); if (mpWorkWindow.get() != NULL) { @@ -126,7 +122,7 @@ sal_Bool SAL_CALL FullScreenPane::isVisible (void) { ThrowIfDisposed(); - if (mpWindow != NULL) + if (mpWindow != nullptr) return mpWindow->IsReallyVisible(); else return false; @@ -137,7 +133,7 @@ void SAL_CALL FullScreenPane::setVisible (const sal_Bool bIsVisible) { ThrowIfDisposed(); - if (mpWindow != NULL) + if (mpWindow != nullptr) mpWindow->Show(bIsVisible); if (mpWorkWindow != 0) mpWorkWindow->Show(bIsVisible); @@ -160,7 +156,7 @@ void SAL_CALL FullScreenPane::setAccessible ( { ThrowIfDisposed(); - if (mpWindow != NULL) + if (mpWindow != nullptr) { Reference<lang::XInitialization> xInitializable (rxAccessible, UNO_QUERY); if (xInitializable.is()) diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx index 978cb870f8ec..9a9f04dfaf41 100644 --- a/sd/source/ui/framework/factories/Pane.cxx +++ b/sd/source/ui/framework/factories/Pane.cxx @@ -175,7 +175,7 @@ Reference<rendering::XCanvas> Pane::CreateCanvas (void) { Reference<rendering::XCanvas> xCanvas; - if (mpWindow != NULL) + if (mpWindow != nullptr) { ::cppcanvas::SpriteCanvasSharedPtr pCanvas ( ::cppcanvas::VCLFactory::getInstance().createSpriteCanvas(*mpWindow)); diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index f1db1952db29..f3d94ef85579 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -101,9 +101,6 @@ FuPoor::~FuPoor() aDragTimer.Stop(); aScrollTimer.Stop(); aDelayToScrollTimer.Stop (); - - if (pDialog) - delete pDialog; } void FuPoor::Activate() @@ -130,6 +127,11 @@ void FuPoor::Deactivate() if (mpWindow) mpWindow->ReleaseMouse (); } +void FuPoor::SetWindow(::sd::Window* pWin) +{ + mpWindow = pWin; +} + /** * scroll when approached the border of the window; is called by MouseMove */ diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx index 16241381f83f..af4c95012e63 100644 --- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx +++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx @@ -278,7 +278,7 @@ private: protected: /// The core window that is made accessible. - ::sd::Window* mpWindow; + VclPtr<::sd::Window> mpWindow; /// The API window that is made accessible. ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> diff --git a/sd/source/ui/inc/AccessibleSlideSorterView.hxx b/sd/source/ui/inc/AccessibleSlideSorterView.hxx index 99affbe53d99..070bd303bd2d 100644 --- a/sd/source/ui/inc/AccessibleSlideSorterView.hxx +++ b/sd/source/ui/inc/AccessibleSlideSorterView.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/awt/XFocusListener.hpp> #include <com/sun/star/document/XEventListener.hpp> +#include <vcl/vclptr.hxx> #include <memory> @@ -297,7 +298,7 @@ private: sal_uInt32 mnClientId; - vcl::Window* mpContentWindow; + VclPtr<vcl::Window> mpContentWindow; /** Check whether or not the object has been disposed (or is in the state of being disposed). If that is the case then diff --git a/sd/source/ui/inc/BreakDlg.hxx b/sd/source/ui/inc/BreakDlg.hxx index 13aab79c025b..40c650c5ee7f 100644 --- a/sd/source/ui/inc/BreakDlg.hxx +++ b/sd/source/ui/inc/BreakDlg.hxx @@ -58,10 +58,10 @@ public: short Execute() SAL_OVERRIDE; private: - FixedText* m_pFiObjInfo; - FixedText* m_pFiActInfo; - FixedText* m_pFiInsInfo; - CancelButton* m_pBtnCancel; + VclPtr<FixedText> m_pFiObjInfo; + VclPtr<FixedText> m_pFiActInfo; + VclPtr<FixedText> m_pFiInsInfo; + VclPtr<CancelButton> m_pBtnCancel; DrawView* pDrView; diff --git a/sd/source/ui/inc/FormShellManager.hxx b/sd/source/ui/inc/FormShellManager.hxx index 0168800353ca..1e1e104a758f 100644 --- a/sd/source/ui/inc/FormShellManager.hxx +++ b/sd/source/ui/inc/FormShellManager.hxx @@ -24,6 +24,7 @@ #include <tools/link.hxx> #include <svl/lstner.hxx> +#include <vcl/vclptr.hxx> class VclWindowEvent; class FmFormShell; @@ -89,7 +90,7 @@ private: bool mbIsMainViewChangePending; - vcl::Window* mpMainViewShellWindow; + VclPtr<vcl::Window> mpMainViewShellWindow; /** Register at window of center pane and at the form shell that represents the form tool bar. The former informs this manager about diff --git a/sd/source/ui/inc/Ruler.hxx b/sd/source/ui/inc/Ruler.hxx index 5ca70571aa6b..efaa152061b4 100644 --- a/sd/source/ui/inc/Ruler.hxx +++ b/sd/source/ui/inc/Ruler.hxx @@ -50,7 +50,7 @@ public: using ::Ruler::SetNullOffset; protected: ::sd::View* pSdView; - ::sd::Window* pSdWin; + VclPtr<::sd::Window> pSdWin; DrawViewShell* pDrViewShell; RulerCtrlItem* pCtrlItem; bool bHorz; diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 93bb0f9485e2..f0f643e40946 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -484,7 +484,7 @@ protected: bool mbHasRulers; /// The active window. - ::sd::Window* mpActiveWindow; + VclPtr<::sd::Window> mpActiveWindow; ::sd::View* mpView; FrameView* mpFrameView; @@ -568,7 +568,7 @@ protected: void doShow(); private: - ::vcl::Window* mpParentWindow; + VclPtr<::vcl::Window> mpParentWindow; /** This window updater is used to keep all relevant windows up to date with reference to the digit language used to display digits in text shapes. diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx index 9e81c7645184..9586e61298d7 100644 --- a/sd/source/ui/inc/Window.hxx +++ b/sd/source/ui/inc/Window.hxx @@ -150,7 +150,7 @@ public: void DropScroll (const Point& rMousePos); virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE; protected: - ::sd::Window* mpShareWin; + VclPtr<::sd::Window> mpShareWin; Point maWinPos; Point maViewOrigin; Size maViewSize; diff --git a/sd/source/ui/inc/WindowUpdater.hxx b/sd/source/ui/inc/WindowUpdater.hxx index b35c73c82a0c..5f7c5c978cc7 100644 --- a/sd/source/ui/inc/WindowUpdater.hxx +++ b/sd/source/ui/inc/WindowUpdater.hxx @@ -22,6 +22,7 @@ #include <svl/lstner.hxx> #include <svl/ctloptions.hxx> +#include <vcl/vclptr.hxx> #include "sddllapi.h" #include <vector> @@ -120,7 +121,7 @@ private: /** Type and data member for a list of devices that have to be kept up-to-date. */ - typedef ::std::vector< vcl::Window*> tWindowList; + typedef ::std::vector< VclPtr<vcl::Window> > tWindowList; tWindowList maWindowList; /** The central method of this class. Update the given output device. diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx index 24ec9e859dd4..20f3ffeccddd 100644 --- a/sd/source/ui/inc/animobjs.hxx +++ b/sd/source/ui/inc/animobjs.hxx @@ -98,28 +98,28 @@ protected: virtual void FillInfo( SfxChildWinInfo& ) const SAL_OVERRIDE; private: - SdDisplay* m_pCtlDisplay; - PushButton* m_pBtnFirst; - PushButton* m_pBtnReverse; - PushButton* m_pBtnStop; - PushButton* m_pBtnPlay; - PushButton* m_pBtnLast; - NumericField* m_pNumFldBitmap; - TimeField* m_pTimeField; - ListBox* m_pLbLoopCount; - PushButton* m_pBtnGetOneObject; - PushButton* m_pBtnGetAllObjects; - PushButton* m_pBtnRemoveBitmap; - PushButton* m_pBtnRemoveAll; - FixedText* m_pFiCount; - - RadioButton* m_pRbtGroup; - RadioButton* m_pRbtBitmap; - FixedText* m_pFtAdjustment; - ListBox* m_pLbAdjustment; - PushButton* m_pBtnCreateGroup; - - vcl::Window* pWin; + VclPtr<SdDisplay> m_pCtlDisplay; + VclPtr<PushButton> m_pBtnFirst; + VclPtr<PushButton> m_pBtnReverse; + VclPtr<PushButton> m_pBtnStop; + VclPtr<PushButton> m_pBtnPlay; + VclPtr<PushButton> m_pBtnLast; + VclPtr<NumericField> m_pNumFldBitmap; + VclPtr<TimeField> m_pTimeField; + VclPtr<ListBox> m_pLbLoopCount; + VclPtr<PushButton> m_pBtnGetOneObject; + VclPtr<PushButton> m_pBtnGetAllObjects; + VclPtr<PushButton> m_pBtnRemoveBitmap; + VclPtr<PushButton> m_pBtnRemoveAll; + VclPtr<FixedText> m_pFiCount; + + VclPtr<RadioButton> m_pRbtGroup; + VclPtr<RadioButton> m_pRbtBitmap; + VclPtr<FixedText> m_pFtAdjustment; + VclPtr<ListBox> m_pLbAdjustment; + VclPtr<PushButton> m_pBtnCreateGroup; + + VclPtr<vcl::Window> pWin; ::std::vector< ::std::pair<BitmapEx*, ::tools::Time*> > m_FrameList; static const size_t EMPTY_FRAMELIST; size_t m_nCurrentFrame; @@ -164,7 +164,7 @@ protected: virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE; private: - AnimationWindow* pAnimationWin; + VclPtr<AnimationWindow> pAnimationWin; }; } // end of namespace sd diff --git a/sd/source/ui/inc/copydlg.hxx b/sd/source/ui/inc/copydlg.hxx index e0d1237218c4..1da44c927a6c 100644 --- a/sd/source/ui/inc/copydlg.hxx +++ b/sd/source/ui/inc/copydlg.hxx @@ -48,21 +48,21 @@ public: void Reset(); private: - NumericField* m_pNumFldCopies; - Button* m_pBtnSetViewData; + VclPtr<NumericField> m_pNumFldCopies; + VclPtr<Button> m_pBtnSetViewData; - MetricField* m_pMtrFldMoveX; - MetricField* m_pMtrFldMoveY; - MetricField* m_pMtrFldAngle; + VclPtr<MetricField> m_pMtrFldMoveX; + VclPtr<MetricField> m_pMtrFldMoveY; + VclPtr<MetricField> m_pMtrFldAngle; - MetricField* m_pMtrFldWidth; - MetricField* m_pMtrFldHeight; + VclPtr<MetricField> m_pMtrFldWidth; + VclPtr<MetricField> m_pMtrFldHeight; - ColorLB* m_pLbStartColor; - FixedText* m_pFtEndColor; - ColorLB* m_pLbEndColor; + VclPtr<ColorLB> m_pLbStartColor; + VclPtr<FixedText> m_pFtEndColor; + VclPtr<ColorLB> m_pLbEndColor; - PushButton* m_pBtnSetDefault; + VclPtr<PushButton> m_pBtnSetDefault; const SfxItemSet& mrOutAttrs; XColorListRef mpColorList; diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx index 54f1cfe6b73b..4fcbc7d54c75 100644 --- a/sd/source/ui/inc/custsdlg.hxx +++ b/sd/source/ui/inc/custsdlg.hxx @@ -34,15 +34,15 @@ class SdCustomShowList; class SdCustomShowDlg : public ModalDialog { private: - ListBox* m_pLbCustomShows; - CheckBox* m_pCbxUseCustomShow; - PushButton* m_pBtnNew; - PushButton* m_pBtnEdit; - PushButton* m_pBtnRemove; - PushButton* m_pBtnCopy; - HelpButton* m_pBtnHelp; - PushButton* m_pBtnStartShow; - OKButton* m_pBtnOK; + VclPtr<ListBox> m_pLbCustomShows; + VclPtr<CheckBox> m_pCbxUseCustomShow; + VclPtr<PushButton> m_pBtnNew; + VclPtr<PushButton> m_pBtnEdit; + VclPtr<PushButton> m_pBtnRemove; + VclPtr<PushButton> m_pBtnCopy; + VclPtr<HelpButton> m_pBtnHelp; + VclPtr<PushButton> m_pBtnStartShow; + VclPtr<OKButton> m_pBtnOK; SdDrawDocument& rDoc; SdCustomShowList* pCustomShowList; @@ -57,22 +57,22 @@ private: public: SdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc ); virtual ~SdCustomShowDlg(); - - bool IsModified() const { return bModified; } - bool IsCustomShow() const; + virtual void dispose() SAL_OVERRIDE; + bool IsModified() const { return bModified; } + bool IsCustomShow() const; }; class SdDefineCustomShowDlg : public ModalDialog { private: - Edit* m_pEdtName; - ListBox* m_pLbPages; - PushButton* m_pBtnAdd; - PushButton* m_pBtnRemove; - SvTreeListBox* m_pLbCustomPages; - OKButton* m_pBtnOK; - CancelButton* m_pBtnCancel; - HelpButton* m_pBtnHelp; + VclPtr<Edit> m_pEdtName; + VclPtr<ListBox> m_pLbPages; + VclPtr<PushButton> m_pBtnAdd; + VclPtr<PushButton> m_pBtnRemove; + VclPtr<SvTreeListBox> m_pLbCustomPages; + VclPtr<OKButton> m_pBtnOK; + VclPtr<CancelButton> m_pBtnCancel; + VclPtr<HelpButton> m_pBtnHelp; SdDrawDocument& rDoc; SdCustomShow*& rpCustomShow; @@ -90,6 +90,7 @@ public: SdDefineCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc, SdCustomShow*& rpCS ); virtual ~SdDefineCustomShowDlg(); + virtual void dispose() SAL_OVERRIDE; bool IsModified() const { return bModified; } }; diff --git a/sd/source/ui/inc/dlgfield.hxx b/sd/source/ui/inc/dlgfield.hxx index b458b8df84b9..fe11b0768b45 100644 --- a/sd/source/ui/inc/dlgfield.hxx +++ b/sd/source/ui/inc/dlgfield.hxx @@ -34,10 +34,10 @@ class SvxFieldData; class SdModifyFieldDlg : public ModalDialog { private: - RadioButton* m_pRbtFix; - RadioButton* m_pRbtVar; - SvxLanguageBox* m_pLbLanguage; - ListBox* m_pLbFormat; + VclPtr<RadioButton> m_pRbtFix; + VclPtr<RadioButton> m_pRbtVar; + VclPtr<SvxLanguageBox> m_pLbLanguage; + VclPtr<ListBox> m_pLbFormat; SfxItemSet maInputSet; const SvxFieldData* pField; @@ -49,7 +49,8 @@ private: public: SdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet ); - virtual ~SdModifyFieldDlg() {} + virtual ~SdModifyFieldDlg(); + virtual void dispose() SAL_OVERRIDE; SvxFieldData* GetField(); SfxItemSet GetItemSet(); diff --git a/sd/source/ui/inc/dlgsnap.hxx b/sd/source/ui/inc/dlgsnap.hxx index ab431c856be3..f17a7c5c3413 100644 --- a/sd/source/ui/inc/dlgsnap.hxx +++ b/sd/source/ui/inc/dlgsnap.hxx @@ -41,15 +41,15 @@ namespace sd { class SdSnapLineDlg : public ModalDialog { private: - FixedText* m_pFtX; - MetricField* m_pMtrFldX; - FixedText* m_pFtY; - MetricField* m_pMtrFldY; - VclContainer* m_pRadioGroup; - RadioButton* m_pRbPoint; - RadioButton* m_pRbVert; - RadioButton* m_pRbHorz; - PushButton* m_pBtnDelete; + VclPtr<FixedText> m_pFtX; + VclPtr<MetricField> m_pMtrFldX; + VclPtr<FixedText> m_pFtY; + VclPtr<MetricField> m_pMtrFldY; + VclPtr<VclContainer> m_pRadioGroup; + VclPtr<RadioButton> m_pRbPoint; + VclPtr<RadioButton> m_pRbVert; + VclPtr<RadioButton> m_pRbHorz; + VclPtr<PushButton> m_pBtnDelete; long nXValue; long nYValue; FieldUnit eUIUnit; @@ -59,6 +59,8 @@ private: public: SdSnapLineDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView); + virtual ~SdSnapLineDlg(); + virtual void dispose() SAL_OVERRIDE; void GetAttr(SfxItemSet& rOutAttrs); diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx index b4ee242f32bf..7945aa29bc5b 100644 --- a/sd/source/ui/inc/framework/Pane.hxx +++ b/sd/source/ui/inc/framework/Pane.hxx @@ -29,6 +29,7 @@ #include <cppuhelper/compbase3.hxx> #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } @@ -135,7 +136,7 @@ public: protected: ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> mxPaneId; - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; ::com::sun::star::uno::Reference<com::sun::star::awt::XWindow> mxWindow; ::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas> mxCanvas; diff --git a/sd/source/ui/inc/fupoor.hxx b/sd/source/ui/inc/fupoor.hxx index 00817a769d5a..67a7a91d598d 100644 --- a/sd/source/ui/inc/fupoor.hxx +++ b/sd/source/ui/inc/fupoor.hxx @@ -82,7 +82,7 @@ public: virtual void Activate(); ///< activates the function virtual void Deactivate(); ///< deactivates the function - void SetWindow(::sd::Window* pWin) { mpWindow = pWin; } + void SetWindow(::sd::Window* pWin); virtual void SelectionHasChanged(); @@ -150,14 +150,14 @@ protected: ::sd::View* mpView; ViewShell* mpViewShell; - ::sd::Window* mpWindow; + VclPtr<::sd::Window> mpWindow; DrawDocShell* mpDocSh; SdDrawDocument* mpDoc; sal_uInt16 nSlotId; sal_uInt16 nSlotValue; - Dialog* pDialog; + VclPtr<Dialog> pDialog; Timer aScrollTimer; ///< for auto-scrolling DECL_LINK( ScrollHdl, void * ); diff --git a/sd/source/ui/inc/headerfooterdlg.hxx b/sd/source/ui/inc/headerfooterdlg.hxx index 558e6487878b..4206cd4dc62b 100644 --- a/sd/source/ui/inc/headerfooterdlg.hxx +++ b/sd/source/ui/inc/headerfooterdlg.hxx @@ -44,17 +44,17 @@ private: DECL_LINK( ClickApplyHdl, void * ); DECL_LINK( ClickCancelHdl, void * ); - TabControl* mpTabCtrl; + VclPtr<TabControl> mpTabCtrl; - HeaderFooterTabPage* mpSlideTabPage; - HeaderFooterTabPage* mpNotesHandoutsTabPage; + VclPtr<HeaderFooterTabPage> mpSlideTabPage; + VclPtr<HeaderFooterTabPage> mpNotesHandoutsTabPage; sal_uInt16 mnSlidesId; sal_uInt16 mnNotesId; - PushButton* maPBApplyToAll; - PushButton* maPBApply; - CancelButton* maPBCancel; + VclPtr<PushButton> maPBApplyToAll; + VclPtr<PushButton> maPBApply; + VclPtr<CancelButton> maPBCancel; HeaderFooterSettings maSlideSettings; HeaderFooterSettings maNotesHandoutSettings; diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx index 0cd396f4c31a..78362535242b 100644 --- a/sd/source/ui/inc/ins_paste.hxx +++ b/sd/source/ui/inc/ins_paste.hxx @@ -31,11 +31,13 @@ class SD_DLLPUBLIC SdInsertPasteDlg : public ModalDialog { private: - RadioButton* m_pRbBefore; - RadioButton* m_pRbAfter; + VclPtr<RadioButton> m_pRbBefore; + VclPtr<RadioButton> m_pRbAfter; public: SdInsertPasteDlg( vcl::Window* pWindow ); + virtual ~SdInsertPasteDlg(); + virtual void dispose() SAL_OVERRIDE; bool IsInsertBefore() const; }; diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx index f7a0e12ae859..7dd1c7541b94 100644 --- a/sd/source/ui/inc/inspagob.hxx +++ b/sd/source/ui/inc/inspagob.hxx @@ -29,9 +29,9 @@ class SdDrawDocument; class SdInsertPagesObjsDlg : public ModalDialog { private: - SdPageObjsTLB* m_pLbTree; - CheckBox* m_pCbxLink; - CheckBox* m_pCbxMasters; + VclPtr<SdPageObjsTLB> m_pLbTree; + VclPtr<CheckBox> m_pCbxLink; + VclPtr<CheckBox> m_pCbxMasters; SfxMedium* pMedium; const SdDrawDocument* mpDoc; @@ -46,6 +46,7 @@ public: SfxMedium* pSfxMedium, const OUString& rFileName ); virtual ~SdInsertPagesObjsDlg(); + virtual void dispose() SAL_OVERRIDE; /** returns the list nType == 0 -> pages diff --git a/sd/source/ui/inc/layeroptionsdlg.hxx b/sd/source/ui/inc/layeroptionsdlg.hxx index e3ad80873223..ec0b1d24ad30 100644 --- a/sd/source/ui/inc/layeroptionsdlg.hxx +++ b/sd/source/ui/inc/layeroptionsdlg.hxx @@ -35,12 +35,12 @@ class SfxItemSet; class SD_DLLPUBLIC SdInsertLayerDlg : public ModalDialog { private: - Edit* m_pEdtName; - Edit* m_pEdtTitle; - VclMultiLineEdit* m_pEdtDesc; - CheckBox* m_pCbxVisible; - CheckBox* m_pCbxPrintable; - CheckBox* m_pCbxLocked; + VclPtr<Edit> m_pEdtName; + VclPtr<Edit> m_pEdtTitle; + VclPtr<VclMultiLineEdit> m_pEdtDesc; + VclPtr<CheckBox> m_pCbxVisible; + VclPtr<CheckBox> m_pCbxPrintable; + VclPtr<CheckBox> m_pCbxLocked; const SfxItemSet& mrOutAttrs; @@ -48,6 +48,9 @@ public: SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& rStr ); + virtual ~SdInsertLayerDlg(); + virtual void dispose() SAL_OVERRIDE; + void GetAttr( SfxItemSet& rOutAttrs ); }; diff --git a/sd/source/ui/inc/masterlayoutdlg.hxx b/sd/source/ui/inc/masterlayoutdlg.hxx index b6c216944d8b..f6be32bc6ab1 100644 --- a/sd/source/ui/inc/masterlayoutdlg.hxx +++ b/sd/source/ui/inc/masterlayoutdlg.hxx @@ -37,11 +37,11 @@ private: SdDrawDocument* mpDoc; SdPage* mpCurrentPage; - CheckBox* mpCBDate; - CheckBox* mpCBPageNumber; - CheckBox* mpCBSlideNumber; - CheckBox* mpCBHeader; - CheckBox* mpCBFooter; + VclPtr<CheckBox> mpCBDate; + VclPtr<CheckBox> mpCBPageNumber; + VclPtr<CheckBox> mpCBSlideNumber; + VclPtr<CheckBox> mpCBHeader; + VclPtr<CheckBox> mpCBFooter; bool mbOldHeader; bool mbOldFooter; @@ -54,6 +54,8 @@ private: public: MasterLayoutDialog( vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage ); + virtual ~MasterLayoutDialog(); + virtual void dispose() SAL_OVERRIDE; virtual short Execute() SAL_OVERRIDE; }; diff --git a/sd/source/ui/inc/morphdlg.hxx b/sd/source/ui/inc/morphdlg.hxx index f23d69207d98..f675535a1ba1 100644 --- a/sd/source/ui/inc/morphdlg.hxx +++ b/sd/source/ui/inc/morphdlg.hxx @@ -38,7 +38,8 @@ public: vcl::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2); - virtual ~MorphDlg (void); + virtual ~MorphDlg(); + virtual void dispose() SAL_OVERRIDE; void SaveSettings() const; sal_uInt16 GetFadeSteps() const { return (sal_uInt16) m_pMtfSteps->GetValue(); } @@ -46,9 +47,9 @@ public: bool IsOrientationFade() const { return m_pCbxOrientation->IsChecked(); } private: - NumericField* m_pMtfSteps; - CheckBox* m_pCbxAttributes; - CheckBox* m_pCbxOrientation; + VclPtr<NumericField> m_pMtfSteps; + VclPtr<CheckBox> m_pCbxAttributes; + VclPtr<CheckBox> m_pCbxOrientation; void LoadSettings(); }; diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index 96654145ac78..9eb82d864b55 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -178,7 +178,7 @@ protected: const SfxPoolItem* pState ) SAL_OVERRIDE; private: - SdNavigatorWin* pNavigatorWin; + VclPtr<SdNavigatorWin> pNavigatorWin; const SdNavigatorWin::UpdateRequestFunctor maUpdateRequest; }; @@ -196,7 +196,7 @@ protected: const SfxPoolItem* pState ) SAL_OVERRIDE; private: - SdNavigatorWin* pNavigatorWin; + VclPtr<SdNavigatorWin> pNavigatorWin; const SdNavigatorWin::UpdateRequestFunctor maUpdateRequest; }; diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx index ea2fcde3e25d..0398823c783d 100644 --- a/sd/source/ui/inc/present.hxx +++ b/sd/source/ui/inc/present.hxx @@ -37,37 +37,37 @@ class SdStartPresentationDlg : public ModalDialog { private: - RadioButton* aRbtAll; - RadioButton* aRbtAtDia; - RadioButton* aRbtCustomshow; - ListBox* aLbDias; - ListBox* aLbCustomshow; + VclPtr<RadioButton> aRbtAll; + VclPtr<RadioButton> aRbtAtDia; + VclPtr<RadioButton> aRbtCustomshow; + VclPtr<ListBox> aLbDias; + VclPtr<ListBox> aLbCustomshow; - RadioButton* aRbtStandard; - RadioButton* aRbtWindow; - RadioButton* aRbtAuto; - TimeField* aTmfPause; - CheckBox* aCbxAutoLogo; + VclPtr<RadioButton> aRbtStandard; + VclPtr<RadioButton> aRbtWindow; + VclPtr<RadioButton> aRbtAuto; + VclPtr<TimeField> aTmfPause; + VclPtr<CheckBox> aCbxAutoLogo; - CheckBox* aCbxManuel; - CheckBox* aCbxMousepointer; - CheckBox* aCbxPen; - CheckBox* aCbxNavigator; - CheckBox* aCbxAnimationAllowed; - CheckBox* aCbxChangePage; - CheckBox* aCbxAlwaysOnTop; + VclPtr<CheckBox> aCbxManuel; + VclPtr<CheckBox> aCbxMousepointer; + VclPtr<CheckBox> aCbxPen; + VclPtr<CheckBox> aCbxNavigator; + VclPtr<CheckBox> aCbxAnimationAllowed; + VclPtr<CheckBox> aCbxChangePage; + VclPtr<CheckBox> aCbxAlwaysOnTop; - FixedText* maFtMonitor; - ListBox* maLBMonitor; + VclPtr<FixedText> maFtMonitor; + VclPtr<ListBox> maLBMonitor; SdCustomShowList* pCustomShowList; const SfxItemSet& rOutAttrs; sal_Int32 mnMonitors; - FixedText* msMonitor; - FixedText* msAllMonitors; - FixedText* msMonitorExternal; - FixedText* msExternal; + VclPtr<FixedText> msMonitor; + VclPtr<FixedText> msAllMonitors; + VclPtr<FixedText> msMonitorExternal; + VclPtr<FixedText> msExternal; DECL_LINK( ChangeRangeHdl, void * ); DECL_LINK( ClickWindowPresentationHdl, void * ); @@ -88,6 +88,8 @@ public: const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ); + virtual ~SdStartPresentationDlg(); + virtual void dispose() SAL_OVERRIDE; void GetAttr( SfxItemSet& rOutAttrs ); }; diff --git a/sd/source/ui/inc/prntopts.hxx b/sd/source/ui/inc/prntopts.hxx index 9ae6631f435e..c64b4d76cb6b 100644 --- a/sd/source/ui/inc/prntopts.hxx +++ b/sd/source/ui/inc/prntopts.hxx @@ -32,25 +32,25 @@ class SdPrintOptions : public SfxTabPage friend class SdModule; private: - VclFrame *m_pFrmContent; - CheckBox *m_pCbxDraw; - CheckBox *m_pCbxNotes; - CheckBox *m_pCbxHandout; - CheckBox *m_pCbxOutline; - RadioButton *m_pRbtColor; - RadioButton *m_pRbtGrayscale; - RadioButton *m_pRbtBlackWhite; - CheckBox *m_pCbxPagename; - CheckBox *m_pCbxDate; - CheckBox *m_pCbxTime; - CheckBox *m_pCbxHiddenPages; - RadioButton *m_pRbtDefault; - RadioButton *m_pRbtPagesize; - RadioButton *m_pRbtPagetile; - RadioButton *m_pRbtBooklet; - CheckBox *m_pCbxFront; - CheckBox *m_pCbxBack; - CheckBox *m_pCbxPaperbin; + VclPtr<VclFrame> m_pFrmContent; + VclPtr<CheckBox> m_pCbxDraw; + VclPtr<CheckBox> m_pCbxNotes; + VclPtr<CheckBox> m_pCbxHandout; + VclPtr<CheckBox> m_pCbxOutline; + VclPtr<RadioButton> m_pRbtColor; + VclPtr<RadioButton> m_pRbtGrayscale; + VclPtr<RadioButton> m_pRbtBlackWhite; + VclPtr<CheckBox> m_pCbxPagename; + VclPtr<CheckBox> m_pCbxDate; + VclPtr<CheckBox> m_pCbxTime; + VclPtr<CheckBox> m_pCbxHiddenPages; + VclPtr<RadioButton> m_pRbtDefault; + VclPtr<RadioButton> m_pRbtPagesize; + VclPtr<RadioButton> m_pRbtPagetile; + VclPtr<RadioButton> m_pRbtBooklet; + VclPtr<CheckBox> m_pCbxFront; + VclPtr<CheckBox> m_pCbxBack; + VclPtr<CheckBox> m_pCbxPaperbin; const SfxItemSet& rOutAttrs; @@ -63,6 +63,7 @@ private: public: SdPrintOptions( vcl::Window* pParent, const SfxItemSet& rInAttrs); virtual ~SdPrintOptions(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window*, const SfxItemSet* ); diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx index bbb4f264d8ee..f9670c7b038f 100644 --- a/sd/source/ui/inc/pubdlg.hxx +++ b/sd/source/ui/inc/pubdlg.hxx @@ -53,104 +53,104 @@ class SdPublishingDlg : public ModalDialog { private: // page 1 controls - VclContainer* pPage1; - FixedText* pPage1_Titel; - RadioButton* pPage1_NewDesign; - RadioButton* pPage1_OldDesign; - ListBox* pPage1_Designs; - PushButton* pPage1_DelDesign; - FixedText* pPage1_Desc; + VclPtr<VclContainer> pPage1; + VclPtr<FixedText> pPage1_Titel; + VclPtr<RadioButton> pPage1_NewDesign; + VclPtr<RadioButton> pPage1_OldDesign; + VclPtr<ListBox> pPage1_Designs; + VclPtr<PushButton> pPage1_DelDesign; + VclPtr<FixedText> pPage1_Desc; // page 2 controls - VclContainer* pPage2; - VclContainer* pPage2Frame2; - VclContainer* pPage2Frame3; - VclContainer* pPage2Frame4; - FixedText* pPage2_Titel; - RadioButton* pPage2_Standard; - RadioButton* pPage2_Frames; - RadioButton* pPage2_SingleDocument; - RadioButton* pPage2_Kiosk; - RadioButton* pPage2_WebCast; - FixedImage* pPage2_Standard_FB; - FixedImage* pPage2_Frames_FB; - FixedImage* pPage2_Kiosk_FB; - FixedImage* pPage2_WebCast_FB; - - FixedText* pPage2_Titel_Html; - CheckBox* pPage2_Content; - CheckBox* pPage2_Notes; - - FixedText* pPage2_Titel_WebCast; - RadioButton* pPage2_ASP; - RadioButton* pPage2_PERL; - FixedText* pPage2_URL_txt; - Edit* pPage2_URL; - FixedText* pPage2_CGI_txt; - Edit* pPage2_CGI; - FixedText* pPage2_Index_txt; - Edit* pPage2_Index; - FixedText* pPage2_Titel_Kiosk; - RadioButton* pPage2_ChgDefault; - RadioButton* pPage2_ChgAuto; - FixedText* pPage2_Duration_txt; - TimeField* pPage2_Duration; - CheckBox* pPage2_Endless; + VclPtr<VclContainer> pPage2; + VclPtr<VclContainer> pPage2Frame2; + VclPtr<VclContainer> pPage2Frame3; + VclPtr<VclContainer> pPage2Frame4; + VclPtr<FixedText> pPage2_Titel; + VclPtr<RadioButton> pPage2_Standard; + VclPtr<RadioButton> pPage2_Frames; + VclPtr<RadioButton> pPage2_SingleDocument; + VclPtr<RadioButton> pPage2_Kiosk; + VclPtr<RadioButton> pPage2_WebCast; + VclPtr<FixedImage> pPage2_Standard_FB; + VclPtr<FixedImage> pPage2_Frames_FB; + VclPtr<FixedImage> pPage2_Kiosk_FB; + VclPtr<FixedImage> pPage2_WebCast_FB; + + VclPtr<FixedText> pPage2_Titel_Html; + VclPtr<CheckBox> pPage2_Content; + VclPtr<CheckBox> pPage2_Notes; + + VclPtr<FixedText> pPage2_Titel_WebCast; + VclPtr<RadioButton> pPage2_ASP; + VclPtr<RadioButton> pPage2_PERL; + VclPtr<FixedText> pPage2_URL_txt; + VclPtr<Edit> pPage2_URL; + VclPtr<FixedText> pPage2_CGI_txt; + VclPtr<Edit> pPage2_CGI; + VclPtr<FixedText> pPage2_Index_txt; + VclPtr<Edit> pPage2_Index; + VclPtr<FixedText> pPage2_Titel_Kiosk; + VclPtr<RadioButton> pPage2_ChgDefault; + VclPtr<RadioButton> pPage2_ChgAuto; + VclPtr<FixedText> pPage2_Duration_txt; + VclPtr<TimeField> pPage2_Duration; + VclPtr<CheckBox> pPage2_Endless; // page 3 controls - VclContainer* pPage3; - FixedText* pPage3_Titel1; - RadioButton* pPage3_Png; - RadioButton* pPage3_Gif; - RadioButton* pPage3_Jpg; - FixedText* pPage3_Quality_txt; - ComboBox* pPage3_Quality; - FixedText* pPage3_Titel2; - RadioButton* pPage3_Resolution_1; - RadioButton* pPage3_Resolution_2; - RadioButton* pPage3_Resolution_3; - FixedText* pPage3_Titel3; - CheckBox* pPage3_SldSound; - CheckBox* pPage3_HiddenSlides; + VclPtr<VclContainer> pPage3; + VclPtr<FixedText> pPage3_Titel1; + VclPtr<RadioButton> pPage3_Png; + VclPtr<RadioButton> pPage3_Gif; + VclPtr<RadioButton> pPage3_Jpg; + VclPtr<FixedText> pPage3_Quality_txt; + VclPtr<ComboBox> pPage3_Quality; + VclPtr<FixedText> pPage3_Titel2; + VclPtr<RadioButton> pPage3_Resolution_1; + VclPtr<RadioButton> pPage3_Resolution_2; + VclPtr<RadioButton> pPage3_Resolution_3; + VclPtr<FixedText> pPage3_Titel3; + VclPtr<CheckBox> pPage3_SldSound; + VclPtr<CheckBox> pPage3_HiddenSlides; // page 4 controls - VclContainer* pPage4; - FixedText* pPage4_Titel1; - FixedText* pPage4_Author_txt; - Edit* pPage4_Author; - FixedText* pPage4_Email_txt; - Edit* pPage4_Email; - FixedText* pPage4_WWW_txt; - Edit* pPage4_WWW; - FixedText* pPage4_Titel2; - VclMultiLineEdit* pPage4_Misc; - CheckBox* pPage4_Download; + VclPtr<VclContainer> pPage4; + VclPtr<FixedText> pPage4_Titel1; + VclPtr<FixedText> pPage4_Author_txt; + VclPtr<Edit> pPage4_Author; + VclPtr<FixedText> pPage4_Email_txt; + VclPtr<Edit> pPage4_Email; + VclPtr<FixedText> pPage4_WWW_txt; + VclPtr<Edit> pPage4_WWW; + VclPtr<FixedText> pPage4_Titel2; + VclPtr<VclMultiLineEdit> pPage4_Misc; + VclPtr<CheckBox> pPage4_Download; // page 5 controls - VclContainer* pPage5; - FixedText* pPage5_Titel; - CheckBox* pPage5_TextOnly; - ValueSet* pPage5_Buttons; + VclPtr<VclContainer> pPage5; + VclPtr<FixedText> pPage5_Titel; + VclPtr<CheckBox> pPage5_TextOnly; + VclPtr<ValueSet> pPage5_Buttons; // page 6 controls - VclContainer* pPage6; - FixedText* pPage6_Titel; - RadioButton* pPage6_Default; - RadioButton* pPage6_User; - PushButton* pPage6_Back; - PushButton* pPage6_Text; - PushButton* pPage6_Link; - PushButton* pPage6_VLink; - PushButton* pPage6_ALink; - RadioButton* pPage6_DocColors; - SdHtmlAttrPreview* pPage6_Preview; + VclPtr<VclContainer> pPage6; + VclPtr<FixedText> pPage6_Titel; + VclPtr<RadioButton> pPage6_Default; + VclPtr<RadioButton> pPage6_User; + VclPtr<PushButton> pPage6_Back; + VclPtr<PushButton> pPage6_Text; + VclPtr<PushButton> pPage6_Link; + VclPtr<PushButton> pPage6_VLink; + VclPtr<PushButton> pPage6_ALink; + VclPtr<RadioButton> pPage6_DocColors; + VclPtr<SdHtmlAttrPreview> pPage6_Preview; boost::scoped_ptr< ButtonSet > mpButtonSet; // standard controls - PushButton* pLastPageButton; - PushButton* pNextPageButton; - PushButton* pFinishButton; + VclPtr<PushButton> pLastPageButton; + VclPtr<PushButton> pNextPageButton; + VclPtr<PushButton> pFinishButton; Assistent aAssistentFunc; @@ -197,6 +197,7 @@ public: SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType); virtual ~SdPublishingDlg(); + virtual void dispose() SAL_OVERRIDE; void GetParameterSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rParams ); }; diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx index ea68e8de3214..7afb5a8b5ac7 100644 --- a/sd/source/ui/inc/sdpreslt.hxx +++ b/sd/source/ui/inc/sdpreslt.hxx @@ -42,7 +42,8 @@ public: vcl::Window* pWindow, const SfxItemSet& rInAttrs); - virtual ~SdPresLayoutDlg (void); + virtual ~SdPresLayoutDlg(); + virtual void dispose() SAL_OVERRIDE; void GetAttr(SfxItemSet& rOutAttrs); @@ -51,10 +52,10 @@ public: private: ::sd::DrawDocShell* mpDocSh; - ValueSet* m_pVS; - CheckBox* m_pCbxMasterPage; - CheckBox* m_pCbxCheckMasters; - PushButton* m_pBtnLoad; + VclPtr<ValueSet> m_pVS; + VclPtr<CheckBox> m_pCbxMasterPage; + VclPtr<CheckBox> m_pCbxCheckMasters; + VclPtr<PushButton> m_pBtnLoad; const SfxItemSet& mrOutAttrs; diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 6e683855cfc4..86731a6ce474 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -121,7 +121,7 @@ public: protected: - vcl::Window* mpParent; + VclPtr<vcl::Window> mpParent; const SdDrawDocument* mpDoc; SdDrawDocument* mpBookmarkDoc; SfxMedium* mpMedium; @@ -131,7 +131,7 @@ protected: bool mbLinkableSelected; OUString maDocName; ::sd::DrawDocShellRef mxBookmarkDocShRef; ///< for the loading of bookmarks - SdNavigatorWin* mpDropNavWin; + VclPtr<SdNavigatorWin> mpDropNavWin; SfxViewFrame* mpFrame; std::vector<OUString> maTreeItem; bool mbSaveTreeItemState; diff --git a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx index e6ae9d24572b..5cb6f07cb872 100644 --- a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx +++ b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx @@ -86,7 +86,7 @@ private: static void AddInstance (const SdDrawDocument* pDocument, SlideSorterCacheDisplay* pControl); static void RemoveInstance (SlideSorterCacheDisplay* pControl); - vcl::Window* mpWindow; + VclPtr<vcl::Window> mpWindow; sal_Int32 mnPageCount; sal_Int32 mnColumnCount; sal_Int32 mnRowCount; diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx index bd1ac112877b..576f64733181 100644 --- a/sd/source/ui/inc/tpaction.hxx +++ b/sd/source/ui/inc/tpaction.hxx @@ -53,21 +53,21 @@ public: class SdTPAction : public SfxTabPage { private: - ListBox* m_pLbAction; - - FixedText* m_pFtTree; // jump destination controls - SdPageObjsTLB* m_pLbTree; - SdPageObjsTLB* m_pLbTreeDocument; - ListBox* m_pLbOLEAction; - - VclFrame* m_pFrame; - Edit* m_pEdtSound; - Edit* m_pEdtBookmark; - Edit* m_pEdtDocument; - Edit* m_pEdtProgram; - Edit* m_pEdtMacro; - PushButton* m_pBtnSearch; - PushButton* m_pBtnSeek; + VclPtr<ListBox> m_pLbAction; + + VclPtr<FixedText> m_pFtTree; // jump destination controls + VclPtr<SdPageObjsTLB> m_pLbTree; + VclPtr<SdPageObjsTLB> m_pLbTreeDocument; + VclPtr<ListBox> m_pLbOLEAction; + + VclPtr<VclFrame> m_pFrame; + VclPtr<Edit> m_pEdtSound; + VclPtr<Edit> m_pEdtBookmark; + VclPtr<Edit> m_pEdtDocument; + VclPtr<Edit> m_pEdtProgram; + VclPtr<Edit> m_pEdtMacro; + VclPtr<PushButton> m_pBtnSearch; + VclPtr<PushButton> m_pBtnSeek; const SfxItemSet& rOutAttrs; const ::sd::View* mpView; @@ -97,6 +97,7 @@ private: public: SdTPAction( vcl::Window* pParent, const SfxItemSet& rInAttrs ); virtual ~SdTPAction(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window*, const SfxItemSet& ); diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx index 353b06eee46f..55f671d408c6 100644 --- a/sd/source/ui/inc/tpoption.hxx +++ b/sd/source/ui/inc/tpoption.hxx @@ -50,14 +50,15 @@ public: class SdTpOptionsContents : public SfxTabPage { private: - CheckBox* m_pCbxRuler; - CheckBox* m_pCbxDragStripes; - CheckBox* m_pCbxHandlesBezier; - CheckBox* m_pCbxMoveOutline; + VclPtr<CheckBox> m_pCbxRuler; + VclPtr<CheckBox> m_pCbxDragStripes; + VclPtr<CheckBox> m_pCbxHandlesBezier; + VclPtr<CheckBox> m_pCbxMoveOutline; public: SdTpOptionsContents( vcl::Window* pParent, const SfxItemSet& rInAttrs ); virtual ~SdTpOptionsContents(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window*, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; @@ -73,38 +74,38 @@ class SdTpOptionsMisc : public SfxTabPage friend class SdModule; private: - CheckBox *m_pCbxQuickEdit; - CheckBox *m_pCbxPickThrough; + VclPtr<CheckBox> m_pCbxQuickEdit; + VclPtr<CheckBox> m_pCbxPickThrough; - VclFrame *m_pNewDocumentFrame; - CheckBox *m_pCbxStartWithTemplate; + VclPtr<VclFrame> m_pNewDocumentFrame; + VclPtr<CheckBox> m_pCbxStartWithTemplate; - CheckBox *m_pCbxMasterPageCache; - CheckBox *m_pCbxCopy; - CheckBox *m_pCbxMarkedHitMovesAlways; - VclFrame *m_pPresentationFrame; + VclPtr<CheckBox> m_pCbxMasterPageCache; + VclPtr<CheckBox> m_pCbxCopy; + VclPtr<CheckBox> m_pCbxMarkedHitMovesAlways; + VclPtr<VclFrame> m_pPresentationFrame; - ListBox *m_pLbMetric; - MetricField *m_pMtrFldTabstop; + VclPtr<ListBox> m_pLbMetric; + VclPtr<MetricField> m_pMtrFldTabstop; - CheckBox *m_pCbxEnableSdremote; - CheckBox *m_pCbxEnablePresenterScreen; - CheckBox *m_pCbxUsePrinterMetrics; - CheckBox *m_pCbxCompatibility; + VclPtr<CheckBox> m_pCbxEnableSdremote; + VclPtr<CheckBox> m_pCbxEnablePresenterScreen; + VclPtr<CheckBox> m_pCbxUsePrinterMetrics; + VclPtr<CheckBox> m_pCbxCompatibility; //Scale - VclFrame *m_pScaleFrame; - ComboBox *m_pCbScale; - FixedText *m_pNewDocLb; - FixedText *m_pFiInfo1; - MetricField *m_pMtrFldOriginalWidth; - FixedText *m_pWidthLb; - FixedText *m_pHeightLb; - FixedText *m_pFiInfo2; - MetricField *m_pMtrFldOriginalHeight; - CheckBox *m_pCbxDistrot; - MetricField *m_pMtrFldInfo1; - MetricField *m_pMtrFldInfo2; + VclPtr<VclFrame> m_pScaleFrame; + VclPtr<ComboBox> m_pCbScale; + VclPtr<FixedText> m_pNewDocLb; + VclPtr<FixedText> m_pFiInfo1; + VclPtr<MetricField> m_pMtrFldOriginalWidth; + VclPtr<FixedText> m_pWidthLb; + VclPtr<FixedText> m_pHeightLb; + VclPtr<FixedText> m_pFiInfo2; + VclPtr<MetricField> m_pMtrFldOriginalHeight; + VclPtr<CheckBox> m_pCbxDistrot; + VclPtr<MetricField> m_pMtrFldInfo1; + VclPtr<MetricField> m_pMtrFldInfo2; sal_uInt32 nWidth; sal_uInt32 nHeight; @@ -131,6 +132,7 @@ protected: public: SdTpOptionsMisc( vcl::Window* pParent, const SfxItemSet& rInAttrs ); virtual ~SdTpOptionsMisc(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window*, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE; diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx index 153343dae933..fefa8efe82ef 100644 --- a/sd/source/ui/inc/vectdlg.hxx +++ b/sd/source/ui/inc/vectdlg.hxx @@ -42,20 +42,20 @@ class DrawDocShell; class SdVectorizeDlg : public ModalDialog { ::sd::DrawDocShell * mpDocSh; - NumericField* m_pNmLayers; - MetricField* m_pMtReduce; - FixedText* m_pFtFillHoles; - MetricField* m_pMtFillHoles; - CheckBox* m_pCbFillHoles; + VclPtr<NumericField> m_pNmLayers; + VclPtr<MetricField> m_pMtReduce; + VclPtr<FixedText> m_pFtFillHoles; + VclPtr<MetricField> m_pMtFillHoles; + VclPtr<CheckBox> m_pCbFillHoles; - GraphCtrl* m_pBmpWin; + VclPtr<GraphCtrl> m_pBmpWin; - GraphCtrl* m_pMtfWin; + VclPtr<GraphCtrl> m_pMtfWin; - ProgressBar* m_pPrgs; + VclPtr<ProgressBar> m_pPrgs; - OKButton* m_pBtnOK; - PushButton* m_pBtnPreview; + VclPtr<OKButton> m_pBtnOK; + VclPtr<PushButton> m_pBtnPreview; Bitmap aBmp; Bitmap aPreviewBmp; @@ -82,6 +82,7 @@ public: SdVectorizeDlg( vcl::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell ); virtual ~SdVectorizeDlg(); + virtual void dispose() SAL_OVERRIDE; const GDIMetaFile& GetGDIMetaFile() const { return aMtf; } }; diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 32f8db4ed6b0..7e8144380528 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -927,7 +927,7 @@ bool SlideShow::startPreview( const Reference< XDrawPage >& xDrawPage, const Ref OutputDevice* SlideShow::getShowWindow() { - return mxController.is() ? mxController->mpShowWindow : 0; + return mxController.is() ? mxController->mpShowWindow.get() : 0; } int SlideShow::getAnimationMode() diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index f64376e69571..15b2bb3eecbb 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -707,8 +707,7 @@ void SAL_CALL SlideshowImpl::disposing() if( mpTimeButton ) { mpTimeButton->Hide(); - delete mpTimeButton; - mpTimeButton = 0; + mpTimeButton.clear(); } if( mpShowWindow ) @@ -743,8 +742,7 @@ void SAL_CALL SlideshowImpl::disposing() if( mpShowWindow ) { - delete mpShowWindow; - mpShowWindow = 0; + mpShowWindow.clear(); } setActiveXToolbarsVisible( true ); @@ -805,7 +803,7 @@ bool SlideshowImpl::startPreview( mpSlideController->insertSlideNumber( nSlideNumber-1 ); mpSlideController->setPreviewNode( xAnimationNode ); - mpShowWindow = new ShowWindow( this, ((pParent == 0) && mpViewShell) ? mpParentWindow : pParent ); + mpShowWindow = new ShowWindow( this, ((pParent == 0) && mpViewShell) ? mpParentWindow.get() : pParent ); if( mpViewShell ) { mpViewShell->SetActiveWindow( mpShowWindow ); @@ -857,7 +855,7 @@ bool SlideshowImpl::startPreview( bRet = startShowImpl( aProperties ); - if( mpShowWindow != 0 && meAnimationMode == ANIMATIONMODE_PREVIEW ) + if( mpShowWindow != nullptr && meAnimationMode == ANIMATIONMODE_PREVIEW ) mpShowWindow->SetPreviewMode(); } @@ -882,8 +880,8 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) DBG_ASSERT( !mxShow.is(), "sd::SlideshowImpl::startShow(), called twice!" ); if( mxShow.is() ) return true; - DBG_ASSERT( mpParentWindow!=NULL, "sd::SlideshowImpl::startShow() called without parent window" ); - if (mpParentWindow == NULL) + DBG_ASSERT( mpParentWindow!=nullptr, "sd::SlideshowImpl::startShow() called without parent window" ); + if (mpParentWindow == nullptr) return false; // Autoplay (pps/ppsx) diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index b39c4ede6c9a..2d96b97ec269 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -92,7 +92,7 @@ struct PresentationSettingsEx : public PresentationSettings { bool mbRehearseTimings; bool mbPreview; - vcl::Window* mpParentWindow; + VclPtr<vcl::Window> mpParentWindow; css::uno::Reference< css::drawing::XDrawPage > mxStartPage; css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode; @@ -332,9 +332,9 @@ private: SdDrawDocument* mpDoc; SfxItemSet* mpNewAttr; - vcl::Window* mpParentWindow; - ShowWindow* mpShowWindow; - PushButton* mpTimeButton; + VclPtr<vcl::Window> mpParentWindow; + VclPtr<ShowWindow> mpShowWindow; + VclPtr<PushButton> mpTimeButton; boost::shared_ptr< AnimationSlideController > mpSlideController; @@ -347,8 +347,8 @@ private: OUString maCharBuffer; Pointer maOldPointer; Pointer maPencil; - std::vector< ::sd::Window* > maDrawModeWindows; - ::sd::Window* mpOldActiveWindow; + std::vector< VclPtr<::sd::Window> > maDrawModeWindows; + VclPtr<::sd::Window> mpOldActiveWindow; Link maStarBASICGlobalErrorHdl; unsigned long mnChildMask; bool mbGridVisible; diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx index 0fb256cc103c..ecf324078546 100644 --- a/sd/source/ui/table/TableDesignPane.hxx +++ b/sd/source/ui/table/TableDesignPane.hxx @@ -92,8 +92,8 @@ private: private: ViewShellBase& mrBase; - TableValueSet* m_pValueSet; - CheckBox* m_aCheckBoxes[CB_COUNT]; + VclPtr<TableValueSet> m_pValueSet; + VclPtr<CheckBox> m_aCheckBoxes[CB_COUNT]; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable; ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView; diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 5a72e6691027..67df29c52f44 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -138,7 +138,7 @@ void FormShellManager::RegisterAtCenterPane (void) return; mpMainViewShellWindow = pShell->GetActiveWindow(); - if (mpMainViewShellWindow == NULL) + if (mpMainViewShellWindow == nullptr) return; // Register at the window to get informed when to move the form @@ -158,7 +158,7 @@ void FormShellManager::RegisterAtCenterPane (void) void FormShellManager::UnregisterAtCenterPane (void) { - if (mpMainViewShellWindow != NULL) + if (mpMainViewShellWindow != nullptr) { // Unregister from the window. mpMainViewShellWindow->RemoveEventListener( diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx index e4592649694c..f4c1d2282a19 100644 --- a/sd/source/ui/view/sdruler.cxx +++ b/sd/source/ui/view/sdruler.cxx @@ -101,6 +101,7 @@ void Ruler::dispose() rBindings.EnterRegistrations(); delete pCtrlItem; rBindings.LeaveRegistrations(); + pSdWin.clear(); SvxRuler::dispose(); } diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 0cb06ef6b2b3..e0f3cdf5d854 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -76,7 +76,7 @@ using namespace ::com::sun::star; struct SdNavigatorDropEvent : public ExecuteDropEvent { DropTargetHelper& mrTargetHelper; - ::sd::Window* mpTargetWindow; + VclPtr<::sd::Window> mpTargetWindow; sal_uInt16 mnPage; sal_uInt16 mnLayer; diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index a8e0fa33a188..5b6523ed3324 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -105,6 +105,7 @@ void Window::dispose() if (pWindowUpdater != NULL) pWindowUpdater->UnregisterWindow (this); } + mpShareWin.clear(); vcl::Window::dispose(); } diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index f6d25df97e1e..2f37f852d1a9 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -648,7 +648,7 @@ void ViewShell::SetActiveWindow (::sd::Window* pWin) } } - if (mpActiveWindow != pWin) + if (mpActiveWindow.get() != pWin) mpActiveWindow = pWin; // The rest of this function is not guarded anymore against calling this diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 4016503e16d4..4076a096f9f4 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -891,7 +891,7 @@ void ViewShell::Resize (void) { SetupRulers (); - if (mpParentWindow == NULL) + if (mpParentWindow == nullptr) return; // Make sure that the new size is not degenerate. |