vcl/source/window/floatwin.cxx |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 03fa6b15439938044fa95eb9b0584d16cf23db88
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Wed Dec 6 23:11:33 2017 +0530

    lokdialog: sc: Prevent assert when invoking autopopup filter dialog
    
    We set the notifier in sc, so don't try to set it again in vcl.
    
    Change-Id: Ic7ab3d0030532a4e8630aa7e9266d32057373a65

diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index d45707d60aec..d6890e4823cc 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -608,15 +608,23 @@ void FloatingWindow::StateChanged( StateChangedType nType 
)
     {
         if (IsVisible())
         {
-            const vcl::ILibreOfficeKitNotifier* pNotifier = 
pParent->GetLOKNotifier();
-            SetLOKNotifier(pNotifier);
-
             std::vector<vcl::LOKPayloadItem> aItems;
-            aItems.emplace_back(std::make_pair("type", "child"));
-            aItems.emplace_back(std::make_pair("parentId", 
OString::number(pParent->GetLOKWindowId())));
+            if (pParent == this)
+            {
+                // we are a toplevel window, let's so far pretend to be a
+                // dialog - but maybe we'll need a separate type for this
+                // later
+                aItems.emplace_back(std::make_pair("type", "dialog"));
+            }
+            else
+            {
+                SetLOKNotifier(pParent->GetLOKNotifier());
+                aItems.emplace_back(std::make_pair("type", "child"));
+                aItems.emplace_back(std::make_pair("parentId", 
OString::number(pParent->GetLOKWindowId())));
+            }
             aItems.emplace_back(std::make_pair("size", 
GetSizePixel().toString()));
             aItems.emplace_back(std::make_pair("position", 
mpImplData->maPos.toString()));
-            pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+            GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "created", 
aItems);
         }
         else if (!IsVisible())
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to