[Libreoffice-commits] core.git: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jan 24 08:11:53 UTC 2019


 sd/source/ui/sidebar/SlideBackground.cxx |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

New commits:
commit cf693b02159982bbcbbd13b564a81227fbba78cf
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Jan 20 12:06:07 2019 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Jan 24 09:11:21 2019 +0100

    LOK: sd: notify LOK of page size/orientation change
    
    Change-Id: I2eb92d83f50b91b39a10e22298d496668c1cbf72
    Reviewed-on: https://gerrit.libreoffice.org/66775
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index df83c5eca713..4789890abce0 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -73,6 +73,8 @@
 #include <editeng/lrspitem.hxx>
 #include <editeng/sizeitem.hxx>
 #include <svl/itemset.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
 using namespace ::com::sun::star;
 
@@ -995,20 +997,32 @@ IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void)
 
 IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, ListBox&, void)
 {
-    Paper ePaper =  mpPaperSizeBox->GetSelection();
-    Size  aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
+    const Paper ePaper = mpPaperSizeBox->GetSelection();
+    Size aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
 
-    if(mpPaperOrientation->GetSelectedEntryPos() == 0)
+    if (mpPaperOrientation->GetSelectedEntryPos() == 0)
         Swap(aSize);
 
     mpPageItem->SetLandscape(mpPaperOrientation->GetSelectedEntryPos() == 0);
-    SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, aSize);
+    const SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, aSize);
     // Page/slide properties dialog (FuPage::ExecuteDialog and ::ApplyItemSet) misuses
     // SID_ATTR_PAGE_EXT1 to distinguish between Impress and Draw, as for whether to fit
     // objects to paper size. Until that is handled somehow better, we do the same here
-    SfxBoolItem aFitObjs(SID_ATTR_PAGE_EXT1, IsImpress());
+    const SfxBoolItem aFitObjs(SID_ATTR_PAGE_EXT1, IsImpress());
 
-    GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD, { &aSizeItem, mpPageItem.get(), &aFitObjs});
+    GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD,
+                                                { &aSizeItem, mpPageItem.get(), &aFitObjs });
+
+    // Notify LOK clients of the page size chagne.
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+        while (pViewShell)
+        {
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+            pViewShell = SfxViewShell::GetNext(*pViewShell);
+        }
+    }
 }
 
 IMPL_LINK_NOARG(SlideBackground, FillColorHdl, SvxColorListBox&, void)


More information about the Libreoffice-commits mailing list