Kaydet (Commit) 243aad91 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#125198 centralize notifyWindow:created to one place

Change-Id: I2729cb85f156ddafec69cc3280e9d8544f7c6182
Reviewed-on: https://gerrit.libreoffice.org/72117
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8da6a8fc
...@@ -752,23 +752,25 @@ void Dialog::StateChanged( StateChangedType nType ) ...@@ -752,23 +752,25 @@ void Dialog::StateChanged( StateChangedType nType )
{ {
if (nType == StateChangedType::InitShow) if (nType == StateChangedType::InitShow)
{ {
if (comphelper::LibreOfficeKit::isActive() && !GetLOKNotifier()) DoInitialLayout();
const bool bKitActive = comphelper::LibreOfficeKit::isActive();
if (bKitActive)
{ {
vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr); if (!GetLOKNotifier())
if (pViewShell) SetLOKNotifier(mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr));
if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
{ {
SetLOKNotifier(pViewShell);
std::vector<vcl::LOKPayloadItem> aItems; std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("type", "dialog"); aItems.emplace_back("type", "dialog");
aItems.emplace_back("size", GetSizePixel().toString()); aItems.emplace_back("size", GetSizePixel().toString());
if (!GetText().isEmpty()) if (!GetText().isEmpty())
aItems.emplace_back("title", GetText().toUtf8()); aItems.emplace_back("title", GetText().toUtf8());
pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems); pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
} }
} }
DoInitialLayout();
if ( !HasChildPathFocus() || HasFocus() ) if ( !HasChildPathFocus() || HasFocus() )
GrabFocusToFirstControl(); GrabFocusToFirstControl();
if ( !(GetStyle() & WB_CLOSEABLE) ) if ( !(GetStyle() & WB_CLOSEABLE) )
...@@ -889,12 +891,7 @@ bool Dialog::ImplStartExecute() ...@@ -889,12 +891,7 @@ bool Dialog::ImplStartExecute()
if (bModal) if (bModal)
{ {
if (bKitActive && !GetLOKNotifier()) if (bKitActive && !GetLOKNotifier())
{ SetLOKNotifier(mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr));
if (vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr))
{
SetLOKNotifier(pViewShell);
}
}
switch ( Application::GetDialogCancelMode() ) switch ( Application::GetDialogCancelMode() )
{ {
...@@ -925,19 +922,6 @@ bool Dialog::ImplStartExecute() ...@@ -925,19 +922,6 @@ bool Dialog::ImplStartExecute()
std::abort(); std::abort();
} }
if (bKitActive)
{
if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
{
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("type", "dialog");
aItems.emplace_back("size", GetSizePixel().toString());
if (!GetText().isEmpty())
aItems.emplace_back("title", GetText().toUtf8());
pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
}
}
#ifdef DBG_UTIL #ifdef DBG_UTIL
vcl::Window* pParent = GetParent(); vcl::Window* pParent = GetParent();
if ( pParent ) if ( pParent )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment