diff options
Diffstat (limited to 'filter/source/pdf')
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 194 | ||||
-rw-r--r-- | filter/source/pdf/impdialog.hxx | 206 | ||||
-rw-r--r-- | filter/source/pdf/pdfdialog.cxx | 14 | ||||
-rw-r--r-- | filter/source/pdf/pdfdialog.hxx | 2 | ||||
-rw-r--r-- | filter/source/pdf/pdffilter.cxx | 4 | ||||
-rw-r--r-- | filter/source/pdf/pdfinteract.cxx | 4 |
6 files changed, 279 insertions, 145 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 9851aa811a7c..af2e7e7c8a73 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -312,6 +312,11 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl) ImpPDFTabDialog::~ImpPDFTabDialog() { + disposeOnce(); +} + +void ImpPDFTabDialog::dispose() +{ //delete the pages, needed because otherwise the child tab pages //don't get destroyed RemoveTabPage(mnGeneralPageId); @@ -320,6 +325,7 @@ ImpPDFTabDialog::~ImpPDFTabDialog() RemoveTabPage(mnLinksPage); RemoveTabPage(mnSecurityPageId); RemoveTabPage(mnSigningPageId); + SfxTabDialog::dispose(); } @@ -546,10 +552,42 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() { + disposeOnce(); } +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( const ImpPDFTabDialog* paParent ) +void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent ) { mpaParent = paParent; @@ -696,10 +734,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) } -SfxTabPage* ImpPDFTabGeneralPage::Create( vcl::Window* pParent, - const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> ImpPDFTabGeneralPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return ( new ImpPDFTabGeneralPage( pParent, *rAttrSet ) ); + return VclPtr<ImpPDFTabGeneralPage>::Create( pParent, *rAttrSet ); } @@ -806,8 +844,8 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl) // if a password was set, inform the user that this will not be used in PDF/A case if( mpCbPDFA1b->IsChecked() && pSecPage && pSecPage->hasPassword() ) { - MessageDialog aBox(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING); - aBox.Execute(); + ScopedVclPtrInstance< MessageDialog > aBox(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING); + aBox->Execute(); } return 0; @@ -844,13 +882,33 @@ ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage(vcl::Window* pParent, const SfxItemSet& ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage() { + disposeOnce(); } +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) +VclPtr<SfxTabPage> ImpPDFTabOpnFtrPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return ( new ImpPDFTabOpnFtrPage( pParent, *rAttrSet ) ); + return VclPtr<ImpPDFTabOpnFtrPage>::Create( pParent, *rAttrSet ); } @@ -999,6 +1057,23 @@ ImpPDFTabViewerPage::ImpPDFTabViewerPage( vcl::Window* pParent, ImpPDFTabViewerPage::~ImpPDFTabViewerPage() { + disposeOnce(); +} + +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*, ) @@ -1007,10 +1082,10 @@ IMPL_LINK( ImpPDFTabViewerPage, ToggleRbBookmarksHdl, void*, ) return 0; } -SfxTabPage* ImpPDFTabViewerPage::Create( vcl::Window* pParent, - const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> ImpPDFTabViewerPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return ( new ImpPDFTabViewerPage( pParent, *rAttrSet ) ); + return VclPtr<ImpPDFTabViewerPage>::Create( pParent, *rAttrSet ); } @@ -1096,13 +1171,38 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(vcl::Window* i_pParent, const SfxIt ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage() { + disposeOnce(); } +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) +VclPtr<SfxTabPage> ImpPDFTabSecurityPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return ( new ImpPDFTabSecurityPage( pParent, *rAttrSet ) ); + return VclPtr<ImpPDFTabSecurityPage>::Create( pParent, *rAttrSet ); } @@ -1191,17 +1291,17 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParen IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl) { - SfxPasswordDialog aPwdDialog( this, &msUserPwdTitle ); - aPwdDialog.SetMinLen( 0 ); - aPwdDialog.ShowMinLengthText(false); - aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); - aPwdDialog.SetText(msStrSetPwd); - aPwdDialog.SetGroup2Text(msOwnerPwdTitle); - aPwdDialog.AllowAsciiOnly(); - if( aPwdDialog.Execute() == RET_OK ) //OK issued get password and set it + ScopedVclPtrInstance< SfxPasswordDialog > aPwdDialog( this, &msUserPwdTitle ); + aPwdDialog->SetMinLen( 0 ); + aPwdDialog->ShowMinLengthText(false); + aPwdDialog->ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 ); + aPwdDialog->SetText(msStrSetPwd); + aPwdDialog->SetGroup2Text(msOwnerPwdTitle); + aPwdDialog->AllowAsciiOnly(); + if( aPwdDialog->Execute() == RET_OK ) //OK issued get password and set it { - OUString aUserPW( aPwdDialog.GetPassword() ); - OUString aOwnerPW( aPwdDialog.GetPassword2() ); + OUString aUserPW( aPwdDialog->GetPassword() ); + OUString aOwnerPW( aPwdDialog->GetPassword2() ); mbHaveUserPassword = !aUserPW.isEmpty(); mbHaveOwnerPassword = !aOwnerPW.isEmpty(); @@ -1317,13 +1417,24 @@ ImpPDFTabLinksPage::ImpPDFTabLinksPage( vcl::Window* pParent, ImpPDFTabLinksPage::~ImpPDFTabLinksPage() { + disposeOnce(); } +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) +VclPtr<SfxTabPage> ImpPDFTabLinksPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return ( new ImpPDFTabLinksPage( pParent, *rAttrSet ) ); + return VclPtr<ImpPDFTabLinksPage>::Create( pParent, *rAttrSet ); } @@ -1511,9 +1622,17 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE ImplErrorDialog::~ImplErrorDialog() { + disposeOnce(); +} + +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(); } IMPL_LINK_NOARG(ImplErrorDialog, SelectHdl) @@ -1548,6 +1667,19 @@ ImpPDFTabSigningPage::ImpPDFTabSigningPage(vcl::Window* pParent, const SfxItemSe ImpPDFTabSigningPage::~ImpPDFTabSigningPage() { + disposeOnce(); +} + +void ImpPDFTabSigningPage::dispose() +{ + mpEdSignCert.clear(); + mpPbSignCertSelect.clear(); + mpPbSignCertClear.clear(); + mpEdSignPassword.clear(); + mpEdSignLocation.clear(); + mpEdSignContactInfo.clear(); + mpEdSignReason.clear(); + SfxTabPage::dispose(); } IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertSelect ) @@ -1610,10 +1742,10 @@ IMPL_LINK_NOARG( ImpPDFTabSigningPage, SelectLBSignTSA ) return 0; } -SfxTabPage* ImpPDFTabSigningPage::Create( vcl::Window* pParent, - const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> ImpPDFTabSigningPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return ( new ImpPDFTabSigningPage( pParent, *rAttrSet ) ); + return VclPtr<ImpPDFTabSigningPage>::Create( pParent, *rAttrSet ); } diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index dc4a78789ce3..dc2f9d35d0fa 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -56,13 +56,14 @@ public: class ImplErrorDialog : public MessageDialog { - ListBox* m_pErrors; - FixedText* m_pExplanation; + VclPtr<ListBox> m_pErrors; + VclPtr<FixedText> m_pExplanation; DECL_LINK(SelectHdl, void *); public: ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& ); virtual ~ImplErrorDialog(); + virtual void dispose() SAL_OVERRIDE; }; class ImpPDFTabSecurityPage; @@ -171,6 +172,7 @@ public: const css::uno::Reference< XComponent >& rDoc ); virtual ~ImpPDFTabDialog(); + virtual void dispose() SAL_OVERRIDE; Sequence< PropertyValue > GetFilterData(); @@ -189,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* ); @@ -241,36 +243,37 @@ public: ImpPDFTabGeneralPage( vcl::Window* pParent, const SfxItemSet& rSet ); - virtual ~ImpPDFTabGeneralPage(); - static SfxTabPage* Create( vcl::Window* pParent, + virtual void dispose() SAL_OVERRIDE; + + static VclPtr<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; @@ -282,7 +285,8 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabOpnFtrPage(); - static SfxTabPage* Create( vcl::Window* pParent, + virtual void dispose() SAL_OVERRIDE; + static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); @@ -292,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: @@ -315,7 +319,8 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabViewerPage(); - static SfxTabPage* Create( vcl::Window* pParent, + virtual void dispose() SAL_OVERRIDE; + static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); @@ -325,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; @@ -370,7 +375,8 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabSecurityPage(); - static SfxTabPage* Create( vcl::Window* pParent, + virtual void dispose() SAL_OVERRIDE; + static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); @@ -382,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* ); @@ -401,7 +407,8 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabLinksPage(); - static SfxTabPage* Create( vcl::Window* pParent, + virtual void dispose() SAL_OVERRIDE; + static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); @@ -413,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* ); @@ -432,7 +439,8 @@ public: const SfxItemSet& rSet ); virtual ~ImpPDFTabSigningPage(); - static SfxTabPage* Create( vcl::Window* pParent, + virtual void dispose() SAL_OVERRIDE; + static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ); void GetFilterConfigItem( ImpPDFTabDialog* paParent); diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index 93de5b4e9bc7..02042739e549 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -107,17 +107,11 @@ Sequence< OUString > SAL_CALL PDFDialog::getSupportedServiceNames() -Dialog* PDFDialog::createDialog( vcl::Window* pParent ) +VclPtr<Dialog> PDFDialog::createDialog( vcl::Window* pParent ) { - Dialog* pRet = NULL; - if( mxSrcDoc.is() ) - { - ImpPDFTabDialog* pDlg = new ImpPDFTabDialog( pParent, maFilterData, mxSrcDoc ); - pRet = pDlg; - } - - return pRet; + return VclPtr<ImpPDFTabDialog>::Create( pParent, maFilterData, mxSrcDoc ); + return VclPtr<Dialog>(); } @@ -125,7 +119,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/pdfdialog.hxx b/filter/source/pdf/pdfdialog.hxx index 85135fa24079..e343902e2481 100644 --- a/filter/source/pdf/pdfdialog.hxx +++ b/filter/source/pdf/pdfdialog.hxx @@ -51,7 +51,7 @@ protected: virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException, std::exception) SAL_OVERRIDE; virtual OUString SAL_CALL getImplementationName() throw (RuntimeException, std::exception) SAL_OVERRIDE; virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException, std::exception) SAL_OVERRIDE; - virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE; virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE; virtual Reference< XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(RuntimeException, std::exception) SAL_OVERRIDE; virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; 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/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx index 579d9ef3fb40..d01281211ebf 100644 --- a/filter/source/pdf/pdfinteract.cxx +++ b/filter/source/pdf/pdfinteract.cxx @@ -53,8 +53,8 @@ sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Referen sal_Int32 nCodes = aExc.ErrorCodes.getLength(); for( sal_Int32 i = 0; i < nCodes; i++ ) aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] ); - ImplErrorDialog aDlg( aCodes ); - aDlg.Execute(); + ScopedVclPtrInstance< ImplErrorDialog > aDlg( aCodes ); + aDlg->Execute(); bHandled = true; } return bHandled; |