dbaccess/source/ui/inc/unoadmin.hxx | 1 dbaccess/source/ui/uno/unoadmin.cxx | 11 +---- extensions/source/propctrlr/controlfontdialog.cxx | 11 +---- extensions/source/propctrlr/controlfontdialog.hxx | 1 filter/source/flash/swfdialog.hxx | 9 ++-- filter/source/pdf/pdfdialog.hxx | 5 +- filter/source/svg/svgdialog.hxx | 9 ++-- include/svtools/genericunodialog.hxx | 4 - svtools/source/uno/wizard/unowizard.cxx | 45 ++++++++-------------- 9 files changed, 39 insertions(+), 57 deletions(-)
New commits: commit 538635e089cac31ddf433f650e86de5e2b7f03cc Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Sep 15 09:17:14 2016 +0200 Make OGenericUnoDialog::destoryDialog non-virtual ...it is only ever called: * either from dtors, where the virtual-ness doesn't acutally help (and would trigger loplugin:fragiledestructor if that were enabled) * or, in module filter, from executeDialog members of (final) classes directly derived from OGenericUnODialog without overriding destroyDialog Change-Id: If9a7370385a27952189423e5632b3f01e18ddbb5 diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx index ba952db..4927132 100644 --- a/dbaccess/source/ui/inc/unoadmin.hxx +++ b/dbaccess/source/ui/inc/unoadmin.hxx @@ -53,7 +53,6 @@ protected: virtual ~ODatabaseAdministrationDialog() override; protected: // OGenericUnoDialog overridables - virtual void destroyDialog() override; virtual void implInitialize(const css::uno::Any& _rValue) override; }; diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index f866b60..a7cf467 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -55,13 +55,14 @@ ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XC ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() { - // we do this here cause the base class' call to destroyDialog won't reach us anymore: we're within an dtor, - // so this virtual-method-call the base class does not work, we're already dead then... if (m_pDialog) { ::osl::MutexGuard aGuard(m_aMutex); if (m_pDialog) + { destroyDialog(); + ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults); + } } delete m_pCollection; @@ -69,12 +70,6 @@ ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() } -void ODatabaseAdministrationDialog::destroyDialog() -{ - ODatabaseAdministrationDialogBase::destroyDialog(); - ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults); -} - void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue) { PropertyValue aProperty; diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx index 1305301..4ba8b5f 100644 --- a/extensions/source/propctrlr/controlfontdialog.cxx +++ b/extensions/source/propctrlr/controlfontdialog.cxx @@ -57,7 +57,10 @@ namespace pcr { ::osl::MutexGuard aGuard(m_aMutex); if (m_pDialog) + { destroyDialog(); + ControlCharacterDialog::destroyItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults); + } } } @@ -150,14 +153,6 @@ namespace pcr return VclPtr<ControlCharacterDialog>::Create(_pParent, *m_pFontItems); } - - void OControlFontDialog::destroyDialog() - { - OGenericUnoDialog::destroyDialog(); - ControlCharacterDialog::destroyItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults); - } - - void OControlFontDialog::executedDialog(sal_Int16 _nExecutionResult) { OSL_ENSURE(m_pDialog, "OControlFontDialog::executedDialog: no dialog anymore?!!"); diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx index de79173..a7727a7 100644 --- a/extensions/source/propctrlr/controlfontdialog.hxx +++ b/extensions/source/propctrlr/controlfontdialog.hxx @@ -79,7 +79,6 @@ namespace pcr protected: // OGenericUnoDialog overridables virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) override; - virtual void destroyDialog() override; virtual void executedDialog(sal_Int16 _nExecutionResult) override; }; diff --git a/filter/source/flash/swfdialog.hxx b/filter/source/flash/swfdialog.hxx index f8a403d..8875a7e 100644 --- a/filter/source/flash/swfdialog.hxx +++ b/filter/source/flash/swfdialog.hxx @@ -30,10 +30,11 @@ namespace vcl { class Window; } class ResMgr; -class SWFDialog : public ::svt::OGenericUnoDialog, - public ::comphelper::OPropertyArrayUsageHelper< SWFDialog >, - public css::beans::XPropertyAccess, - public css::document::XExporter +class SWFDialog final: + public ::svt::OGenericUnoDialog, + public ::comphelper::OPropertyArrayUsageHelper< SWFDialog >, + public css::beans::XPropertyAccess, + public css::document::XExporter { private: diff --git a/filter/source/pdf/pdfdialog.hxx b/filter/source/pdf/pdfdialog.hxx index b20cd4c..c40aded 100644 --- a/filter/source/pdf/pdfdialog.hxx +++ b/filter/source/pdf/pdfdialog.hxx @@ -30,8 +30,9 @@ namespace vcl { class Window; } typedef ::cppu::ImplInheritanceHelper < ::svt::OGenericUnoDialog, XPropertyAccess, XExporter > PDFDialog_Base; -class PDFDialog : public PDFDialog_Base, - public ::comphelper::OPropertyArrayUsageHelper< PDFDialog > +class PDFDialog final: + public PDFDialog_Base, + public ::comphelper::OPropertyArrayUsageHelper< PDFDialog > { private: Sequence< PropertyValue > maMediaDescriptor; diff --git a/filter/source/svg/svgdialog.hxx b/filter/source/svg/svgdialog.hxx index 24f80de..80a4e28 100644 --- a/filter/source/svg/svgdialog.hxx +++ b/filter/source/svg/svgdialog.hxx @@ -30,10 +30,11 @@ class ResMgr; -class SVGDialog : public ::svt::OGenericUnoDialog, - public ::comphelper::OPropertyArrayUsageHelper< SVGDialog >, - public css::beans::XPropertyAccess, - public css::document::XExporter +class SVGDialog final: + public ::svt::OGenericUnoDialog, + public ::comphelper::OPropertyArrayUsageHelper< SVGDialog >, + public css::beans::XPropertyAccess, + public css::document::XExporter { private: diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx index 53885ed..025107b 100644 --- a/include/svtools/genericunodialog.hxx +++ b/include/svtools/genericunodialog.hxx @@ -121,8 +121,8 @@ namespace svt */ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) = 0; - /// called to destroy the dialog used. the default implementation just deletes m_pDialog and resets it to NULL - virtual void destroyDialog(); + /// called to destroy the dialog used. deletes m_pDialog and resets it to NULL + void destroyDialog(); /** called after the dialog has been executed @param _nExecutionResult the execution result as returned by Dialog::Execute diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index eaa4ad6..492bbb9 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -133,7 +133,6 @@ namespace { protected: virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) override; - virtual void destroyDialog() override; private: css::uno::Sequence< css::uno::Sequence< sal_Int16 > > m_aWizardSteps; @@ -146,16 +145,32 @@ namespace { { } + namespace { + + OUString lcl_getHelpURL( const OString& sHelpId ) + { + OUStringBuffer aBuffer; + OUString aTmp( + OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ); + INetURLObject aHID( aTmp ); + if ( aHID.GetProtocol() == INetProtocol::NotValid ) + aBuffer.append( INET_HID_SCHEME ); + aBuffer.append( aTmp.getStr() ); + return aBuffer.makeStringAndClear(); + } + + } Wizard::~Wizard() { - // we do this here cause the base class' call to destroyDialog won't reach us anymore: we're within an dtor, - // so this virtual-method-call the base class does not work, we're already dead then... if ( m_pDialog ) { ::osl::MutexGuard aGuard( m_aMutex ); if ( m_pDialog ) + { + m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() ); destroyDialog(); + } } } @@ -250,20 +265,6 @@ namespace { return OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 ); } - - OUString lcl_getHelpURL( const OString& sHelpId ) - { - OUStringBuffer aBuffer; - OUString aTmp( - OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ); - INetURLObject aHID( aTmp ); - if ( aHID.GetProtocol() == INetProtocol::NotValid ) - aBuffer.append( INET_HID_SCHEME ); - aBuffer.append( aTmp.getStr() ); - return aBuffer.makeStringAndClear(); - } - - VclPtr<Dialog> Wizard::createDialog( vcl::Window* i_pParent ) { VclPtrInstance<WizardShell> pDialog( i_pParent, m_xController, m_aWizardSteps ); @@ -272,16 +273,6 @@ namespace { return pDialog.get(); } - - void Wizard::destroyDialog() - { - if ( m_pDialog ) - m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() ); - - Wizard_Base::destroyDialog(); - } - - OUString SAL_CALL Wizard::getImplementationName() throw(RuntimeException, std::exception) { return OUString("com.sun.star.comp.svtools.uno.Wizard"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits