diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 11:41:31 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 15:08:48 +0100 |
commit | e8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch) | |
tree | b322529f4a54a6427862cb20cb4cf87fb6a5d065 /xmlsecurity | |
parent | 2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff) | |
parent | 0cde74f788a054fa2b65107a030dd463b8d11c7a (diff) |
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.
Conflicts:
accessibility/source/extended/accessiblelistbox.cxx
accessibility/source/standard/vclxaccessiblecombobox.cxx
accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
accessibility/source/standard/vclxaccessiblelistbox.cxx
accessibility/source/standard/vclxaccessibletextfield.cxx
basctl/source/basicide/basidesh.cxx
cui/source/inc/chardlg.hxx
cui/source/tabpages/tpbitmap.cxx
dbaccess/source/ui/dlg/UserAdmin.cxx
dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
extensions/source/propctrlr/propertyeditor.hxx
extensions/source/scanner/sanedlg.cxx
filter/source/pdf/impdialog.cxx
include/sfx2/mgetempl.hxx
include/sfx2/sidebar/SidebarToolBox.hxx
include/sfx2/viewsh.hxx
include/svtools/brwbox.hxx
include/svtools/filectrl.hxx
include/svtools/scrwin.hxx
include/svx/dlgctrl.hxx
include/svx/sidebar/Popup.hxx
include/svx/sidebar/PopupContainer.hxx
include/svx/sidebar/PopupControl.hxx
include/svx/sidebar/SidebarDialControl.hxx
include/svx/sidebar/ValueSetWithTextControl.hxx
sc/source/ui/condformat/condformatdlgentry.cxx
sc/source/ui/navipi/navipi.cxx
sc/source/ui/sidebar/CellBorderStyleControl.hxx
sd/source/ui/animations/CustomAnimationDialog.cxx
sd/source/ui/inc/DrawViewShell.hxx
sd/source/ui/inc/Ruler.hxx
sd/source/ui/inc/SlideSorter.hxx
sd/source/ui/inc/ViewTabBar.hxx
sd/source/ui/inc/Window.hxx
sd/source/ui/inc/morphdlg.hxx
sd/source/ui/inc/sdpreslt.hxx
sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
sd/source/ui/sidebar/LayoutMenu.hxx
sd/source/ui/sidebar/MasterPagesSelector.hxx
sd/source/ui/sidebar/NavigatorWrapper.hxx
sd/source/ui/sidebar/PanelBase.hxx
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
sd/source/ui/slideshow/showwindow.hxx
sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
sd/source/ui/view/ViewShellBase.cxx
sd/source/ui/view/drviewsa.cxx
sfx2/source/appl/fileobj.hxx
sfx2/source/appl/opengrf.cxx
sfx2/source/control/thumbnailviewacc.hxx
sfx2/source/dialog/securitypage.cxx
sfx2/source/dialog/templdlg.cxx
sfx2/source/doc/docinsert.cxx
sfx2/source/doc/guisaveas.cxx
sfx2/source/inc/alienwarn.hxx
sfx2/source/sidebar/Deck.cxx
sfx2/source/sidebar/Deck.hxx
sfx2/source/sidebar/DeckTitleBar.cxx
sfx2/source/sidebar/DeckTitleBar.hxx
sfx2/source/sidebar/MenuButton.cxx
sfx2/source/sidebar/MenuButton.hxx
sfx2/source/sidebar/Panel.cxx
sfx2/source/sidebar/Panel.hxx
sfx2/source/sidebar/PanelTitleBar.hxx
sfx2/source/sidebar/SidebarDockingWindow.hxx
sfx2/source/sidebar/SidebarToolBox.cxx
sfx2/source/sidebar/TabBar.hxx
sfx2/source/sidebar/TabItem.cxx
sfx2/source/sidebar/TabItem.hxx
sfx2/source/sidebar/TitleBar.hxx
sfx2/source/toolbox/imgmgr.cxx
starmath/inc/edit.hxx
starmath/inc/smmod.hxx
starmath/qa/cppunit/test_starmath.cxx
starmath/source/edit.cxx
starmath/source/smmod.cxx
svtools/source/brwbox/brwbox1.cxx
svtools/source/brwbox/datwin.hxx
svtools/source/contnr/fileview.cxx
svtools/source/contnr/simptabl.cxx
svtools/source/control/filectrl.cxx
svtools/source/control/valueimp.hxx
svx/inc/GalleryControl.hxx
svx/source/dialog/dlgctrl.cxx
svx/source/dialog/swframeexample.cxx
svx/source/fmcomp/fmgridif.cxx
svx/source/gallery2/GalleryControl.cxx
svx/source/sidebar/EmptyPanel.hxx
svx/source/sidebar/area/AreaPropertyPanel.hxx
svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
svx/source/sidebar/insert/InsertPropertyPanel.cxx
svx/source/sidebar/insert/InsertPropertyPanel.hxx
svx/source/sidebar/line/LinePropertyPanel.hxx
svx/source/sidebar/line/LineWidthControl.cxx
svx/source/sidebar/line/LineWidthControl.hxx
svx/source/sidebar/line/LineWidthValueSet.hxx
svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
svx/source/sidebar/possize/SidebarDialControl.cxx
svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
svx/source/sidebar/text/TextPropertyPanel.hxx
svx/source/sidebar/tools/PopupContainer.cxx
svx/source/sidebar/tools/PopupControl.cxx
svx/source/sidebar/tools/ValueSetWithTextControl.cxx
svx/source/svdraw/svdfmtf.hxx
svx/source/svdraw/svdibrow.cxx
svx/source/tbxctrls/colrctrl.cxx
svx/source/tbxctrls/tbcontrl.cxx
sw/source/ui/dbui/mmaddressblockpage.cxx
sw/source/ui/dialog/uiregionsw.cxx
sw/source/ui/index/cnttab.cxx
sw/source/uibase/inc/drpcps.hxx
sw/source/uibase/sidebar/PageColumnControl.hxx
sw/source/uibase/sidebar/PageMarginControl.hxx
sw/source/uibase/sidebar/PageOrientationControl.hxx
sw/source/uibase/sidebar/PagePropertyPanel.hxx
sw/source/uibase/sidebar/PageSizeControl.hxx
sw/source/uibase/uiview/view2.cxx
sw/source/uibase/utlui/navipi.cxx
vcl/inc/svdata.hxx
vcl/source/control/combobox.cxx
vcl/source/control/lstbox.cxx
vcl/source/window/dockwin.cxx
vcl/source/window/winproc.cxx
Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/inc/xmlsecurity/certificatechooser.hxx | 7 | ||||
-rw-r--r-- | xmlsecurity/inc/xmlsecurity/certificateviewer.hxx | 41 | ||||
-rw-r--r-- | xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx | 37 | ||||
-rw-r--r-- | xmlsecurity/inc/xmlsecurity/macrosecurity.hxx | 42 | ||||
-rw-r--r-- | xmlsecurity/source/component/documentdigitalsignatures.cxx | 33 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/certificatechooser.cxx | 16 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/certificateviewer.cxx | 78 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 39 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/macrosecurity.cxx | 65 |
9 files changed, 255 insertions, 103 deletions
diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx index f12837a49ca2..353473ca6c8d 100644 --- a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx @@ -48,9 +48,9 @@ private: css::uno::Sequence< css::uno::Reference< css::security::XCertificate > > maCerts; SignatureInformations maCertsToIgnore; - SvSimpleTable* m_pCertLB; - PushButton* m_pViewBtn; - OKButton* m_pOKBtn; + VclPtr<SvSimpleTable> m_pCertLB; + VclPtr<PushButton> m_pViewBtn; + VclPtr<OKButton> m_pOKBtn; bool mbInitialized; @@ -65,6 +65,7 @@ private: public: CertificateChooser( vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const SignatureInformations& rCertsToIgnore ); virtual ~CertificateChooser(); + virtual void dispose() SAL_OVERRIDE; short Execute() SAL_OVERRIDE; diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx index f3eea2ba062d..3f61891bc0fd 100644 --- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx @@ -46,7 +46,7 @@ private: friend class CertificateViewerDetailsTP; friend class CertificateViewerCertPathTP; - TabControl* mpTabCtrl; + VclPtr<TabControl> mpTabCtrl; sal_uInt16 mnGeneralId; sal_uInt16 mnDetailsId; sal_uInt16 mnPathId; @@ -58,16 +58,19 @@ private: public: CertificateViewer( vcl::Window* pParent, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const css::uno::Reference< css::security::XCertificate >& rXCert, bool bCheckForPrivateKey ); virtual ~CertificateViewer(); + virtual void dispose() SAL_OVERRIDE; }; class CertificateViewerTP : public TabPage { protected: - CertificateViewer* mpDlg; + VclPtr<CertificateViewer> mpDlg; public: CertificateViewerTP( vcl::Window* _pParent, const OString& rID, const OUString& rUIXMLDescription, CertificateViewer* _pDlg ); + virtual ~CertificateViewerTP(); + virtual void dispose() SAL_OVERRIDE; void SetTabDlg( CertificateViewer* _pTabDlg ) { mpDlg = _pTabDlg; @@ -77,16 +80,18 @@ public: class CertificateViewerGeneralTP : public CertificateViewerTP { private: - FixedImage* m_pCertImg; - FixedText* m_pHintNotTrustedFI; - FixedText* m_pIssuedToFI; - FixedText* m_pIssuedByFI; - FixedText* m_pValidFromDateFI; - FixedText* m_pValidToDateFI; - FixedImage* m_pKeyImg; - FixedText* m_pHintCorrespPrivKeyFI; + VclPtr<FixedImage> m_pCertImg; + VclPtr<FixedText> m_pHintNotTrustedFI; + VclPtr<FixedText> m_pIssuedToFI; + VclPtr<FixedText> m_pIssuedByFI; + VclPtr<FixedText> m_pValidFromDateFI; + VclPtr<FixedText> m_pValidToDateFI; + VclPtr<FixedImage> m_pKeyImg; + VclPtr<FixedText> m_pHintCorrespPrivKeyFI; public: CertificateViewerGeneralTP( vcl::Window* pParent, CertificateViewer* _pDlg ); + virtual ~CertificateViewerGeneralTP(); + virtual void dispose() SAL_OVERRIDE; virtual void ActivatePage() SAL_OVERRIDE; }; @@ -95,9 +100,9 @@ public: class CertificateViewerDetailsTP : public CertificateViewerTP { private: - SvSimpleTableContainer* m_pElementsLBContainer; - SvSimpleTable* m_pElementsLB; - MultiLineEdit* m_pValueDetails; + VclPtr<SvSimpleTableContainer> m_pElementsLBContainer; + VclPtr<SvSimpleTable> m_pElementsLB; + VclPtr<MultiLineEdit> m_pValueDetails; vcl::Font m_aStdFont; vcl::Font m_aFixedWidthFont; @@ -108,6 +113,7 @@ private: public: CertificateViewerDetailsTP( vcl::Window* pParent, CertificateViewer* _pDlg ); virtual ~CertificateViewerDetailsTP(); + virtual void dispose() SAL_OVERRIDE; virtual void ActivatePage() SAL_OVERRIDE; }; @@ -116,11 +122,11 @@ public: class CertificateViewerCertPathTP : public CertificateViewerTP { private: - SvTreeListBox* mpCertPathLB; - PushButton* mpViewCertPB; - VclMultiLineEdit* mpCertStatusML; + VclPtr<SvTreeListBox> mpCertPathLB; + VclPtr<PushButton> mpViewCertPB; + VclPtr<VclMultiLineEdit> mpCertStatusML; - CertificateViewer* mpParent; + VclPtr<CertificateViewer> mpParent; bool mbFirstActivateDone; Image maCertImage; Image maCertNotValidatedImage; @@ -137,6 +143,7 @@ private: public: CertificateViewerCertPathTP( vcl::Window* pParent, CertificateViewer* _pDlg ); virtual ~CertificateViewerCertPathTP(); + virtual void dispose() SAL_OVERRIDE; virtual void ActivatePage() SAL_OVERRIDE; }; diff --git a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx index c73fc3bbbd3b..a3cdb392bb45 100644 --- a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx @@ -63,24 +63,24 @@ private: DocumentSignatureMode meSignatureMode; css::uno::Sequence < css::uno::Sequence < css::beans::PropertyValue > > m_manifest; - FixedText* m_pHintDocFT; - FixedText* m_pHintBasicFT; - FixedText* m_pHintPackageFT; - SvSimpleTable* m_pSignaturesLB; - FixedImage* m_pSigsValidImg; - FixedText* m_pSigsValidFI; - FixedImage* m_pSigsInvalidImg; - FixedText* m_pSigsInvalidFI; - FixedImage* m_pSigsNotvalidatedImg; - FixedText* m_pSigsNotvalidatedFI; - FixedImage* m_pSigsOldSignatureImg; - FixedText* m_pSigsOldSignatureFI; - - PushButton* m_pViewBtn; - PushButton* m_pAddBtn; - PushButton* m_pRemoveBtn; - - CloseButton* m_pCloseBtn; + VclPtr<FixedText> m_pHintDocFT; + VclPtr<FixedText> m_pHintBasicFT; + VclPtr<FixedText> m_pHintPackageFT; + VclPtr<SvSimpleTable> m_pSignaturesLB; + VclPtr<FixedImage> m_pSigsValidImg; + VclPtr<FixedText> m_pSigsValidFI; + VclPtr<FixedImage> m_pSigsInvalidImg; + VclPtr<FixedText> m_pSigsInvalidFI; + VclPtr<FixedImage> m_pSigsNotvalidatedImg; + VclPtr<FixedText> m_pSigsNotvalidatedFI; + VclPtr<FixedImage> m_pSigsOldSignatureImg; + VclPtr<FixedText> m_pSigsOldSignatureFI; + + VclPtr<PushButton> m_pViewBtn; + VclPtr<PushButton> m_pAddBtn; + VclPtr<PushButton> m_pRemoveBtn; + + VclPtr<CloseButton> m_pCloseBtn; OUString m_sODFVersion; //Signals if the document contains already a document signature. This is only @@ -117,6 +117,7 @@ public: css::uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, bool bReadOnly, const OUString& sODFVersion, bool bHasDocumentSignature); virtual ~DigitalSignaturesDialog(); + virtual void dispose() SAL_OVERRIDE; // Initialize the dialog and the security environment, returns TRUE on success bool Init(); diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx index 2707fe5e2ccd..8f0edfd44e85 100644 --- a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx +++ b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx @@ -47,9 +47,9 @@ private: friend class MacroSecurityLevelTP; friend class MacroSecurityTrustedSourcesTP; - TabControl* m_pTabCtrl; - OKButton* m_pOkBtn; - PushButton* m_pResetBtn; + VclPtr<TabControl> m_pTabCtrl; + VclPtr<OKButton> m_pOkBtn; + VclPtr<PushButton> m_pResetBtn; css::uno::Reference< css::uno::XComponentContext > mxCtx; css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; @@ -58,8 +58,8 @@ private: sal_uInt16 m_nSecLevelId; sal_uInt16 m_nSecTrustId; - MacroSecurityTP* mpLevelTP; - MacroSecurityTP* mpTrustSrcTP; + VclPtr<MacroSecurityTP> mpLevelTP; + VclPtr<MacroSecurityTP> mpTrustSrcTP; DECL_LINK( OkBtnHdl, void* ); public: @@ -67,6 +67,7 @@ public: const css::uno::Reference< css::uno::XComponentContext>& rxCtx, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); virtual ~MacroSecurity(); + virtual void dispose() SAL_OVERRIDE; inline void EnableReset(bool _bEnable = true) { @@ -77,10 +78,12 @@ public: class MacroSecurityTP : public TabPage { protected: - MacroSecurity* mpDlg; + VclPtr<MacroSecurity> mpDlg; public: MacroSecurityTP(vcl::Window* _pParent, const OString& rID, const OUString& rUIXMLDescription, MacroSecurity* _pDlg); + virtual ~MacroSecurityTP(); + virtual void dispose() SAL_OVERRIDE; void SetTabDlg(MacroSecurity* pTabDlg) { @@ -93,10 +96,10 @@ public: class MacroSecurityLevelTP : public MacroSecurityTP { private: - RadioButton* m_pVeryHighRB; - RadioButton* m_pHighRB; - RadioButton* m_pMediumRB; - RadioButton* m_pLowRB; + VclPtr<RadioButton> m_pVeryHighRB; + VclPtr<RadioButton> m_pHighRB; + VclPtr<RadioButton> m_pMediumRB; + VclPtr<RadioButton> m_pLowRB; sal_uInt16 mnCurLevel; @@ -105,6 +108,8 @@ protected: public: MacroSecurityLevelTP( vcl::Window* pParent, MacroSecurity* _pDlg ); + virtual ~MacroSecurityLevelTP(); + virtual void dispose() SAL_OVERRIDE; virtual void ClosePage() SAL_OVERRIDE; }; @@ -113,14 +118,14 @@ public: class MacroSecurityTrustedSourcesTP : public MacroSecurityTP { private: - FixedImage* m_pTrustCertROFI; - SvSimpleTable* m_pTrustCertLB; - PushButton* m_pViewCertPB; - PushButton* m_pRemoveCertPB; - FixedImage* m_pTrustFileROFI; - ListBox* m_pTrustFileLocLB; - PushButton* m_pAddLocPB; - PushButton* m_pRemoveLocPB; + VclPtr<FixedImage> m_pTrustCertROFI; + VclPtr<SvSimpleTable> m_pTrustCertLB; + VclPtr<PushButton> m_pViewCertPB; + VclPtr<PushButton> m_pRemoveCertPB; + VclPtr<FixedImage> m_pTrustFileROFI; + VclPtr<ListBox> m_pTrustFileLocLB; + VclPtr<PushButton> m_pAddLocPB; + VclPtr<PushButton> m_pRemoveLocPB; css::uno::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors; @@ -140,6 +145,7 @@ private: public: MacroSecurityTrustedSourcesTP(vcl::Window* pParent, MacroSecurity* _pDlg); virtual ~MacroSecurityTrustedSourcesTP(); + virtual void dispose() SAL_OVERRIDE; virtual void ActivatePage() SAL_OVERRIDE; virtual void ClosePage() SAL_OVERRIDE; diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index acaac53e3e43..287b5cf50125 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -222,17 +222,18 @@ bool DocumentDigitalSignatures::ImplViewSignatures( DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException, std::exception) { bool bChanges = false; - DigitalSignaturesDialog aSignaturesDialog( - NULL, mxCtx, eMode, bReadOnly, m_sODFVersion, m_bHasDocumentSignature); - bool bInit = aSignaturesDialog.Init(); + ScopedVclPtrInstance<DigitalSignaturesDialog> aSignaturesDialog( + nullptr, mxCtx, eMode, bReadOnly, m_sODFVersion, + m_bHasDocumentSignature); + bool bInit = aSignaturesDialog->Init(); DBG_ASSERT( bInit, "Error initializing security context!" ); if ( bInit ) { - aSignaturesDialog.SetStorage( rxStorage ); - aSignaturesDialog.SetSignatureStream( xSignStream ); - if ( aSignaturesDialog.Execute() ) + aSignaturesDialog->SetStorage( rxStorage ); + aSignaturesDialog->SetSignatureStream( xSignStream ); + if ( aSignaturesDialog->Execute() ) { - if ( aSignaturesDialog.SignaturesChanged() ) + if ( aSignaturesDialog->SignaturesChanged() ) { bChanges = true; // If we have a storage and no stream, we are responsible for commit @@ -246,8 +247,8 @@ bool DocumentDigitalSignatures::ImplViewSignatures( } else { - MessageDialog aBox(NULL, XMLSEC_RES(RID_XMLSECWB_NO_MOZILLA_PROFILE), VCL_MESSAGE_WARNING); - aBox.Execute(); + ScopedVclPtrInstance< MessageDialog > aBox(nullptr, XMLSEC_RES(RID_XMLSECWB_NO_MOZILLA_PROFILE), VCL_MESSAGE_WARNING); + aBox->Execute(); } return bChanges; @@ -386,8 +387,8 @@ void DocumentDigitalSignatures::manageTrustedSources( ) throw (RuntimeException if ( aSignatureHelper.Init() ) xSecEnv = aSignatureHelper.GetSecurityEnvironment(); - MacroSecurity aDlg( NULL, mxCtx, xSecEnv ); - aDlg.Execute(); + ScopedVclPtrInstance< MacroSecurity > aDlg( nullptr, mxCtx, xSecEnv ); + aDlg->Execute(); } void DocumentDigitalSignatures::showCertificate( @@ -401,8 +402,8 @@ void DocumentDigitalSignatures::showCertificate( if ( bInit ) { - CertificateViewer aViewer( NULL, aSignatureHelper.GetSecurityEnvironment(), _Certificate, false ); - aViewer.Execute(); + ScopedVclPtrInstance< CertificateViewer > aViewer( nullptr, aSignatureHelper.GetSecurityEnvironment(), _Certificate, false ); + aViewer->Execute(); } } @@ -441,12 +442,12 @@ Reference< css::security::XCertificate > DocumentDigitalSignatures::chooseCertif if ( aSignatureHelper.Init() ) xSecEnv = aSignatureHelper.GetSecurityEnvironment(); - CertificateChooser aChooser( NULL, mxCtx, xSecEnv, aSignatureHelper.GetSignatureInformations()); + ScopedVclPtrInstance< CertificateChooser > aChooser( nullptr, mxCtx, xSecEnv, aSignatureHelper.GetSignatureInformations()); - if (aChooser.Execute() != RET_OK) + if (aChooser->Execute() != RET_OK) return Reference< css::security::XCertificate >(0); - Reference< css::security::XCertificate > xCert = aChooser.GetSelectedCertificate(); + Reference< css::security::XCertificate > xCert = aChooser->GetSelectedCertificate(); if ( !xCert.is() ) return Reference< css::security::XCertificate >(0); diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 4f822527997b..9c5e28e94b67 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -62,7 +62,7 @@ CertificateChooser::CertificateChooser( vcl::Window* _pParent, uno::Reference< u pSignatures->set_width_request(aControlSize.Width()); pSignatures->set_height_request(aControlSize.Height()); - m_pCertLB = new SvSimpleTable(*pSignatures); + m_pCertLB = VclPtr<SvSimpleTable>::Create(*pSignatures); static long nTabs[] = { 3, 0, 30*nControlWidth/100, 60*nControlWidth/100 }; m_pCertLB->SetTabs( &nTabs[0] ); m_pCertLB->InsertHeaderEntry(get<FixedText>("issuedto")->GetText() + "\t" + get<FixedText>("issuedby")->GetText() @@ -81,7 +81,15 @@ CertificateChooser::CertificateChooser( vcl::Window* _pParent, uno::Reference< u CertificateChooser::~CertificateChooser() { - delete m_pCertLB; + disposeOnce(); +} + +void CertificateChooser::dispose() +{ + m_pCertLB.disposeAndClear(); + m_pViewBtn.clear(); + m_pOKBtn.clear(); + ModalDialog::dispose(); } short CertificateChooser::Execute() @@ -217,8 +225,8 @@ void CertificateChooser::ImplShowCertificateDetails() uno::Reference< css::security::XCertificate > xCert = GetSelectedCertificate(); if( xCert.is() ) { - CertificateViewer aViewer( this, mxSecurityEnvironment, xCert, true ); - aViewer.Execute(); + ScopedVclPtrInstance< CertificateViewer > aViewer( this, mxSecurityEnvironment, xCert, true ); + aViewer->Execute(); } } diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 7a14960be47c..61cbf28f1dae 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -53,17 +53,24 @@ CertificateViewer::CertificateViewer( mnDetailsId = mpTabCtrl->GetPageId("details"); mnPathId = mpTabCtrl->GetPageId("path"); - mpTabCtrl->SetTabPage(mnGeneralId, new CertificateViewerGeneralTP( mpTabCtrl, this)); - mpTabCtrl->SetTabPage(mnDetailsId, new CertificateViewerDetailsTP( mpTabCtrl, this)); - mpTabCtrl->SetTabPage(mnPathId, new CertificateViewerCertPathTP( mpTabCtrl, this)); + mpTabCtrl->SetTabPage(mnGeneralId, VclPtr<CertificateViewerGeneralTP>::Create( mpTabCtrl, this)); + mpTabCtrl->SetTabPage(mnDetailsId, VclPtr<CertificateViewerDetailsTP>::Create( mpTabCtrl, this)); + mpTabCtrl->SetTabPage(mnPathId, VclPtr<CertificateViewerCertPathTP>::Create( mpTabCtrl, this)); mpTabCtrl->SetCurPageId(mnGeneralId); } CertificateViewer::~CertificateViewer() { - delete mpTabCtrl->GetTabPage(mnGeneralId); - delete mpTabCtrl->GetTabPage(mnDetailsId); - delete mpTabCtrl->GetTabPage(mnPathId); + disposeOnce(); +} + +void CertificateViewer::dispose() +{ + mpTabCtrl->GetTabPage(mnGeneralId)->disposeOnce(); + mpTabCtrl->GetTabPage(mnDetailsId)->disposeOnce(); + mpTabCtrl->GetTabPage(mnPathId)->disposeOnce(); + mpTabCtrl.clear(); + TabDialog::dispose(); } CertificateViewerTP::CertificateViewerTP( vcl::Window* _pParent, const OString& rID, @@ -73,6 +80,18 @@ CertificateViewerTP::CertificateViewerTP( vcl::Window* _pParent, const OString& { } +CertificateViewerTP::~CertificateViewerTP() +{ + disposeOnce(); +} + +void CertificateViewerTP::dispose() +{ + mpDlg.clear(); + TabPage::dispose(); +} + + CertificateViewerGeneralTP::CertificateViewerGeneralTP( vcl::Window* _pParent, CertificateViewer* _pDlg ) :CertificateViewerTP ( _pParent, "CertGeneral", "xmlsec/ui/certgeneral.ui", _pDlg ) { @@ -130,6 +149,24 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( vcl::Window* _pParent, C } } +CertificateViewerGeneralTP::~CertificateViewerGeneralTP() +{ + disposeOnce(); +} + +void CertificateViewerGeneralTP::dispose() +{ + m_pCertImg.clear(); + m_pHintNotTrustedFI.clear(); + m_pIssuedToFI.clear(); + m_pIssuedByFI.clear(); + m_pValidFromDateFI.clear(); + m_pValidToDateFI.clear(); + m_pKeyImg.clear(); + m_pHintCorrespPrivKeyFI.clear(); + CertificateViewerTP::dispose(); +} + void CertificateViewerGeneralTP::ActivatePage() { @@ -180,7 +217,7 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C { get( m_pValueDetails, "valuedetails" ); get( m_pElementsLBContainer, "tablecontainer" ); - m_pElementsLB = new SvSimpleTable( *m_pElementsLBContainer ); + m_pElementsLB = VclPtr<SvSimpleTable>::Create( *m_pElementsLBContainer ); m_aStdFont = m_pValueDetails->GetControlFont(); WinBits nStyle = m_pElementsLB->GetStyle(); @@ -256,8 +293,16 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C CertificateViewerDetailsTP::~CertificateViewerDetailsTP() { + disposeOnce(); +} + +void CertificateViewerDetailsTP::dispose() +{ Clear(); - delete m_pElementsLB; + m_pElementsLB.disposeAndClear(); + m_pElementsLBContainer.clear(); + m_pValueDetails.clear(); + CertificateViewerTP::dispose(); } void CertificateViewerDetailsTP::ActivatePage() @@ -327,7 +372,17 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( vcl::Window* _pParent, CertificateViewerCertPathTP::~CertificateViewerCertPathTP() { + disposeOnce(); +} + +void CertificateViewerCertPathTP::dispose() +{ Clear(); + mpCertPathLB.clear(); + mpViewCertPB.clear(); + mpCertStatusML.clear(); + mpParent.clear(); + CertificateViewerTP::dispose(); } void CertificateViewerCertPathTP::ActivatePage() @@ -370,8 +425,11 @@ IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl) SvTreeListEntry* pEntry = mpCertPathLB->FirstSelected(); if( pEntry ) { - CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert, false ); - aViewer.Execute(); + ScopedVclPtrInstance< CertificateViewer > aViewer( + this, mpDlg->mxSecurityEnvironment, + static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert, + false ); + aViewer->Execute(); } return 0; diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 6f5db4db79af..9673a3c617f1 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -198,7 +198,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( pSignatures->set_width_request(aControlSize.Width()); pSignatures->set_height_request(aControlSize.Height()); - m_pSignaturesLB = new SvSimpleTable(*pSignatures); + m_pSignaturesLB = VclPtr<SvSimpleTable>::Create(*pSignatures); // #i48253# the tablistbox needs its own unique id m_pSignaturesLB->Window::SetUniqueId( HID_XMLSEC_TREE_SIGNATURESDLG ); static long aTabs[] = { 4, 0, 6*nControlWidth/100, 36*nControlWidth/100, 74*nControlWidth/100 }; @@ -235,7 +235,28 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( DigitalSignaturesDialog::~DigitalSignaturesDialog() { - delete m_pSignaturesLB; + disposeOnce(); +} + +void DigitalSignaturesDialog::dispose() +{ + m_pSignaturesLB.disposeAndClear(); + m_pHintDocFT.clear(); + m_pHintBasicFT.clear(); + m_pHintPackageFT.clear(); + m_pSigsValidImg.clear(); + m_pSigsValidFI.clear(); + m_pSigsInvalidImg.clear(); + m_pSigsInvalidFI.clear(); + m_pSigsNotvalidatedImg.clear(); + m_pSigsNotvalidatedFI.clear(); + m_pSigsOldSignatureImg.clear(); + m_pSigsOldSignatureFI.clear(); + m_pViewBtn.clear(); + m_pAddBtn.clear(); + m_pRemoveBtn.clear(); + m_pCloseBtn.clear(); + ModalDialog::dispose(); } bool DigitalSignaturesDialog::Init() @@ -292,8 +313,8 @@ bool DigitalSignaturesDialog::canAddRemove() if ( (!bSave1_1 && bDoc1_1) || (bSave1_1 && bDoc1_1) ) { //#4 - MessageDialog err(NULL, XMLSEC_RES(STR_XMLSECDLG_OLD_ODF_FORMAT)); - err.Execute(); + ScopedVclPtrInstance< MessageDialog > err(nullptr, XMLSEC_RES(STR_XMLSECDLG_OLD_ODF_FORMAT)); + err->Execute(); ret = false; } @@ -411,10 +432,10 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, AddButtonHdl) uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); - CertificateChooser aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations ); - if ( aChooser.Execute() == RET_OK ) + ScopedVclPtrInstance< CertificateChooser > aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations ); + if ( aChooser->Execute() == RET_OK ) { - uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate(); + uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser->GetSelectedCertificate(); if ( !xCert.is() ) { SAL_WARN( "xmlsecurity.dialogs", "no certificate selected" ); @@ -746,8 +767,8 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() DBG_ASSERT( xCert.is(), "Error getting cCertificate!" ); if ( xCert.is() ) { - CertificateViewer aViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, false ); - aViewer.Execute(); + ScopedVclPtrInstance< CertificateViewer > aViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, false ); + aViewer->Execute(); } } } diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index c06982339d02..1142b1dfd173 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -69,8 +69,8 @@ MacroSecurity::MacroSecurity( vcl::Window* _pParent, get(m_pResetBtn, "reset"); get(m_pOkBtn, "ok"); - mpLevelTP = new MacroSecurityLevelTP(m_pTabCtrl, this); - mpTrustSrcTP = new MacroSecurityTrustedSourcesTP(m_pTabCtrl, this); + mpLevelTP.reset(VclPtr<MacroSecurityLevelTP>::Create(m_pTabCtrl, this)); + mpTrustSrcTP.reset(VclPtr<MacroSecurityTrustedSourcesTP>::Create(m_pTabCtrl, this)); m_nSecLevelId = m_pTabCtrl->GetPageId("SecurityLevelPage"); m_nSecTrustId = m_pTabCtrl->GetPageId("SecurityTrustPage"); @@ -84,8 +84,19 @@ MacroSecurity::MacroSecurity( vcl::Window* _pParent, MacroSecurity::~MacroSecurity() { - delete m_pTabCtrl->GetTabPage(m_nSecTrustId); - delete m_pTabCtrl->GetTabPage(m_nSecLevelId); + disposeOnce(); +} + +void MacroSecurity::dispose() +{ + m_pTabCtrl->GetTabPage(m_nSecTrustId)->disposeOnce(); + m_pTabCtrl->GetTabPage(m_nSecLevelId)->disposeOnce(); + m_pTabCtrl.clear(); + m_pOkBtn.clear(); + m_pResetBtn.clear(); + mpLevelTP.disposeAndClear(); + mpTrustSrcTP.disposeAndClear(); + TabDialog::dispose(); } MacroSecurityTP::MacroSecurityTP(vcl::Window* _pParent, const OString& rID, @@ -95,6 +106,17 @@ MacroSecurityTP::MacroSecurityTP(vcl::Window* _pParent, const OString& rID, { } +MacroSecurityTP::~MacroSecurityTP() +{ + disposeOnce(); +} + +void MacroSecurityTP::dispose() +{ + mpDlg.clear(); + TabPage::dispose(); +} + MacroSecurityLevelTP::MacroSecurityLevelTP(vcl::Window* _pParent, MacroSecurity* _pDlg) : MacroSecurityTP(_pParent, "SecurityLevelPage", "xmlsec/ui/securitylevelpage.ui", _pDlg) { @@ -148,6 +170,20 @@ MacroSecurityLevelTP::MacroSecurityLevelTP(vcl::Window* _pParent, MacroSecurity* } } +MacroSecurityLevelTP::~MacroSecurityLevelTP() +{ + disposeOnce(); +} + +void MacroSecurityLevelTP::dispose() +{ + m_pVeryHighRB.clear(); + m_pHighRB.clear(); + m_pMediumRB.clear(); + m_pLowRB.clear(); + MacroSecurityTP::dispose(); +} + IMPL_LINK_NOARG(MacroSecurityLevelTP, RadioButtonHdl) { sal_uInt16 nNewLevel = 0; @@ -202,8 +238,8 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, ViewCertPBHdl) if ( xCert.is() ) { - CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, xCert, false ); - aViewer.Execute(); + ScopedVclPtrInstance< CertificateViewer > aViewer( this, mpDlg->mxSecurityEnvironment, xCert, false ); + aViewer->Execute(); } } return 0; @@ -352,7 +388,7 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(vcl::Window* _pPare get(m_pRemoveLocPB, "removefile"); SvSimpleTableContainer *pCertificates = get<SvSimpleTableContainer>("certificates"); - m_pTrustCertLB = new TrustCertLB(*pCertificates); + m_pTrustCertLB.reset(VclPtr<TrustCertLB>::Create(*pCertificates)); static long aTabs[] = { 3, 0, 0, 0 }; m_pTrustCertLB->SetTabs( aTabs ); @@ -394,7 +430,20 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(vcl::Window* _pPare MacroSecurityTrustedSourcesTP::~MacroSecurityTrustedSourcesTP() { - delete m_pTrustCertLB; + disposeOnce(); +} + +void MacroSecurityTrustedSourcesTP::dispose() +{ + m_pTrustCertLB.disposeAndClear(); + m_pTrustCertROFI.clear(); + m_pViewCertPB.clear(); + m_pRemoveCertPB.clear(); + m_pTrustFileROFI.clear(); + m_pTrustFileLocLB.clear(); + m_pAddLocPB.clear(); + m_pRemoveLocPB.clear(); + MacroSecurityTP::dispose(); } void MacroSecurityTrustedSourcesTP::ActivatePage() |