summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-01-20 12:06:07 -0500
committerAndras Timar <andras.timar@collabora.com>2019-09-03 13:38:02 +0200
commit62b42056603606fe80e9bb21659d7eb57da46767 (patch)
tree5cfdc463acb58eb80d67c20319c695316183a3a6 /sd
parent9cf5e4c28bba6b93c2fd1e44ce889caa679058c6 (diff)
LOK: sd: notify LOK of page size/orientation change
Change-Id: I2eb92d83f50b91b39a10e22298d496668c1cbf72 (cherry picked from commit 50731e73a5e6103ba68b8f5a9143cc223d830410) Reviewed-on: https://gerrit.libreoffice.org/78437 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-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 945ff195325e..efa6defc1495 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -73,6 +73,7 @@
#include <editeng/lrspitem.hxx>
#include <svl/itemset.hxx>
#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star;
@@ -1003,20 +1004,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)