summaryrefslogtreecommitdiff
path: root/cui/source/options/optinet2.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-16 21:35:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-17 09:59:01 +0200
commit98143564ddffd6deb19a11f84e07efd97ae68048 (patch)
tree2172258ec5569a7eeb39e0f90cf416054b98388f /cui/source/options/optinet2.cxx
parent88afd50a8a8252585dfa63e5470fd1f840682884 (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/source/options/optinet2.cxx')
-rw-r--r--cui/source/options/optinet2.cxx28
1 files changed, 22 insertions, 6 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();