From 80cd760a21a0b752e4b0a540ed5eb4c9f4d41481 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 2 Feb 2021 12:22:15 +0100 Subject: sw page gutter margin: add doc model The page gutter defines the amount of extra space added to the specified margin, above any existing margin values. This can be helpful in case of printed books: e.g. 1cm left margin, 1cm right margin, then some additional gutter margin on the left can mean that once the book is printed and binding consumes its space, the remaining left/right margin is matching. This is just the doc model, other parts will come in follow-up commits. (cherry picked from commit 48829edfb148ff61d1e03319547151380899ba63) Conflicts: editeng/source/items/frmitems.cxx include/editeng/lrspitem.hxx Change-Id: Ibd3e836ced664b57e817f5c0952098460b683089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110597 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna --- editeng/source/items/frmitems.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'editeng') diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 8eb8ba879533..2fde6817e43c 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -308,6 +308,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) : nTxtLeft ( 0 ), nLeftMargin ( 0 ), nRightMargin ( 0 ), + m_nGutterMargin(0), nPropFirstLineOfst( 100 ), nPropLeftMargin( 100 ), nPropRightMargin( 100 ), @@ -327,6 +328,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const long nLeft, const long nRight, nTxtLeft ( nTLeft ), nLeftMargin ( nLeft ), nRightMargin ( nRight ), + m_nGutterMargin(0), nPropFirstLineOfst( 100 ), nPropLeftMargin( 100 ), nPropRightMargin( 100 ), @@ -491,6 +493,7 @@ bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) const return ( nFirstLineOfst == rOther.GetTextFirstLineOfst() && nTxtLeft == rOther.GetTextLeft() && + m_nGutterMargin == rOther.GetGutterMargin() && nLeftMargin == rOther.GetLeft() && nRightMargin == rOther.GetRight() && nPropFirstLineOfst == rOther.GetPropTextFirstLineOfst() && @@ -615,6 +618,8 @@ void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nTxtLeft"), BAD_CAST(OString::number(nTxtLeft).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLeftMargin"), BAD_CAST(OString::number(nLeftMargin).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRightMargin"), BAD_CAST(OString::number(nRightMargin).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nGutterMargin"), + BAD_CAST(OString::number(m_nGutterMargin).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropFirstLineOfst"), BAD_CAST(OString::number(nPropFirstLineOfst).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropLeftMargin"), BAD_CAST(OString::number(nPropLeftMargin).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPropRightMargin"), BAD_CAST(OString::number(nPropRightMargin).getStr())); -- cgit