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

set parent for password dialog

Change-Id: I3276cdc1a9f94aead260706cb378e278000081be
Reviewed-on: https://gerrit.libreoffice.org/51728Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 5b348b1a
...@@ -201,7 +201,7 @@ private: ...@@ -201,7 +201,7 @@ private:
DECL_LINK(DeleteHdl, Button*, void); DECL_LINK(DeleteHdl, Button*, void);
DECL_LINK(SignatureHdl, Button*, void); DECL_LINK(SignatureHdl, Button*, void);
DECL_STATIC_LINK(SfxDocumentPage, ChangePassHdl, Button*, void); DECL_LINK(ChangePassHdl, Button*, void);
void ImplUpdateSignatures(); void ImplUpdateSignatures();
void ImplCheckPasswordState(); void ImplCheckPasswordState();
......
...@@ -255,7 +255,7 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent, ...@@ -255,7 +255,7 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
const css::uno::Sequence< OUString >& rBlackList = css::uno::Sequence< OUString >()); const css::uno::Sequence< OUString >& rBlackList = css::uno::Sequence< OUString >());
ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet); ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet, vcl::Window* pParent);
} }
#endif #endif
......
...@@ -855,7 +855,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, SignatureHdl, Button*, void) ...@@ -855,7 +855,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, SignatureHdl, Button*, void)
} }
} }
IMPL_STATIC_LINK_NOARG(SfxDocumentPage, ChangePassHdl, Button*, void) IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, Button*, void)
{ {
SfxObjectShell* pShell = SfxObjectShell::Current(); SfxObjectShell* pShell = SfxObjectShell::Current();
do do
...@@ -869,7 +869,7 @@ IMPL_STATIC_LINK_NOARG(SfxDocumentPage, ChangePassHdl, Button*, void) ...@@ -869,7 +869,7 @@ IMPL_STATIC_LINK_NOARG(SfxDocumentPage, ChangePassHdl, Button*, void)
if (!pFilter) if (!pFilter)
break; break;
sfx2::RequestPassword(pFilter, OUString(), pMedSet); sfx2::RequestPassword(pFilter, OUString(), pMedSet, GetParentDialog());
pShell->SetModified(); pShell->SetModified();
} }
while (false); while (false);
......
...@@ -1513,7 +1513,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, ...@@ -1513,7 +1513,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList,
{ {
// ask for a password // ask for a password
OUString aDocName(rpURLList[0]); OUString aDocName(rpURLList[0]);
ErrCode errCode = RequestPassword(pCurrentFilter, aDocName, rpSet); ErrCode errCode = RequestPassword(pCurrentFilter, aDocName, rpSet, mpPreferredParentWindow);
if (errCode != ERRCODE_NONE) if (errCode != ERRCODE_NONE)
return errCode; return errCode;
} }
...@@ -2662,9 +2662,9 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent, ...@@ -2662,9 +2662,9 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
return nRet; return nRet;
} }
ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet) ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter, OUString const & aURL, SfxItemSet* pSet, vcl::Window* pPreferredParentWindow)
{ {
uno::Reference < task::XInteractionHandler2 > xInteractionHandler = task::InteractionHandler::createWithParent( ::comphelper::getProcessComponentContext(), nullptr ); uno::Reference<task::XInteractionHandler2> xInteractionHandler = task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), VCLUnoHelper::GetInterface(pPreferredParentWindow));
// TODO: need a save way to distinguish MS filters from other filters // TODO: need a save way to distinguish MS filters from other filters
// for now MS-filters are the only alien filters that support encryption // for now MS-filters are the only alien filters that support encryption
bool bMSType = !pCurrentFilter->IsOwnFormat(); bool bMSType = !pCurrentFilter->IsOwnFormat();
......
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