summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-26 15:24:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-26 17:12:56 +0100
commita75c8e8dce22facea5eae454d050515f169a3f8b (patch)
tree3dc9ab3e1075f7222787fbf74777b327adfbb55e
parentfeb5eb180de5e25ee6ee630b66f9cd876df60652 (diff)
Resolves: tdf#96279 set correct parents for password dialogs
otherwise on Dialog::Execute before it becomes visible and a password dialog is needed the new dialog will automatically look for a parent, but will be parented by the main window because the dialog it should be a parent of is not visible yet. Change-Id: Ia34e43d7ef2b204b348f2eb5aab542ee8ffe840e (cherry picked from commit 7417311fc0f888223ae05f1cfc750de1735c5c9e)
-rw-r--r--include/svtools/ServerDetailsControls.hxx4
-rw-r--r--svtools/source/contnr/fileview.cxx5
-rw-r--r--svtools/source/contnr/foldertree.cxx5
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx2
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx10
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx2
6 files changed, 17 insertions, 11 deletions
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index 181c7569ca75..b6ceaa2bb3b5 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -18,6 +18,7 @@
#include <tools/urlobj.hxx>
#include <vcl/builder.hxx>
#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
#include <vcl/edit.hxx>
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
@@ -136,9 +137,10 @@ class CmisDetailsContainer : public DetailsContainer
VclPtr<FixedText> m_pFTRepository;
VclPtr<ListBox> m_pLBRepository;
VclPtr<Button> m_pBTRepoRefresh;
+ css::uno::Reference< css::awt::XWindow > m_xParentDialog;
public:
- CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding );
+ CmisDetailsContainer(VclBuilderContainer* pBuilder, Dialog* pParentDialog, OUString const & sBinding);
virtual ~CmisDetailsContainer( ) { };
virtual void show( bool bShow = true ) override;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index d7b4a8900910..bf8bdae0a904 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -29,6 +29,7 @@
#include <svtools/svtabbx.hxx>
#include <svtools/svtools.hrc>
#include <svtools/viewdataentry.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include "fileview.hrc"
#include "contentenumeration.hxx"
#include <svtools/AccessibleBrowseBoxObjType.hxx>
@@ -533,7 +534,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
- InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY_THROW );
+ InteractionHandler::createWithParent(xContext, VCLUnoHelper::GetInterface(GetParentDialog())), UNO_QUERY_THROW );
mxCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
@@ -977,7 +978,7 @@ SvtFileView::SvtFileView( vcl::Window* pParent, WinBits nBits,
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
- InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY_THROW );
+ InteractionHandler::createWithParent(xContext, VCLUnoHelper::GetInterface(GetParentDialog())), UNO_QUERY_THROW );
Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder );
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 40ed9d538544..086ba62e48f0 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -8,7 +8,8 @@
*/
#include <svtools/foldertree.hxx>
-
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/dialog.hxx>
#include "contentenumeration.hxx"
FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
@@ -18,7 +19,7 @@ FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
- InteractionHandler::createWithParent( xContext, nullptr ), UNO_QUERY_THROW );
+ InteractionHandler::createWithParent(xContext, VCLUnoHelper::GetInterface(GetParentDialog())), UNO_QUERY_THROW );
m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
SetDefaultCollapsedEntryBmp( m_aFolderImage );
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 137cec3c8448..c0543806d967 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -184,7 +184,7 @@ void PlaceEditDialog::InitDetails( )
nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos );
- std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl));
+ std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, this, sUrl));
xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
m_aDetailsContainers.push_back(xCmisDetails);
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index be071d5c52f4..2fc608b7b4af 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -19,6 +19,7 @@
#include <rtl/uri.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include <svtools/PlaceEditDialog.hxx>
#include <svtools/ServerDetailsControls.hxx>
@@ -271,17 +272,18 @@ void SmbDetailsContainer::show( bool bShow )
m_pFTPort->Enable( !bShow );
}
-CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ) :
+CmisDetailsContainer::CmisDetailsContainer(VclBuilderContainer* pBuilder, Dialog* pParentDialog, OUString const & sBinding) :
DetailsContainer( pBuilder ),
m_sUsername( ),
m_xCmdEnv( ),
m_aRepoIds( ),
m_sRepoId( ),
- m_sBinding( sBinding )
+ m_sBinding( sBinding ),
+ m_xParentDialog( VCLUnoHelper::GetInterface(pParentDialog) )
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xGlobalInteractionHandler(
- InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY );
+ InteractionHandler::createWithParent(xContext, m_xParentDialog), UNO_QUERY);
m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() );
pBuilder->get( m_pFTRepository, "repositoryLabel" );
@@ -436,7 +438,7 @@ IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void )
if( !sUrl.isEmpty() && !m_sUsername.isEmpty() && !m_sPassword.isEmpty() )
{
Reference< XInteractionHandler > xInteractionHandler(
- InteractionHandler::createWithParent( xContext, nullptr ),
+ InteractionHandler::createWithParent(xContext, m_xParentDialog),
UNO_QUERY );
Sequence<OUString> aPasswd { m_sPassword };
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 073d8901f027..456274e81dc5 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -798,7 +798,7 @@ void AssignmentPersistentData::ImplCommit()
try
{
xHandler.set(
- InteractionHandler::createWithParent(m_xORB, nullptr),
+ InteractionHandler::createWithParent(m_xORB, VCLUnoHelper::GetInterface(this)),
UNO_QUERY_THROW );
}
catch(const Exception&) { }