dbaccess/source/ui/uno/composerdialogs.cxx |    8 +++++++-
 forms/source/runtime/formoperations.cxx    |   21 ++++++++++++++++++---
 offapi/com/sun/star/sdb/OrderDialog.idl    |    4 +++-
 3 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit 0a9917b756cf49b117766c9236a7bf63d6d4b607
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Dec 17 15:19:07 2018 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Dec 17 22:06:35 2018 +0100

    tdf#122152 set dialog parent
    
    Change-Id: I15f6d577c3584d28f667a04b5571de80effe53fe
    Reviewed-on: https://gerrit.libreoffice.org/65274
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx 
b/dbaccess/source/ui/uno/composerdialogs.cxx
index 95186c74be02..c9b1973bb4a9 100644
--- a/dbaccess/source/ui/uno/composerdialogs.cxx
+++ b/dbaccess/source/ui/uno/composerdialogs.cxx
@@ -198,7 +198,7 @@ namespace dbaui
 
     void SAL_CALL RowsetOrderDialog::initialize( const Sequence< Any >& 
aArguments )
     {
-        if( aArguments.getLength() == 2 )
+        if (aArguments.getLength() == 2 || aArguments.getLength() == 3)
         {
             Reference<css::sdb::XSingleSelectQueryComposer> xQueryComposer;
             aArguments[0] >>= xQueryComposer;
@@ -206,6 +206,12 @@ namespace dbaui
             aArguments[1] >>= xRowSet;
             setPropertyValue( "QueryComposer", makeAny( xQueryComposer ) );
             setPropertyValue( "RowSet",        makeAny( xRowSet ) );
+            if (aArguments.getLength() == 3)
+            {
+                Reference<css::awt::XWindow> xParentWindow;
+                aArguments[2] >>= xParentWindow;
+                setPropertyValue("ParentWindow",  makeAny(xParentWindow));
+            }
         }
         else
             ComposerDialog::initialize(aArguments);
diff --git a/forms/source/runtime/formoperations.cxx 
b/forms/source/runtime/formoperations.cxx
index 0ff115326e09..35798286fa3d 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/ucb/AlreadyInitializedException.hpp>
 #include <com/sun/star/util/XModifyBroadcaster.hpp>
 #include <com/sun/star/form/runtime/FormFeature.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/awt/XControl.hpp>
@@ -1685,18 +1686,32 @@ namespace frm
             return;
         try
         {
+            css::uno::Reference<css::awt::XWindow> xDialogParent;
+
+            //tdf#122152 extract parent for dialog
+            css::uno::Reference<css::awt::XTabController> 
xTabController(m_xController, css::uno::UNO_QUERY);
+            if (xTabController.is())
+            {
+                css::uno::Reference<css::awt::XControl> 
xContainerControl(xTabController->getContainer(), css::uno::UNO_QUERY);
+                if (xContainerControl.is())
+                {
+                    css::uno::Reference<css::awt::XWindowPeer> 
xContainerPeer(xContainerControl->getPeer(), css::uno::UNO_QUERY);
+                    xDialogParent = 
css::uno::Reference<css::awt::XWindow>(xContainerPeer, css::uno::UNO_QUERY);
+                }
+            }
+
             Reference< XExecutableDialog> xDialog;
             if ( _bFilter )
             {
                 xDialog = css::sdb::FilterDialog::createWithQuery(m_xContext, 
m_xParser, m_xCursor,
-                              Reference<css::awt::XWindow>());
+                                                                  
xDialogParent);
             }
             else
             {
-                xDialog = css::sdb::OrderDialog::createWithQuery(m_xContext, 
m_xParser, m_xCursorProperties);
+                xDialog = css::sdb::OrderDialog::createWithQuery(m_xContext, 
m_xParser, m_xCursorProperties,
+                                                                 
xDialogParent);
             }
 
-
             if ( RET_OK == xDialog->execute() )
             {
                 WaitObject aWO( nullptr );
diff --git a/offapi/com/sun/star/sdb/OrderDialog.idl 
b/offapi/com/sun/star/sdb/OrderDialog.idl
index 461fef0f966b..456e70f69fd6 100644
--- a/offapi/com/sun/star/sdb/OrderDialog.idl
+++ b/offapi/com/sun/star/sdb/OrderDialog.idl
@@ -20,6 +20,7 @@
 #ifndef __com_sun_star_sdb_OrderDialog_idl__
 #define __com_sun_star_sdb_OrderDialog_idl__
 
+#include <com/sun/star/awt/XWindow.idl>
 #include <com/sun/star/beans/XPropertySet.idl>
 #include <com/sun/star/sdb/XSingleSelectQueryComposer.idl>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
@@ -37,7 +38,8 @@ service OrderDialog : 
com::sun::star::ui::dialogs::XExecutableDialog
     createDefault();
 
     createWithQuery([in] com::sun::star::sdb::XSingleSelectQueryComposer 
QueryComposer,
-                    [in] com::sun::star::beans::XPropertySet RowSet);
+                    [in] com::sun::star::beans::XPropertySet RowSet,
+                    [in] com::sun::star::awt::XWindow ParentWindow);
 };
 
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to