summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-01-20 12:06:07 -0500
committerJan Holesovsky <kendy@collabora.com>2019-01-22 16:01:16 +0100
commit50731e73a5e6103ba68b8f5a9143cc223d830410 (patch)
tree90603cea64f8032b0f49b41407727a35614fa32c /sd/source
parent85843ff92db37a63081a3fed9ff583f7e4d67cb6 (diff)
LOK: sd: notify LOK of page size/orientation change
Change-Id: I2eb92d83f50b91b39a10e22298d496668c1cbf72
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx25
1 files changed, 19 insertions, 6 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index ead02f86eb4e..9f464dd97928 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -70,6 +70,7 @@
#include <editeng/lrspitem.hxx>
#include <svl/itemset.hxx>
#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star;
@@ -998,20 +999,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)