[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Caolán McNamara caolanm at redhat.com
Thu Mar 22 15:08:30 UTC 2018


 include/sfx2/dinfdlg.hxx             |    2 +-
 include/sfx2/filedlghelper.hxx       |    2 +-
 sfx2/source/dialog/dinfdlg.cxx       |    4 ++--
 sfx2/source/dialog/filedlghelper.cxx |    6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 9aa46fbc67b8c1098e36fdf00dfc2468ee3a1694
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 22 10:16:17 2018 +0000

    set parent for password dialog
    
    Change-Id: I3276cdc1a9f94aead260706cb378e278000081be
    Reviewed-on: https://gerrit.libreoffice.org/51728
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 4fa1e321931b..c1f003832be6 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -201,7 +201,7 @@ private:
 
     DECL_LINK(DeleteHdl, Button*, void);
     DECL_LINK(SignatureHdl, Button*, void);
-    DECL_STATIC_LINK(SfxDocumentPage, ChangePassHdl, Button*, void);
+    DECL_LINK(ChangePassHdl, Button*, void);
     void                ImplUpdateSignatures();
     void                ImplCheckPasswordState();
 
diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
index 5fe1cbc29787..5a6cefa5ba5a 100644
--- a/include/sfx2/filedlghelper.hxx
+++ b/include/sfx2/filedlghelper.hxx
@@ -255,7 +255,7 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
                              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
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 141e43ce2742..78d5a3a409a4 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -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();
     do
@@ -869,7 +869,7 @@ IMPL_STATIC_LINK_NOARG(SfxDocumentPage, ChangePassHdl, Button*, void)
         if (!pFilter)
             break;
 
-        sfx2::RequestPassword(pFilter, OUString(), pMedSet);
+        sfx2::RequestPassword(pFilter, OUString(), pMedSet, GetParentDialog());
         pShell->SetModified();
     }
     while (false);
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 9c8386746628..8c2e0ecc4175 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1513,7 +1513,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList,
                 {
                     // ask for a password
                     OUString aDocName(rpURLList[0]);
-                    ErrCode errCode = RequestPassword(pCurrentFilter, aDocName, rpSet);
+                    ErrCode errCode = RequestPassword(pCurrentFilter, aDocName, rpSet, mpPreferredParentWindow);
                     if (errCode != ERRCODE_NONE)
                         return errCode;
                 }
@@ -2662,9 +2662,9 @@ ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
     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
     // for now MS-filters are the only alien filters that support encryption
     bool bMSType = !pCurrentFilter->IsOwnFormat();


More information about the Libreoffice-commits mailing list