svx/sdi/svx.sdi | 9 +++++++-- sw/source/uibase/utlui/uitool.cxx | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-)
New commits: commit a8848bcae1bd322bc6a03ca9b8c37a63db7c5dc7 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Tue Aug 19 01:52:13 2025 +0530 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Aug 22 06:25:34 2025 +0200 svx: added parameter for writer page size uno command parameter for SID_ATTR_PAGE_SIZE Change-Id: I3f44dc8bc9397893f9214ee8915eb592d32c6894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189890 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index d3ad3f937308..3360959b5667 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -6399,9 +6399,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 64b15924a168..ae2fa34a7fc5 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -69,6 +69,7 @@ #include <strings.hrc> #include <docmodel/color/ComplexColor.hxx> #include <IDocumentSettingAccess.hxx> +#include <editeng/paperinf.hxx> // 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<SfxUInt16Item>(FN_PARAM_1)->GetValue(); + SwFormatFrameSize aSize(SwFrameSize::Fixed); + aSize.SetSize(SvxPaperInfo::GetPaperSize(static_cast<Paper>(nSizeItem))); + rMaster.SetFormatAttr(aSize); + } + // Evaluate header attributes if( const SvxSetItem* pHeaderSetItem = rSet.GetItemIfSet( SID_ATTR_PAGE_HEADERSET, false ) )