framework/source/inc/loadenv/loadenv.hxx |    5 ++++
 framework/source/loadenv/loadenv.cxx     |   36 +++++++++++++++++++++++++++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit d604d977a748e982c3e71f09daf08ed5af778ed0
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Mar 20 14:25:39 2018 +0000

    tdf#114648 tdf#115683 don't show new document until dialogs are gone
    
    Change-Id: Ia9cb3fd549c17cb602fa3d7f9163a89697395c77
    Reviewed-on: https://gerrit.libreoffice.org/51649
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/framework/source/inc/loadenv/loadenv.hxx 
b/framework/source/inc/loadenv/loadenv.hxx
index 87743974ae51..72013ed469b4 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -547,6 +547,11 @@ private:
      */
     void impl_jumpToMark(const css::uno::Reference< css::frame::XFrame >& 
xFrame,
                          const css::util::URL&                            aURL 
 );
+
+    /** @short  determine if this loader has an interactive dialog shown before
+                loading the document.
+     */
+    bool impl_filterHasInteractiveDialog() const;
 };
 
 } // namespace framework
diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index a2cfb5e2b9f7..6465207ca693 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -962,6 +962,38 @@ bool LoadEnv::impl_furtherDocsAllowed()
     return bAllowed;
 }
 
+bool LoadEnv::impl_filterHasInteractiveDialog() const
+{
+    //show the frame now so it can be the parent for any message dialogs shown 
during import
+
+    //unless (tdf#114648) an Interactive case such as the new database wizard
+    if (m_aURL.Arguments == "Interactive")
+       return true;
+
+    // unless (tdf#116277) its the labels/business cards slave frame
+    if (m_aURL.Arguments.indexOf("slot=") != -1)
+        return true;
+
+    OUString sFilter = 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_FILTERNAME(),
 OUString());
+    if (sFilter.isEmpty())
+        return false;
+
+    // unless (tdf#115683) the filter has a UIComponent
+    OUString sUIComponent;
+    css::uno::Reference<css::container::XNameAccess> 
xFilterCont(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_FILTERFACTORY,
 m_xContext),
+                                                                 
css::uno::UNO_QUERY_THROW);
+    try
+    {
+        ::comphelper::SequenceAsHashMap 
lFilterProps(xFilterCont->getByName(sFilter));
+        sUIComponent = lFilterProps.getUnpackedValueOrDefault("UIComponent", 
OUString());
+    }
+    catch(const css::container::NoSuchElementException&)
+    {
+    }
+
+    return !sUIComponent.isEmpty();
+}
+
 bool LoadEnv::impl_loadContent()
 {
     // SAFE -> -----------------------------------
@@ -1074,8 +1106,8 @@ bool LoadEnv::impl_loadContent()
                 {"Parent", uno::Any(xWindow)}
             }));
             xHandler->initialize(aArguments);
-            //show the frame now, unless (tdf#116277) its the labels/business 
cards slave frame
-            if (m_aURL.Arguments.indexOf("slot=") == -1)
+            //show the frame as early as possible to make it the parent of any 
message dialogs
+            if (!impl_filterHasInteractiveDialog())
                 impl_makeFrameWindowVisible(xWindow, false);
         }
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to