summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-11-24 12:06:42 +0100
committerJan Holesovsky <kendy@collabora.com>2017-11-29 10:16:57 +0100
commit5de24bea47e7ae971a53b51ee7d1b85d134bbe52 (patch)
treee587b11422df16ffbaac716c03e17611deff3fec /vcl
parent6bc22c34fb3742dc991ec35dc6660d162a39ccf5 (diff)
lokdialogs: Assign the LOK window id only when necessary.
Change-Id: Id48957a8c2bde068f30bb26e66df81972fe38e0f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/window.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3604276839b8..ba61ea70a3b3 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -740,7 +740,7 @@ WindowImpl::WindowImpl( WindowType nType )
static bool bDoubleBuffer = getenv("VCL_DOUBLEBUFFERING_FORCE_ENABLE");
mbDoubleBufferingRequested = bDoubleBuffer; // when we are not sure, assume it cannot do double-buffering via RenderContext
mpLOKNotifier = nullptr;
- mnLOKWindowId = mnLastWindowId++;
+ mnLOKWindowId = 0;
}
WindowImpl::~WindowImpl()
@@ -3155,6 +3155,13 @@ void Window::SetComponentInterface( Reference< css::awt::XWindowPeer > const & x
void Window::SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier)
{
+ // don't allow setting this twice
+ assert(mpWindowImpl->mpLOKNotifier == nullptr);
+ assert(pNotifier);
+
+ // assign the LOK window id
+ mpWindowImpl->mnLOKWindowId = WindowImpl::mnLastWindowId++;
+
mpWindowImpl->mpLOKNotifier = pNotifier;
}
@@ -3165,6 +3172,8 @@ const vcl::ILibreOfficeKitNotifier* Window::GetLOKNotifier() const
vcl::LOKWindowId Window::GetLOKWindowId() const
{
+ assert(mpWindowImpl->mnLOKWindowId > 0);
+
return mpWindowImpl->mnLOKWindowId;
}