Kaydet (Commit) 668deca9 authored tarafından Pranav Kant's avatar Pranav Kant

lokdialog: Fix incorrect dialog sizes sent to client

GetSizePixel triggers pending resize handler and gives more correct
sizes than GetOptimalSize(). Some of the dialog with inconsistencies in
sizes like EditStyle, Manage Changes, etc. are fixed with this patch.

Change-Id: I0661b7d2e98233edf0cd2c9c525b271d0724da08
üst f1a68998
......@@ -193,10 +193,9 @@ void SfxModalDialog::StateChanged( StateChangedType nType )
// SfxModalDialog even though they are modeless, i.e., their Execute method
// isn't called.
SetLOKNotifier(SfxViewShell::Current());
const Size aSize = GetOptimalSize();
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("type", "dialog");
aItems.emplace_back("size", aSize.toString());
aItems.emplace_back("size", GetSizePixel().toString());
if (!GetText().isEmpty())
aItems.emplace_back("title", GetText().toUtf8());
SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "created", aItems);
......@@ -259,7 +258,7 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
SetLOKNotifier(pViewShell);
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("type", "dialog");
aItems.emplace_back("size", GetOptimalSize().toString());
aItems.emplace_back("size", GetSizePixel().toString());
if (!GetText().isEmpty())
aItems.emplace_back("title", GetText().toUtf8());
pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
......
......@@ -886,10 +886,9 @@ bool Dialog::ImplStartExecuteModal()
{
if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
{
const Size aSize = GetOptimalSize();
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("type", "dialog");
aItems.emplace_back("size", aSize.toString());
aItems.emplace_back("size", GetSizePixel().toString());
if (!GetText().isEmpty())
aItems.emplace_back("title", GetText().toUtf8());
pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
......@@ -1256,7 +1255,7 @@ void Dialog::Resize()
if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
{
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back("size", GetOptimalSize().toString());
aItems.emplace_back("size", GetSizePixel().toString());
pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
}
}
......
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