Kaydet (Commit) cf693b02 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Jan Holesovsky

LOK: sd: notify LOK of page size/orientation change

Change-Id: I2eb92d83f50b91b39a10e22298d496668c1cbf72
Reviewed-on: https://gerrit.libreoffice.org/66775
Tested-by: Jenkins
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 4305d9a4
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
#include <editeng/lrspitem.hxx> #include <editeng/lrspitem.hxx>
#include <editeng/sizeitem.hxx> #include <editeng/sizeitem.hxx>
#include <svl/itemset.hxx> #include <svl/itemset.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -995,20 +997,32 @@ IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void) ...@@ -995,20 +997,32 @@ IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void)
IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, ListBox&, void) IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, ListBox&, void)
{ {
Paper ePaper = mpPaperSizeBox->GetSelection(); const Paper ePaper = mpPaperSizeBox->GetSelection();
Size aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit)); Size aSize(SvxPaperInfo::GetPaperSize(ePaper, meUnit));
if(mpPaperOrientation->GetSelectedEntryPos() == 0) if (mpPaperOrientation->GetSelectedEntryPos() == 0)
Swap(aSize); Swap(aSize);
mpPageItem->SetLandscape(mpPaperOrientation->GetSelectedEntryPos() == 0); 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 // Page/slide properties dialog (FuPage::ExecuteDialog and ::ApplyItemSet) misuses
// SID_ATTR_PAGE_EXT1 to distinguish between Impress and Draw, as for whether to fit // 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 // 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) IMPL_LINK_NOARG(SlideBackground, FillColorHdl, SvxColorListBox&, void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment