summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-12-06 23:11:33 +0530
committerAndras Timar <andras.timar@collabora.com>2018-03-19 14:56:09 +0100
commitc5af1d2ec785387f1358f91ea62b27ae5db3c1d9 (patch)
tree69d74e9e072610d9679b11372d40c1b16a8ca7bf
parent401f52951d517924a50ebed130693081b3d2f367 (diff)
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 (cherry picked from commit 03fa6b15439938044fa95eb9b0584d16cf23db88)
-rw-r--r--vcl/source/window/floatwin.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index b9ea2f039fff..39e837d9153f 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())
{