Reinstate margin paddings on default Comment Style

This partially reverts commit 9286ac87ab

Margin paddings should not have been removed due to request on tdf#159531

Margin paddings initially removed as part of tdf#161657

Change-Id: If840a3a57d1fbbcb894e192b98f05ccbe53e89be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173687
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
This commit is contained in:
Kira Tubo
2024-09-19 15:44:55 -07:00
committed by Heiko Tietze
parent 6c37d95fbb
commit f528d18f99

View File

@@ -1015,17 +1015,22 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
{
SetAllScriptItem(aSet, SvxFontHeightItem(PT_10, 100, RES_CHRATR_FONTSIZE));
// Left margin (i.e. Before text indent)
aSet.Put(SvxTextLeftMarginItem (0, RES_MARGIN_TEXTLEFT));
// Right margin (i.e. After text indent)
aSet.Put(SvxRightMarginItem(0, RES_MARGIN_RIGHT));
// tdf#159531: Paddings added to ease readability on comments
// Left and Right margin (i.e. Before and After text indent)
auto const aIndent(o3tl::convert(0.1, o3tl::Length::cm, o3tl::Length::twip));
SvxTextLeftMarginItem const leftMargin(aIndent, RES_MARGIN_TEXTLEFT);
SvxRightMarginItem const rightMargin(aIndent, RES_MARGIN_RIGHT);
aSet.Put(leftMargin);
aSet.Put(rightMargin);
// First line indent
aSet.Put(SvxFirstLineIndentItem(0, RES_MARGIN_FIRSTLINE));
// Added as part of tdf#159531
// Top/bottom spacing (i.e. Above/Below paragraph spacing)
aSet.Put(SvxULSpaceItem(0, 0, RES_UL_SPACE));
auto const aSpacing(o3tl::convert(0.1, o3tl::Length::cm, o3tl::Length::twip));
SvxULSpaceItem topSpacing(aSpacing, 0, RES_UL_SPACE);
aSet.Put(topSpacing);
// Line spacing = SINGLE
aSet.Put(SvxLineSpacingItem(0, RES_PARATR_LINESPACING));