diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-16 21:35:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-17 09:59:01 +0200 |
commit | 98143564ddffd6deb19a11f84e07efd97ae68048 (patch) | |
tree | 2172258ec5569a7eeb39e0f90cf416054b98388f /cui | |
parent | 88afd50a8a8252585dfa63e5470fd1f840682884 (diff) |
set parents for MasterPasswordCreateDialog and MasterPasswordDialog
Change-Id: I7e58597b2a47db1be5588432d372256785258de5
Reviewed-on: https://gerrit.libreoffice.org/54459
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optinet2.cxx | 28 | ||||
-rw-r--r-- | cui/source/options/optinet2.hxx | 2 |
2 files changed, 23 insertions, 7 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 779f0a107c6f..bf7f6bd26737 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -23,6 +23,7 @@ #include <officecfg/Inet.hxx> #include <officecfg/Office/Common.hxx> #include <officecfg/Office/Security.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <tools/config.hxx> #include <vcl/weld.hxx> #include <svl/intitem.hxx> @@ -56,6 +57,7 @@ #include <strings.hrc> #include <com/sun/star/security/DocumentDigitalSignatures.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #ifdef UNX #include <sys/stat.h> @@ -657,7 +659,11 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl, Button*, void) { bool bOldValue = xMasterPasswd->allowPersistentStoring( true ); xMasterPasswd->removeMasterPassword(); - if ( xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() ) ) + + uno::Reference<task::XInteractionHandler> xTmpHandler(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), + VCLUnoHelper::GetInterface(GetParentDialog()))); + + if ( xMasterPasswd->changeMasterPassword(xTmpHandler) ) { m_pMasterPasswordPB->Enable(); m_pMasterPasswordCB->Check(); @@ -703,7 +709,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl, Button*, void) } } -IMPL_STATIC_LINK_NOARG(SvxSecurityTabPage, MasterPasswordHdl, Button*, void) +IMPL_LINK_NOARG(SvxSecurityTabPage, MasterPasswordHdl, Button*, void) { try { @@ -711,7 +717,11 @@ IMPL_STATIC_LINK_NOARG(SvxSecurityTabPage, MasterPasswordHdl, Button*, void) task::PasswordContainer::create(comphelper::getProcessComponentContext())); if ( xMasterPasswd->isPersistentStoringAllowed() ) - xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() ); + { + uno::Reference<task::XInteractionHandler> xTmpHandler(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), + VCLUnoHelper::GetInterface(GetParentDialog()))); + xMasterPasswd->changeMasterPassword(xTmpHandler); + } } catch (const Exception&) {} @@ -724,9 +734,12 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, MasterPasswordCBHdl, Button*, void) Reference< task::XPasswordContainer2 > xMasterPasswd( task::PasswordContainer::create(comphelper::getProcessComponentContext())); + uno::Reference<task::XInteractionHandler> xTmpHandler(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), + VCLUnoHelper::GetInterface(GetParentDialog()))); + if ( m_pMasterPasswordCB->IsChecked() ) { - if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() ) ) + if (xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->changeMasterPassword(xTmpHandler)) { m_pMasterPasswordPB->Enable(); m_pMasterPasswordFT->Enable(); @@ -740,7 +753,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, MasterPasswordCBHdl, Button*, void) } else { - if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->useDefaultMasterPassword( Reference< task::XInteractionHandler >() ) ) + if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->useDefaultMasterPassword(xTmpHandler) ) { m_pMasterPasswordPB->Enable( false ); m_pMasterPasswordFT->Enable( false ); @@ -766,7 +779,10 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl, Button*, void) Reference< task::XPasswordContainer2 > xMasterPasswd( task::PasswordContainer::create(comphelper::getProcessComponentContext())); - if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) ) + uno::Reference<task::XInteractionHandler> xTmpHandler(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), + VCLUnoHelper::GetInterface(GetParentDialog()))); + + if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword(xTmpHandler) ) { ScopedVclPtrInstance< svx::WebConnectionInfoDialog > aDlg(this); aDlg->Execute(); diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index d504f514fc4a..19f27affdbb4 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -135,7 +135,7 @@ private: DECL_LINK(SecurityOptionsHdl, Button*, void); DECL_LINK(SavePasswordHdl, Button*, void); - DECL_STATIC_LINK(SvxSecurityTabPage, MasterPasswordHdl, Button*, void); + DECL_LINK(MasterPasswordHdl, Button*, void); DECL_LINK(MasterPasswordCBHdl, Button*, void); DECL_LINK(ShowPasswordsHdl, Button*, void); DECL_STATIC_LINK(SvxSecurityTabPage, MacroSecPBHdl, Button*, void ); |