diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-01-20 12:06:07 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-01-24 09:11:21 +0100 |
commit | cf693b02159982bbcbbd13b564a81227fbba78cf (patch) | |
tree | 8c123c036ce8328b347c9d38d040f25627e6513b /sd | |
parent | 4305d9a4b97a660fec54d2796f7e5cb502d4fba0 (diff) |
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@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 26 |
1 files changed, 20 insertions, 6 deletions
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) |