[Libreoffice-commits] core.git: dbaccess/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Dec 17 21:06:03 UTC 2018
dbaccess/source/core/dataaccess/documentdefinition.cxx | 14 ++++++++------
dbaccess/source/core/dataaccess/documentdefinition.hxx | 3 ++-
dbaccess/source/core/dataaccess/intercept.cxx | 2 +-
3 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit c58d4c1990df4dcdc09f0e5841069d6a42cd07cd
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Dec 17 17:21:34 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Dec 17 22:05:36 2018 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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;
}
More information about the Libreoffice-commits
mailing list