summaryrefslogtreecommitdiff
path: root/dbaccess/source/core
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-17 17:21:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-17 22:05:36 +0100
commitc58d4c1990df4dcdc09f0e5841069d6a42cd07cd (patch)
treeb149211ef80a5bb0ab5761363e59443d2c138771 /dbaccess/source/core
parent5d13f3efe0157559d3625c6b8fe7e9741e601215 (diff)
Related: tdf#122153 set more correct dialog parents
Change-Id: I32212113e3591bde81b47ea89df4977713a49700 Reviewed-on: https://gerrit.libreoffice.org/65283 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/core')
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx14
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.hxx3
-rw-r--r--dbaccess/source/core/dataaccess/intercept.cxx2
3 files changed, 11 insertions, 8 deletions
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index e9887caa6697..ad9cca9716ed 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -29,7 +29,6 @@
#include <comphelper/propertysequence.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
-#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -1196,7 +1195,7 @@ void ODocumentDefinition::onCommandInsert( const OUString& _sURL, const Referenc
aGuard.clear();
}
-bool ODocumentDefinition::save(bool _bApprove)
+bool ODocumentDefinition::save(bool _bApprove, const css::uno::Reference<css::awt::XTopWindow>& rDialogParent)
{
// default handling: instantiate an interaction handler and let it handle the parameter request
if ( !m_bOpenInDesign )
@@ -1244,8 +1243,10 @@ bool ODocumentDefinition::save(bool _bApprove)
OInteractionAbort* pAbort = new OInteractionAbort;
pRequest->addContinuation(pAbort);
+ Reference<XWindow> xDialogParent(rDialogParent, UNO_QUERY);
+
// create the handler, let it handle the request
- Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, nullptr) );
+ Reference<XInteractionHandler2> xHandler(InteractionHandler::createWithParent(m_aContext, xDialogParent));
xHandler->handle(xRequest);
if ( pAbort->wasSelected() )
@@ -1293,7 +1294,7 @@ void ODocumentDefinition::saveAs()
if ( m_pImpl->m_aProps.aTitle.isEmpty() )
{
aGuard.clear();
- save(false); // (sal_False) : we don't want an approve dialog
+ save(false, css::uno::Reference<css::awt::XTopWindow>()); // (sal_False) : we don't want an approve dialog
return;
}
}
@@ -1977,12 +1978,13 @@ bool ODocumentDefinition::prepareClose()
if ( isModified() )
{
Reference< XFrame > xFrame( xController->getFrame() );
+ Reference<XTopWindow> xTopWindow;
if ( xFrame.is() )
{
- Reference< XTopWindow > xTopWindow( xFrame->getContainerWindow(), UNO_QUERY_THROW );
+ xTopWindow = Reference<XTopWindow>(xFrame->getContainerWindow(), UNO_QUERY_THROW);
xTopWindow->toFront();
}
- if ( !save( true ) )
+ if (!save(true, xTopWindow))
{
// revert suspension
xController->suspend(false);
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.hxx b/dbaccess/source/core/dataaccess/documentdefinition.hxx
index b153b1371b8f..501433e7b3d7 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.hxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.hxx
@@ -27,6 +27,7 @@
#include <comphelper/proparrhlp.hxx>
#include <apitools.hxx>
#include <comphelper/uno3.hxx>
+#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/embed/XStateChangeListener.hpp>
@@ -138,7 +139,7 @@ public:
css::uno::Reference< css::embed::XStorage >
getContainerStorage() const;
- bool save(bool _bApprove);
+ bool save(bool _bApprove, const css::uno::Reference<css::awt::XTopWindow>& rDialogParent);
void saveAs();
void closeObject();
bool isModified();
diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx
index 9668c273d0ec..7a567de02326 100644
--- a/dbaccess/source/core/dataaccess/intercept.cxx
+++ b/dbaccess/source/core/dataaccess/intercept.cxx
@@ -104,7 +104,7 @@ void SAL_CALL OInterceptor::dispatch( const URL& URL,const Sequence<PropertyValu
if ( URL.Complete == m_aInterceptedURL[ DISPATCH_SAVE ] )
{
- m_pContentHolder->save( false );
+ m_pContentHolder->save(false, css::uno::Reference<css::awt::XTopWindow>());
return;
}