summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-12-06 23:11:33 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-12-07 15:32:08 +0530
commit03fa6b15439938044fa95eb9b0584d16cf23db88 (patch)
tree081386f192e2fe34cd4b09512fc08e3bd0d38ae7 /vcl
parenta3fdcc1a8cee8485ad0a3777c0652aee4568517b (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
Diffstat (limited to 'vcl')
-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 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())
{