diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-03 12:02:36 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-06-06 20:26:54 +0000 |
commit | 3f72218069f6f78a3ba21c40f00240d78cbe65c7 (patch) | |
tree | bd0781953ae45d3dcbfa3994641e755f2c5c0f73 /sfx2 | |
parent | 87ac0b1e75a880a68ecb748bd4b34ae5a3d2ae98 (diff) |
Apply new VclPtr clang plugin to catch potential problems.
Omit the plugin, and sw's FrameControlsManager for now.
Change-Id: Ifb98a2e6e03a9d099efc1668305b96bd9142ca5f
Reviewed-on: https://gerrit.libreoffice.org/16117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/openuriexternally.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/taskpane.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/sidebar/ControlFactory.cxx | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index beb4deed9ec3..77c412bff0e9 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -53,10 +53,10 @@ bool sfx2::openUriExternally( throw; } SolarMutexGuard g; - MessageDialog( + ScopedVclPtrInstance<MessageDialog> eb( SfxGetpApp()->GetTopWindow(), - SfxResId(STR_NO_WEBBROWSER_FOUND)). - Execute(); + SfxResId(STR_NO_WEBBROWSER_FOUND)); + eb->Execute(); } return false; } diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index d7f822d028a7..2039b5d6104f 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -518,7 +518,7 @@ namespace sfx2 :m_rAntiImpl( i_rAntiImpl ) ,m_sModuleIdentifier( lcl_identifyModule( i_rDocumentFrame ) ) ,m_xFrame( i_rDocumentFrame ) - ,m_aPanelDeck( new ::svt::ToolPanelDeck(i_rAntiImpl) ) + ,m_aPanelDeck( VclPtr<::svt::ToolPanelDeck>::Create(i_rAntiImpl) ) { m_aPanelDeck->Show(); OnResize(); diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index a3aef2d2a21a..33579954fe9f 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1463,8 +1463,8 @@ bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel, || SignatureState::NOTVALIDATED == nDocumentSignatureState || SignatureState::PARTIAL_OK == nDocumentSignatureState) { - if (MessageDialog(NULL, SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE), - VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() != RET_YES) + if (ScopedVclPtrInstance<MessageDialog>(nullptr, SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE), + VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() != RET_YES) { // the user has decided not to store the document throw task::ErrorCodeIOException( diff --git a/sfx2/source/sidebar/ControlFactory.cxx b/sfx2/source/sidebar/ControlFactory.cxx index d8a49b3dd148..1376f9ee9961 100644 --- a/sfx2/source/sidebar/ControlFactory.cxx +++ b/sfx2/source/sidebar/ControlFactory.cxx @@ -27,12 +27,12 @@ namespace sfx2 { namespace sidebar { VclPtr<CheckBox> ControlFactory::CreateMenuButton (vcl::Window* pParentWindow) { - return VclPtr<CheckBox>(new MenuButton(pParentWindow), SAL_NO_ACQUIRE); + return VclPtr<MenuButton>::Create(pParentWindow); } VclPtr<ImageRadioButton> ControlFactory::CreateTabItem (vcl::Window* pParentWindow) { - return VclPtr<ImageRadioButton>(new TabItem(pParentWindow), SAL_NO_ACQUIRE); + return VclPtr<TabItem>::Create(pParentWindow); } } } // end of namespace sfx2::sidebar |