[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sfx2/source vcl/source

Pranav Kant pranavk at collabora.co.uk
Thu Jan 25 10:11:09 UTC 2018


 sfx2/source/dialog/basedlgs.cxx |    5 ++---
 vcl/source/window/dialog.cxx    |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 3b22b8077d744f39ca5c202570d21f2f32f02b45
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Jan 25 14:34:19 2018 +0530

    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
    (cherry picked from commit 668deca97d8dd049bb17b6d8b73c4ea73f7b8b9c)
    Reviewed-on: https://gerrit.libreoffice.org/48560
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 729e1fbbdb97..94b4225ddf7f 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -199,10 +199,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);
@@ -265,7 +264,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);
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index d2d20d1ef7cd..f9dbaa534f5f 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -895,10 +895,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);
@@ -1284,7 +1283,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);
     }
 }


More information about the Libreoffice-commits mailing list