diff options
Diffstat (limited to 'filter')
19 files changed, 376 insertions, 165 deletions
diff --git a/filter/source/flash/impswfdialog.cxx b/filter/source/flash/impswfdialog.cxx index fe6b7fe7c485..1a6a69849cb1 100644 --- a/filter/source/flash/impswfdialog.cxx +++ b/filter/source/flash/impswfdialog.cxx @@ -60,8 +60,21 @@ ImpSWFDialog::ImpSWFDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFi ImpSWFDialog::~ImpSWFDialog() { + dispose(); } +void ImpSWFDialog::dispose() +{ + mpNumFldQuality.clear(); + mpCheckExportAll.clear(); + mpCheckExportBackgrounds.clear(); + mpCheckExportBackgroundObjects.clear(); + mpCheckExportSlideContents.clear(); + mpCheckExportSound.clear(); + mpCheckExportOLEAsJPEG.clear(); + mpCheckExportMultipleFiles.clear(); + ModalDialog::dispose(); +} Sequence< PropertyValue > ImpSWFDialog::GetFilterData() diff --git a/filter/source/flash/impswfdialog.hxx b/filter/source/flash/impswfdialog.hxx index cb128448112e..aae9ecf7f1c2 100644 --- a/filter/source/flash/impswfdialog.hxx +++ b/filter/source/flash/impswfdialog.hxx @@ -41,14 +41,14 @@ namespace vcl { class Window; } class ImpSWFDialog : public ModalDialog { private: - NumericField * mpNumFldQuality; - CheckBox * mpCheckExportAll; - CheckBox * mpCheckExportBackgrounds; - CheckBox * mpCheckExportBackgroundObjects; - CheckBox * mpCheckExportSlideContents; - CheckBox * mpCheckExportSound; - CheckBox * mpCheckExportOLEAsJPEG; - CheckBox * mpCheckExportMultipleFiles; + VclPtr<NumericField> mpNumFldQuality; + VclPtr<CheckBox> mpCheckExportAll; + VclPtr<CheckBox> mpCheckExportBackgrounds; + VclPtr<CheckBox> mpCheckExportBackgroundObjects; + VclPtr<CheckBox> mpCheckExportSlideContents; + VclPtr<CheckBox> mpCheckExportSound; + VclPtr<CheckBox> mpCheckExportOLEAsJPEG; + VclPtr<CheckBox> mpCheckExportMultipleFiles; FilterConfigItem maConfigItem; @@ -58,6 +58,7 @@ public: ImpSWFDialog( vcl::Window* pParent, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rFilterData ); virtual ~ImpSWFDialog(); + virtual void dispose() SAL_OVERRIDE; com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > GetFilterData(); }; diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx index 981731ae642e..0817f86bcbed 100644 --- a/filter/source/flash/swfdialog.cxx +++ b/filter/source/flash/swfdialog.cxx @@ -184,7 +184,7 @@ Dialog* SWFDialog::createDialog( vcl::Window* pParent ) void SWFDialog::executedDialog( sal_Int16 nExecutionResult ) { if( nExecutionResult && m_pDialog ) - maFilterData = static_cast< ImpSWFDialog* >( m_pDialog )->GetFilterData(); + maFilterData = static_cast< ImpSWFDialog* >( m_pDialog.get() )->GetFilterData(); destroyDialog(); } diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 073039dab505..6350aa81be63 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -552,10 +552,42 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() { + dispose(); } - -void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) +void ImpPDFTabGeneralPage::dispose() +{ + mpRbAll.clear(); + mpRbRange.clear(); + mpRbSelection.clear(); + mpEdPages.clear(); + mpRbLosslessCompression.clear(); + mpRbJPEGCompression.clear(); + mpQualityFrame.clear(); + mpNfQuality.clear(); + mpCbReduceImageResolution.clear(); + mpCoReduceImageResolution.clear(); + mpCbPDFA1b.clear(); + mpCbTaggedPDF.clear(); + mpCbExportFormFields.clear(); + mpFormsFrame.clear(); + mpLbFormsFormat.clear(); + mpCbAllowDuplicateFieldNames.clear(); + mpCbExportBookmarks.clear(); + mpCbExportHiddenSlides.clear(); + mpCbExportNotes.clear(); + mpCbViewPDF.clear(); + mpCbExportNotesPages.clear(); + mpCbExportEmptyPages.clear(); + mpCbAddStream.clear(); + mpCbWatermark.clear(); + mpFtWatermark.clear(); + mpEdWatermark.clear(); + mpaParent.clear(); + SfxTabPage::dispose(); +} + +void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent ) { mpaParent = paParent; @@ -850,8 +882,28 @@ ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage(vcl::Window* pParent, const SfxItemSet& ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage() { + dispose(); } +void ImpPDFTabOpnFtrPage::dispose() +{ + mpRbOpnPageOnly.clear(); + mpRbOpnOutline.clear(); + mpRbOpnThumbs.clear(); + mpNumInitialPage.clear(); + mpRbMagnDefault.clear(); + mpRbMagnFitWin.clear(); + mpRbMagnFitWidth.clear(); + mpRbMagnFitVisible.clear(); + mpRbMagnZoom.clear(); + mpNumZoom.clear(); + mpRbPgLyDefault.clear(); + mpRbPgLySinglePage.clear(); + mpRbPgLyContinue.clear(); + mpRbPgLyContinueFacing.clear(); + mpCbPgLyFirstOnLeft.clear(); + SfxTabPage::dispose(); +} SfxTabPage* ImpPDFTabOpnFtrPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) @@ -1005,6 +1057,23 @@ ImpPDFTabViewerPage::ImpPDFTabViewerPage( vcl::Window* pParent, ImpPDFTabViewerPage::~ImpPDFTabViewerPage() { + dispose(); +} + +void ImpPDFTabViewerPage::dispose() +{ + m_pCbResWinInit.clear(); + m_pCbCenterWindow.clear(); + m_pCbOpenFullScreen.clear(); + m_pCbDispDocTitle.clear(); + m_pCbHideViewerMenubar.clear(); + m_pCbHideViewerToolbar.clear(); + m_pCbHideViewerWindowControls.clear(); + m_pCbTransitionEffects.clear(); + m_pRbAllBookmarkLevels.clear(); + m_pRbVisibleBookmarkLevels.clear(); + m_pNumBookmarkLevels.clear(); + SfxTabPage::dispose(); } IMPL_LINK( ImpPDFTabViewerPage, ToggleRbBookmarksHdl, void*, ) @@ -1102,8 +1171,33 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(vcl::Window* i_pParent, const SfxIt ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage() { + dispose(); } +void ImpPDFTabSecurityPage::dispose() +{ + mpPbSetPwd.clear(); + mpUserPwdSet.clear(); + mpUserPwdUnset.clear(); + mpUserPwdPdfa.clear(); + mpOwnerPwdSet.clear(); + mpOwnerPwdUnset.clear(); + mpOwnerPwdPdfa.clear(); + mpPrintPermissions.clear(); + mpRbPrintNone.clear(); + mpRbPrintLowRes.clear(); + mpRbPrintHighRes.clear(); + mpChangesAllowed.clear(); + mpRbChangesNone.clear(); + mpRbChangesInsDel.clear(); + mpRbChangesFillForm.clear(); + mpRbChangesComment.clear(); + mpRbChangesAnyNoCopy.clear(); + mpContent.clear(); + mpCbEnableCopy.clear(); + mpCbEnableAccessibility.clear(); + SfxTabPage::dispose(); +} SfxTabPage* ImpPDFTabSecurityPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) @@ -1323,8 +1417,19 @@ ImpPDFTabLinksPage::ImpPDFTabLinksPage( vcl::Window* pParent, ImpPDFTabLinksPage::~ImpPDFTabLinksPage() { + dispose(); } +void ImpPDFTabLinksPage::dispose() +{ + m_pCbExprtBmkrToNmDst.clear(); + m_pCbOOoToPDFTargets.clear(); + m_pCbExportRelativeFsysLinks.clear(); + m_pRbOpnLnksDefault.clear(); + m_pRbOpnLnksLaunch.clear(); + m_pRbOpnLnksBrowser.clear(); + SfxTabPage::dispose(); +} SfxTabPage* ImpPDFTabLinksPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) @@ -1525,6 +1630,8 @@ void ImplErrorDialog::dispose() // free strings again for( sal_uInt16 n = 0; n < m_pErrors->GetEntryCount(); n++ ) delete static_cast<OUString*>(m_pErrors->GetEntryData( n )); + m_pErrors.clear(); + m_pExplanation.clear(); MessageDialog::dispose(); } @@ -1560,6 +1667,19 @@ ImpPDFTabSigningPage::ImpPDFTabSigningPage(vcl::Window* pParent, const SfxItemSe ImpPDFTabSigningPage::~ImpPDFTabSigningPage() { + dispose(); +} + +void ImpPDFTabSigningPage::dispose() +{ + mpEdSignCert.clear(); + mpPbSignCertSelect.clear(); + mpPbSignCertClear.clear(); + mpEdSignPassword.clear(); + mpEdSignLocation.clear(); + mpEdSignContactInfo.clear(); + mpEdSignReason.clear(); + SfxTabPage::dispose(); } IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertSelect ) diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index a913c9cca14f..b661eed6d389 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -56,8 +56,8 @@ public: class ImplErrorDialog : public MessageDialog { - ListBox* m_pErrors; - FixedText* m_pExplanation; + VclPtr<ListBox> m_pErrors; + VclPtr<FixedText> m_pExplanation; DECL_LINK(SelectHdl, void *); public: @@ -191,45 +191,45 @@ class ImpPDFTabGeneralPage : public SfxTabPage { friend class ImpPDFTabLinksPage; - RadioButton* mpRbAll; - RadioButton* mpRbRange; - RadioButton* mpRbSelection; - Edit* mpEdPages; + VclPtr<RadioButton> mpRbAll; + VclPtr<RadioButton> mpRbRange; + VclPtr<RadioButton> mpRbSelection; + VclPtr<Edit> mpEdPages; - RadioButton* mpRbLosslessCompression; - RadioButton* mpRbJPEGCompression; - VclContainer* mpQualityFrame; - MetricField* mpNfQuality; - CheckBox* mpCbReduceImageResolution; - ComboBox* mpCoReduceImageResolution; + VclPtr<RadioButton> mpRbLosslessCompression; + VclPtr<RadioButton> mpRbJPEGCompression; + VclPtr<VclContainer> mpQualityFrame; + VclPtr<MetricField> mpNfQuality; + VclPtr<CheckBox> mpCbReduceImageResolution; + VclPtr<ComboBox> mpCoReduceImageResolution; - CheckBox* mpCbPDFA1b; - CheckBox* mpCbTaggedPDF; + VclPtr<CheckBox> mpCbPDFA1b; + VclPtr<CheckBox> mpCbTaggedPDF; bool mbTaggedPDFUserSelection; - CheckBox* mpCbExportFormFields; + VclPtr<CheckBox> mpCbExportFormFields; bool mbExportFormFieldsUserSelection; - VclContainer* mpFormsFrame; - ListBox* mpLbFormsFormat; - CheckBox* mpCbAllowDuplicateFieldNames; + VclPtr<VclContainer> mpFormsFrame; + VclPtr<ListBox> mpLbFormsFormat; + VclPtr<CheckBox> mpCbAllowDuplicateFieldNames; - CheckBox* mpCbExportBookmarks; - CheckBox* mpCbExportHiddenSlides; - CheckBox* mpCbExportNotes; - CheckBox* mpCbViewPDF; - CheckBox* mpCbExportNotesPages; + VclPtr<CheckBox> mpCbExportBookmarks; + VclPtr<CheckBox> mpCbExportHiddenSlides; + VclPtr<CheckBox> mpCbExportNotes; + VclPtr<CheckBox> mpCbViewPDF; + VclPtr<CheckBox> mpCbExportNotesPages; - CheckBox* mpCbExportEmptyPages; - CheckBox* mpCbAddStream; + VclPtr<CheckBox> mpCbExportEmptyPages; + VclPtr<CheckBox> mpCbAddStream; - CheckBox* mpCbWatermark; - FixedText* mpFtWatermark; - Edit* mpEdWatermark; + VclPtr<CheckBox> mpCbWatermark; + VclPtr<FixedText> mpFtWatermark; + VclPtr<Edit> mpEdWatermark; bool mbIsPresentation; bool mbIsWriter; - const ImpPDFTabDialog* mpaParent; + VclPtr<ImpPDFTabDialog> mpaParent; DECL_LINK( TogglePagesHdl, void* ); DECL_LINK( ToggleCompressionHdl, void* ); @@ -243,36 +243,37 @@ public: ImpPDFTabGeneralPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~ImpPDFTabGeneralPage(); + virtual void dispose() SAL_OVERRIDE; + static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet); void GetFilterConfigItem(ImpPDFTabDialog* paParent); - void SetFilterConfigItem(const ImpPDFTabDialog* paParent); + void SetFilterConfigItem(ImpPDFTabDialog* paParent); bool IsPdfaSelected() const { return mpCbPDFA1b->IsChecked(); } }; //class tab page viewer class ImpPDFTabOpnFtrPage : public SfxTabPage { - RadioButton* mpRbOpnPageOnly; - RadioButton* mpRbOpnOutline; - RadioButton* mpRbOpnThumbs; - NumericField* mpNumInitialPage; - - RadioButton* mpRbMagnDefault; - RadioButton* mpRbMagnFitWin; - RadioButton* mpRbMagnFitWidth; - RadioButton* mpRbMagnFitVisible; - RadioButton* mpRbMagnZoom; - NumericField* mpNumZoom; - - RadioButton* mpRbPgLyDefault; - RadioButton* mpRbPgLySinglePage; - RadioButton* mpRbPgLyContinue; - RadioButton* mpRbPgLyContinueFacing; - CheckBox* mpCbPgLyFirstOnLeft; + VclPtr<RadioButton> mpRbOpnPageOnly; + VclPtr<RadioButton> mpRbOpnOutline; + VclPtr<RadioButton> mpRbOpnThumbs; + VclPtr<NumericField> mpNumInitialPage; + + VclPtr<RadioButton> mpRbMagnDefault; + VclPtr<RadioButton> mpRbMagnFitWin; + VclPtr<RadioButton> mpRbMagnFitWidth; + VclPtr<RadioButton> mpRbMagnFitVisible; + VclPtr<RadioButton> mpRbMagnZoom; + VclPtr<NumericField> mpNumZoom; + + VclPtr<RadioButton> mpRbPgLyDefault; + VclPtr<RadioButton> mpRbPgLySinglePage; + VclPtr<RadioButton> mpRbPgLyContinue; + VclPtr<RadioButton> mpRbPgLyContinueFacing; + VclPtr<CheckBox> mpCbPgLyFirstOnLeft; bool mbUseCTLFont; @@ -284,6 +285,7 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabOpnFtrPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -294,22 +296,22 @@ public: //class tab page viewer class ImpPDFTabViewerPage : public SfxTabPage { - CheckBox* m_pCbResWinInit; - CheckBox* m_pCbCenterWindow; - CheckBox* m_pCbOpenFullScreen; - CheckBox* m_pCbDispDocTitle; + VclPtr<CheckBox> m_pCbResWinInit; + VclPtr<CheckBox> m_pCbCenterWindow; + VclPtr<CheckBox> m_pCbOpenFullScreen; + VclPtr<CheckBox> m_pCbDispDocTitle; - CheckBox* m_pCbHideViewerMenubar; - CheckBox* m_pCbHideViewerToolbar; - CheckBox* m_pCbHideViewerWindowControls; + VclPtr<CheckBox> m_pCbHideViewerMenubar; + VclPtr<CheckBox> m_pCbHideViewerToolbar; + VclPtr<CheckBox> m_pCbHideViewerWindowControls; - CheckBox* m_pCbTransitionEffects; + VclPtr<CheckBox> m_pCbTransitionEffects; bool mbIsPresentation; - RadioButton* m_pRbAllBookmarkLevels; - RadioButton* m_pRbVisibleBookmarkLevels; - NumericField* m_pNumBookmarkLevels; + VclPtr<RadioButton> m_pRbAllBookmarkLevels; + VclPtr<RadioButton> m_pRbVisibleBookmarkLevels; + VclPtr<NumericField> m_pNumBookmarkLevels; DECL_LINK( ToggleRbBookmarksHdl, void* ); public: @@ -317,6 +319,7 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabViewerPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -327,32 +330,32 @@ public: //class security tab page class ImpPDFTabSecurityPage : public SfxTabPage { - PushButton* mpPbSetPwd; + VclPtr<PushButton> mpPbSetPwd; OUString msStrSetPwd; - VclContainer* mpUserPwdSet; - VclContainer* mpUserPwdUnset; - VclContainer* mpUserPwdPdfa; + VclPtr<VclContainer> mpUserPwdSet; + VclPtr<VclContainer> mpUserPwdUnset; + VclPtr<VclContainer> mpUserPwdPdfa; - VclContainer* mpOwnerPwdSet; - VclContainer* mpOwnerPwdUnset; - VclContainer* mpOwnerPwdPdfa; + VclPtr<VclContainer> mpOwnerPwdSet; + VclPtr<VclContainer> mpOwnerPwdUnset; + VclPtr<VclContainer> mpOwnerPwdPdfa; - VclContainer* mpPrintPermissions; - RadioButton* mpRbPrintNone; - RadioButton* mpRbPrintLowRes; - RadioButton* mpRbPrintHighRes; + VclPtr<VclContainer> mpPrintPermissions; + VclPtr<RadioButton> mpRbPrintNone; + VclPtr<RadioButton> mpRbPrintLowRes; + VclPtr<RadioButton> mpRbPrintHighRes; - VclContainer* mpChangesAllowed; - RadioButton* mpRbChangesNone; - RadioButton* mpRbChangesInsDel; - RadioButton* mpRbChangesFillForm; - RadioButton* mpRbChangesComment; - RadioButton* mpRbChangesAnyNoCopy; + VclPtr<VclContainer> mpChangesAllowed; + VclPtr<RadioButton> mpRbChangesNone; + VclPtr<RadioButton> mpRbChangesInsDel; + VclPtr<RadioButton> mpRbChangesFillForm; + VclPtr<RadioButton> mpRbChangesComment; + VclPtr<RadioButton> mpRbChangesAnyNoCopy; - VclContainer* mpContent; - CheckBox* mpCbEnableCopy; - CheckBox* mpCbEnableAccessibility; + VclPtr<VclContainer> mpContent; + VclPtr<CheckBox> mpCbEnableCopy; + VclPtr<CheckBox> mpCbEnableAccessibility; OUString msUserPwdTitle; @@ -372,6 +375,7 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabSecurityPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -384,15 +388,15 @@ public: //class to implement the relative link stuff class ImpPDFTabLinksPage : public SfxTabPage { - CheckBox* m_pCbExprtBmkrToNmDst; - CheckBox* m_pCbOOoToPDFTargets; - CheckBox* m_pCbExportRelativeFsysLinks; + VclPtr<CheckBox> m_pCbExprtBmkrToNmDst; + VclPtr<CheckBox> m_pCbOOoToPDFTargets; + VclPtr<CheckBox> m_pCbExportRelativeFsysLinks; - RadioButton* m_pRbOpnLnksDefault; + VclPtr<RadioButton> m_pRbOpnLnksDefault; bool mbOpnLnksDefaultUserState; - RadioButton* m_pRbOpnLnksLaunch; + VclPtr<RadioButton> m_pRbOpnLnksLaunch; bool mbOpnLnksLaunchUserState; - RadioButton* m_pRbOpnLnksBrowser; + VclPtr<RadioButton> m_pRbOpnLnksBrowser; bool mbOpnLnksBrowserUserState; DECL_LINK( ClickRbOpnLnksDefaultHdl, void* ); @@ -403,6 +407,7 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabLinksPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); @@ -415,14 +420,14 @@ public: //class to implement the digital signing class ImpPDFTabSigningPage : public SfxTabPage { - Edit* mpEdSignCert; - PushButton* mpPbSignCertSelect; - PushButton* mpPbSignCertClear; - Edit* mpEdSignPassword; - Edit* mpEdSignLocation; - Edit* mpEdSignContactInfo; - Edit* mpEdSignReason; - ListBox* mpLBSignTSA; + VclPtr<Edit> mpEdSignCert; + VclPtr<PushButton> mpPbSignCertSelect; + VclPtr<PushButton> mpPbSignCertClear; + VclPtr<Edit> mpEdSignPassword; + VclPtr<Edit> mpEdSignLocation; + VclPtr<Edit> mpEdSignContactInfo; + VclPtr<Edit> mpEdSignReason; + VclPtr<ListBox> mpLBSignTSA; com::sun::star::uno::Reference< com::sun::star::security::XCertificate > maSignCertificate; DECL_LINK( ClickmaPbSignCertSelect, void* ); @@ -434,6 +439,7 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabSigningPage(); + virtual void dispose() SAL_OVERRIDE; static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index 9db0eb60f8a7..0c5c9b4b9d0d 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -125,7 +125,7 @@ Dialog* PDFDialog::createDialog( vcl::Window* pParent ) void PDFDialog::executedDialog( sal_Int16 nExecutionResult ) { if( nExecutionResult && m_pDialog ) - maFilterData = static_cast< ImpPDFTabDialog* >( m_pDialog )->GetFilterData(); + maFilterData = static_cast< ImpPDFTabDialog* >( m_pDialog.get() )->GetFilterData(); destroyDialog(); } diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index 3e1349bf54f2..9605032b0981 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -131,8 +131,8 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) class FocusWindowWaitCursor { - vcl::Window* m_pFocusWindow; - public: + VclPtr<vcl::Window> m_pFocusWindow; +public: FocusWindowWaitCursor() : m_pFocusWindow( Application::GetFocusWindow() ) { diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx index fe58a3a7652a..0420570004f2 100644 --- a/filter/source/svg/svgdialog.cxx +++ b/filter/source/svg/svgdialog.cxx @@ -155,7 +155,7 @@ Dialog* SVGDialog::createDialog( vcl::Window* pParent ) void SVGDialog::executedDialog( sal_Int16 nExecutionResult ) { if( nExecutionResult && m_pDialog ) - maFilterData = static_cast< ImpSVGDialog* >( m_pDialog )->GetFilterData(); + maFilterData = static_cast< ImpSVGDialog* >( m_pDialog.get() )->GetFilterData(); destroyDialog(); } diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index fd570b7ef2c5..11e6f7171597 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -107,7 +107,7 @@ private: com::sun::star::uno::Reference<com::sun::star::awt::XWindow> mxParent; /// parent window com::sun::star::uno::Reference< XComponentContext > mxContext; - XMLFilterSettingsDialog* mpDialog; + VclPtr<XMLFilterSettingsDialog> mpDialog; }; @@ -266,11 +266,7 @@ void SAL_CALL XMLFilterDialogComponent::disposing() { ::SolarMutexGuard aGuard; - if( mpDialog ) - { - delete mpDialog; - mpDialog = NULL; - } + mpDialog.clear(); if (pXSLTResMgr) { @@ -328,7 +324,7 @@ sal_Int16 SAL_CALL XMLFilterDialogComponent::execute( ) throw(RuntimeException, pXSLTResMgr = ResMgr::CreateResMgr( "xsltdlg", Application::GetSettings().GetUILanguageTag() ); } - if( NULL == mpDialog ) + if( nullptr == mpDialog ) { vcl::Window* pParent = DIALOG_NO_PARENT; if (mxParent.is()) diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 9186fc888e04..5e88100b2823 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -103,7 +103,24 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent, } } +XMLFilterSettingsDialog::~XMLFilterSettingsDialog() +{ + dispose(); +} +void XMLFilterSettingsDialog::dispose() +{ + m_pFilterListBox.clear(); + m_pCtrlFilterList.clear(); + m_pPBNew.clear(); + m_pPBEdit.clear(); + m_pPBTest.clear(); + m_pPBDelete.clear(); + m_pPBSave.clear(); + m_pPBOpen.clear(); + m_pPBClose.clear(); + ModelessDialog::dispose(); +} IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, PushButton *, pButton ) { @@ -1404,8 +1421,9 @@ SvxPathControl::~SvxPathControl() void SvxPathControl::dispose() { - delete m_pFocusCtrl; - delete m_pHeaderBar; + m_pVBox.clear(); + m_pFocusCtrl.clear(); + m_pHeaderBar.clear(); vcl::Window::dispose(); } @@ -1452,7 +1470,16 @@ XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl m_pHeaderBar->Show(); } +XMLFilterListBox::~XMLFilterListBox() +{ + dispose(); +} +void XMLFilterListBox::dispose() +{ + m_pHeaderBar.clear(); + SvTabListBox::dispose(); +} void XMLFilterListBox::Paint( const Rectangle& rRect ) { diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index beadad3609b8..df26aaf95685 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -39,9 +39,9 @@ class SvxPathControl : public vcl::Window { private: bool bHasBeenShown; - VclVBox* m_pVBox; - HeaderBar* m_pHeaderBar; - XMLFilterListBox* m_pFocusCtrl; + VclPtr<VclVBox> m_pVBox; + VclPtr<HeaderBar> m_pHeaderBar; + VclPtr<XMLFilterListBox> m_pFocusCtrl; protected: virtual void Resize() SAL_OVERRIDE; virtual Size GetOptimalSize() const SAL_OVERRIDE; @@ -60,7 +60,7 @@ class HeaderBar; class XMLFilterListBox : public SvTabListBox { private: - HeaderBar* m_pHeaderBar; + VclPtr<HeaderBar> m_pHeaderBar; DECL_LINK( TabBoxScrollHdl_Impl, SvTabListBox* ); DECL_LINK( HeaderEndDrag_Impl, HeaderBar* ); @@ -69,6 +69,8 @@ private: public: XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl); + virtual ~XMLFilterListBox(); + virtual void dispose() SAL_OVERRIDE; /** adds a new filter info entry to the ui filter list */ void addFilterEntry( const filter_info_impl* pInfo ); @@ -85,6 +87,8 @@ class XMLFilterSettingsDialog : public ModelessDialog public: XMLFilterSettingsDialog(vcl::Window* pParent, const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext); + virtual ~XMLFilterSettingsDialog(); + virtual void dispose() SAL_OVERRIDE; DECL_LINK(ClickHdl_Impl, PushButton * ); DECL_LINK(SelectionChangedHdl_Impl, void * ); @@ -125,15 +129,15 @@ private: std::vector< filter_info_impl* > maFilterVector; - XMLFilterListBox* m_pFilterListBox; - SvxPathControl* m_pCtrlFilterList; - PushButton* m_pPBNew; - PushButton* m_pPBEdit; - PushButton* m_pPBTest; - PushButton* m_pPBDelete; - PushButton* m_pPBSave; - PushButton* m_pPBOpen; - CloseButton* m_pPBClose; + VclPtr<XMLFilterListBox> m_pFilterListBox; + VclPtr<SvxPathControl> m_pCtrlFilterList; + VclPtr<PushButton> m_pPBNew; + VclPtr<PushButton> m_pPBEdit; + VclPtr<PushButton> m_pPBTest; + VclPtr<PushButton> m_pPBDelete; + VclPtr<PushButton> m_pPBSave; + VclPtr<PushButton> m_pPBOpen; + VclPtr<CloseButton> m_pPBClose; bool m_bIsClosable; diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index 3c286b649c12..ea5a5022a738 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -80,9 +80,11 @@ XMLFilterTabDialog::~XMLFilterTabDialog() void XMLFilterTabDialog::dispose() { - delete mpBasicPage; - delete mpXSLTPage; + mpBasicPage.clear(); + mpXSLTPage.clear(); delete mpNewInfo; + m_pTabCtrl.clear(); + m_pOKBtn.clear(); TabDialog::dispose(); } diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.hxx b/filter/source/xsltdialog/xmlfiltertabdialog.hxx index c07610ed34c4..221b704bb050 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.hxx @@ -54,14 +54,14 @@ private: const filter_info_impl* mpOldInfo; filter_info_impl* mpNewInfo; - TabControl* m_pTabCtrl; - OKButton* m_pOKBtn; + VclPtr<TabControl> m_pTabCtrl; + VclPtr<OKButton> m_pOKBtn; sal_Int16 m_nBasicPageId; sal_Int16 m_nXSLTPageId; - XMLFilterTabPageBasic* mpBasicPage; - XMLFilterTabPageXSLT* mpXSLTPage; + VclPtr<XMLFilterTabPageBasic> mpBasicPage; + VclPtr<XMLFilterTabPageXSLT> mpXSLTPage; }; diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx index fb1d35ac2599..3b509e451ede 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx @@ -44,7 +44,19 @@ XMLFilterTabPageBasic::XMLFilterTabPageBasic(vcl::Window* pParent) XMLFilterTabPageBasic::~XMLFilterTabPageBasic() { + dispose(); } + +void XMLFilterTabPageBasic::dispose() +{ + m_pEDFilterName.clear(); + m_pCBApplication.clear(); + m_pEDInterfaceName.clear(); + m_pEDExtension.clear(); + m_pEDDescription.clear(); + TabPage::dispose(); +} + static OUString checkExtensions( const OUString& rExtensions ) { const sal_Unicode* pSource = rExtensions.getStr(); diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx index 13d38d11e046..ac3876c868b8 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx +++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx @@ -34,6 +34,7 @@ class XMLFilterTabPageBasic : public TabPage public: XMLFilterTabPageBasic(vcl::Window* pParent); virtual ~XMLFilterTabPageBasic(); + virtual void dispose() SAL_OVERRIDE; bool FillInfo( filter_info_impl* pInfo ); void SetInfo(const filter_info_impl* pInfo); @@ -41,11 +42,11 @@ public: static OUString decodeComment( const OUString& rComment ); static OUString encodeComment( const OUString& rComment ); - Edit* m_pEDFilterName; - ComboBox* m_pCBApplication; - Edit* m_pEDInterfaceName; - Edit* m_pEDExtension; - VclMultiLineEdit* m_pEDDescription; + VclPtr<Edit> m_pEDFilterName; + VclPtr<ComboBox> m_pCBApplication; + VclPtr<Edit> m_pEDInterfaceName; + VclPtr<Edit> m_pEDExtension; + VclPtr<VclMultiLineEdit> m_pEDDescription; }; #endif diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx index a9d1cae94360..e9d0de29f611 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx @@ -58,6 +58,20 @@ XMLFilterTabPageXSLT::XMLFilterTabPageXSLT( vcl::Window* pParent) : XMLFilterTabPageXSLT::~XMLFilterTabPageXSLT() { + dispose(); +} + +void XMLFilterTabPageXSLT::dispose() +{ + m_pEDDocType.clear(); + m_pEDExportXSLT.clear(); + m_pPBExprotXSLT.clear(); + m_pEDImportXSLT.clear(); + m_pPBImportXSLT.clear(); + m_pEDImportTemplate.clear(); + m_pPBImportTemplate.clear(); + m_pCBNeedsXSLT2.clear(); + TabPage::dispose(); } bool XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo ) diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx index 01f36d518a7e..09c110fdb504 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx @@ -35,6 +35,7 @@ class XMLFilterTabPageXSLT : public TabPage public: XMLFilterTabPageXSLT( vcl::Window* pParent); virtual ~XMLFilterTabPageXSLT(); + virtual void dispose() SAL_OVERRIDE; bool FillInfo( filter_info_impl* pInfo ); void SetInfo(const filter_info_impl* pInfo); @@ -42,18 +43,18 @@ public: DECL_LINK( ClickBrowseHdl_Impl, PushButton * ); - Edit* m_pEDDocType; + VclPtr<Edit> m_pEDDocType; - SvtURLBox* m_pEDExportXSLT; - PushButton* m_pPBExprotXSLT; + VclPtr<SvtURLBox> m_pEDExportXSLT; + VclPtr<PushButton> m_pPBExprotXSLT; - SvtURLBox* m_pEDImportXSLT; - PushButton* m_pPBImportXSLT; + VclPtr<SvtURLBox> m_pEDImportXSLT; + VclPtr<PushButton> m_pPBImportXSLT; - SvtURLBox* m_pEDImportTemplate; - PushButton* m_pPBImportTemplate; + VclPtr<SvtURLBox> m_pEDImportTemplate; + VclPtr<PushButton> m_pPBImportTemplate; - CheckBox* m_pCBNeedsXSLT2; + VclPtr<CheckBox> m_pCBNeedsXSLT2; private: void SetURL( SvtURLBox *rURLBox, const OUString& rURL ); diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index 5db2fac635f7..364a04881bb3 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -79,7 +79,7 @@ public: // lang::XEventListener virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw (RuntimeException, std::exception) SAL_OVERRIDE; private: - XMLFilterTestDialog* mpDialog; + VclPtr<XMLFilterTestDialog> mpDialog; }; GlobalEventListenerImpl::GlobalEventListenerImpl( XMLFilterTestDialog* pDialog ) @@ -194,6 +194,20 @@ void XMLFilterTestDialog::dispose() } delete m_pFilterInfo; + m_pExport.clear(); + m_pFTExportXSLTFile.clear(); + m_pPBExportBrowse.clear(); + m_pPBCurrentDocument.clear(); + m_pFTNameOfCurrentFile.clear(); + m_pImport.clear(); + m_pFTImportXSLTFile.clear(); + m_pFTImportTemplate.clear(); + m_pFTImportTemplateFile.clear(); + m_pCBXDisplaySource.clear(); + m_pPBImportBrowse.clear(); + m_pPBRecentFile.clear(); + m_pFTNameOfRecentFile.clear(); + m_pPBClose.clear(); ModalDialog::dispose(); } diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.hxx b/filter/source/xsltdialog/xmlfiltertestdialog.hxx index 776d7bc792f5..3d69341fec30 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.hxx @@ -66,21 +66,21 @@ private: OUString m_sImportRecentFile; OUString m_sExportRecentFile; - VclContainer* m_pExport; - FixedText* m_pFTExportXSLTFile; - PushButton* m_pPBExportBrowse; - PushButton* m_pPBCurrentDocument; - FixedText* m_pFTNameOfCurrentFile; - - VclContainer* m_pImport; - FixedText* m_pFTImportXSLTFile; - FixedText* m_pFTImportTemplate; - FixedText* m_pFTImportTemplateFile; - CheckBox* m_pCBXDisplaySource; - PushButton* m_pPBImportBrowse; - PushButton* m_pPBRecentFile; - FixedText* m_pFTNameOfRecentFile; - CloseButton* m_pPBClose; + VclPtr<VclContainer> m_pExport; + VclPtr<FixedText> m_pFTExportXSLTFile; + VclPtr<PushButton> m_pPBExportBrowse; + VclPtr<PushButton> m_pPBCurrentDocument; + VclPtr<FixedText> m_pFTNameOfCurrentFile; + + VclPtr<VclContainer> m_pImport; + VclPtr<FixedText> m_pFTImportXSLTFile; + VclPtr<FixedText> m_pFTImportTemplate; + VclPtr<FixedText> m_pFTImportTemplateFile; + VclPtr<CheckBox> m_pCBXDisplaySource; + VclPtr<PushButton> m_pPBImportBrowse; + VclPtr<PushButton> m_pPBRecentFile; + VclPtr<FixedText> m_pFTNameOfRecentFile; + VclPtr<CloseButton> m_pPBClose; filter_info_impl* m_pFilterInfo; |