vcl: LOK: notify of dialog creation before size change
Notifying the size change of a non-existing dialog is
worse than useless. This also fixes the issue with
positioning dialogs in the center of the client window.
Change-Id: I2e8163f4c5a0a09f79ea11c704c250b17a158948
Reviewed-on: https://gerrit.libreoffice.org/66511
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index ae98d66..3126083 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -892,6 +892,19 @@ bool Dialog::ImplStartExecute()
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
vcl::Window* pParent = GetParent();
if ( pParent )
@@ -950,19 +963,6 @@ bool Dialog::ImplStartExecute()
else
UITestLogger::getInstance().log("ModelessDialogExecuted Id:" + get_id());
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);
}
}
return true;
}