Kaydet (Commit) 98143564 authored tarafından Caolán McNamara's avatar Caolán McNamara

set parents for MasterPasswordCreateDialog and MasterPasswordDialog

Change-Id: I7e58597b2a47db1be5588432d372256785258de5
Reviewed-on: https://gerrit.libreoffice.org/54459Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 88afd50a
......@@ -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();
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment