diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-30 10:56:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-31 20:12:08 +0100 |
commit | fee408dd695b9ddca8333688879d1ba52faff8fb (patch) | |
tree | 339bb2e609aac42d3a90dfafb97b8ced89aebb8e | |
parent | 28ef7a8ce82e50066c911199ef1280669e732a95 (diff) |
pass an explicit parent for the password dialogs
Change-Id: Ic25d6b61750df9ccf5271df1b4d314ae9cb07550
Reviewed-on: https://gerrit.libreoffice.org/81758
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/bastype3.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 8 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 2 | ||||
-rw-r--r-- | basctl/source/inc/bastypes.hxx | 2 |
7 files changed, 12 insertions, 14 deletions
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index a6f74b646595..a59fbcca7048 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -517,7 +517,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); + bOK = QueryPassword(rReq.GetFrameWeld(), xModLibContainer, aLibName, aPassword); } } diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index e450c04a0425..feb45f3d4206 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -601,7 +601,7 @@ bool TreeListBox::ExpandingHdl() if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); + bOK = QueryPassword(GetFrameWeld(), xModLibContainer, aLibName, aPassword); } } } diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index 68d5fb1c47c3..8098925a6b67 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -68,7 +68,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, aOULibName, aPassword ); + bOK = QueryPassword(GetFrameWeld(), xModLibContainer, aOULibName, aPassword); } } @@ -157,7 +157,7 @@ IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const weld::TreeIter&, rEntry, b if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, aOULibName, aPassword ); + bOK = QueryPassword(m_pTopLevel, xModLibContainer, aOULibName, aPassword); } } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 5e642673cf8e..f38ba5d33e8c 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -743,7 +743,7 @@ bool QueryDelModule( const OUString& rName, weld::Widget* pParent ) return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent ); } -bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat, bool bNewTitle ) +bool QueryPassword(weld::Widget* pDialogParent, const Reference< script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat, bool bNewTitle) { bool bOK = false; sal_uInt16 nRet = 0; @@ -751,8 +751,7 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, do { // password dialog - vcl::Window* pWin = Application::GetDefDialogParent(); - SfxPasswordDialog aDlg(pWin ? pWin->GetFrameWeld() : nullptr); + SfxPasswordDialog aDlg(pDialogParent); aDlg.SetMinLen(1); // set new title @@ -779,8 +778,7 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, if ( !bOK ) { - vcl::Window* pParent = Application::GetDefDialogParent(); - std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, + std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDialogParent, VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_WRONGPASSWORD))); xErrorBox->run(); } diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index c2633699b66a..34db6905702f 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -272,7 +272,7 @@ IMPL_LINK(LibPage, EditingEntryHdl, const weld::TreeIter&, rIter, bool) if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); + bOK = QueryPassword(m_pDialog->getDialog(), xModLibContainer, aLibName, aPassword); } if ( !bOK ) return false; @@ -740,7 +740,7 @@ void LibPage::InsertLib() Reference< script::XLibraryContainerPassword > xPasswd( xModLibContImport, UNO_QUERY ); if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) && !bReference ) { - bOK = QueryPassword( xModLibContImport, aLibName, aPassword, true, true ); + bOK = QueryPassword(m_pDialog->getDialog(), xModLibContImport, aLibName, aPassword, true, true); if ( !bOK ) { @@ -922,7 +922,7 @@ void LibPage::Export() if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, aLibName, aPassword ); + bOK = QueryPassword(m_pDialog->getDialog(), xModLibContainer, aLibName, aPassword); } if ( !bOK ) return; diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 0812647911f0..02259ed4314b 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -729,7 +729,7 @@ bool ObjectPage::GetSelection( ScriptDocument& rDocument, OUString& rLibName ) if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) ) { OUString aPassword; - bOK = QueryPassword( xModLibContainer, rLibName, aPassword ); + bOK = QueryPassword(m_pDialog->getDialog(), xModLibContainer, rLibName, aPassword); } // load library diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index 50a9445696cf..3063c2bd6827 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -294,7 +294,7 @@ bool QueryDelMacro( const OUString& rName, weld::Widget* pParent ); bool QueryDelDialog( const OUString& rName, weld::Widget* pParent ); bool QueryDelModule( const OUString& rName, weld::Widget* pParent ); bool QueryDelLib( const OUString& rName, bool bRef, weld::Widget* pParent ); -bool QueryPassword( const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat = false, bool bNewTitle = false ); +bool QueryPassword(weld::Widget* pDialogParent, const css::uno::Reference< css::script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat = false, bool bNewTitle = false); class ModuleInfoHelper { |