From 65639e909f87e91d7186529afae035f37c528355 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Tue, 19 Aug 2025 01:52:13 +0530 Subject: [PATCH] svx: added parameter for writer page size uno command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parameter for SID_ATTR_PAGE_SIZE Change-Id: I3f44dc8bc9397893f9214ee8915eb592d32c6894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189890 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice (cherry picked from commit fb4f5e6a68fb74b37356bb9ca11f89df1c106184) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190503 Reviewed-by: Pranam Lashkari Tested-by: Jenkins --- svx/sdi/svx.sdi | 9 +++++++-- sw/source/uibase/utlui/uitool.cxx | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 9dbd3591af39..6653e532c2e6 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -6417,9 +6417,14 @@ SvxPaperBinItem PagePaperBin SID_ATTR_PAGE_PAPERBIN GroupId = SfxGroupId::Format; ] - +// PaperFormat takes page format number from (paper.hxx) enum Paper +// If AttributePageSize is also specified PaperFormat is ignored +// AttributePageSize parameter is added to keep backward compatibility of API SvxSizeItem AttributePageSize SID_ATTR_PAGE_SIZE - +( + SvxSizeItem AttributePageSize SID_ATTR_PAGE_SIZE, + SfxUInt16Item PaperFormat FN_PARAM_1 +) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index ff061b87c506..b87584fc586e 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -69,6 +69,7 @@ #include #include #include +#include // 50 cm 28350 #define MAXHEIGHT 28350 @@ -319,6 +320,14 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) aSize.SetSize(rSizeItem.GetSize()); rMaster.SetFormatAttr(aSize); } + else if (rSet.GetItemState(FN_PARAM_1) == SfxItemState::SET) + { + const sal_uInt16 nSizeItem = rSet.GetItem(FN_PARAM_1)->GetValue(); + SwFormatFrameSize aSize(SwFrameSize::Fixed); + aSize.SetSize(SvxPaperInfo::GetPaperSize(static_cast(nSizeItem))); + rMaster.SetFormatAttr(aSize); + } + // Evaluate header attributes if( const SvxSetItem* pHeaderSetItem = rSet.GetItemIfSet( SID_ATTR_PAGE_HEADERSET, false ) )