From 03fa6b15439938044fa95eb9b0584d16cf23db88 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Wed, 6 Dec 2017 23:11:33 +0530 Subject: 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 --- vcl/source/window/floatwin.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'vcl/source') 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 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()) { -- cgit