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

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
üst 8cce6500
......@@ -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;
......
......@@ -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 >() );
mpImpl.reset( new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder ) );
......
......@@ -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 );
......
......@@ -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);
......
......@@ -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 };
......
......@@ -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&) { }
......
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