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.klos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit fb4f5e6a68fb74b37356bb9ca11f89df1c106184)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190503
Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Pranam Lashkari
2025-09-02 11:24:40 +02:00
parent 49e84a4f35
commit 65639e909f
2 changed files with 16 additions and 2 deletions
+7 -2
View File
@@ -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,
+9
View File
@@ -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 ) )