diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-02 15:49:16 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-02 19:30:33 +0100 |
commit | 947277146e4c1ff7544371095fcc6bd5842b2d98 (patch) | |
tree | a7dc2430aac4c58bf9a6dc9f780d2202e7130b92 | |
parent | 85c5c168f00bb1f8571834587f3693efdfc2e4b3 (diff) |
sw page gutter margin: add UNO API
SvxLRSpaceItem is used for all sorts of left/right margins, but gutter
only makes sense for pages, so only expose the gutter margin in the page
properties.
Change-Id: Icfca2499e944081b70bbdbc4c62e78cade25f5c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110322
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | editeng/source/items/frmitems.cxx | 9 | ||||
-rw-r--r-- | include/editeng/memberids.h | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/style/PageProperties.idl | 7 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap1.cxx | 1 |
5 files changed, 19 insertions, 0 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index e1520735d804..c6b26c1c03a5 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -372,6 +372,11 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const rVal <<= IsAutoFirst(); break; + case MID_GUTTER_MARGIN: + rVal <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(m_nGutterMargin) + : m_nGutterMargin); + break; + default: bRet = false; // SfxDispatchController_Impl::StateChanged calls this with hardcoded 0 triggering this; there used to be a MID_LR_MARGIN 0 but what type would it have? @@ -447,6 +452,10 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) SetAutoFirst( Any2Bool(rVal) ); break; + case MID_GUTTER_MARGIN: + SetGutterMargin(bConvert ? convertMm100ToTwip(nVal) : nVal); + break; + default: OSL_FAIL("unknown MemberId"); return false; diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h index a857d7593afb..8a6c9d0e7769 100644 --- a/include/editeng/memberids.h +++ b/include/editeng/memberids.h @@ -129,6 +129,7 @@ #define MID_FIRST_LINE_REL_INDENT 9 #define MID_FIRST_AUTO 10 #define MID_TXT_LMARGIN 11 +#define MID_GUTTER_MARGIN 12 //ProtectItem #define MID_PROTECT_CONTENT 0 diff --git a/offapi/com/sun/star/style/PageProperties.idl b/offapi/com/sun/star/style/PageProperties.idl index 73242f230f90..dccd63f20b04 100644 --- a/offapi/com/sun/star/style/PageProperties.idl +++ b/offapi/com/sun/star/style/PageProperties.idl @@ -487,6 +487,13 @@ published service PageProperties @since LibreOffice 6.1 */ [optional, property, maybevoid] com::sun::star::graphic::XGraphic FooterBackGraphic; + + /** determines the gutter margin of the page. + + @since LibreOffice 7.2 + */ + [optional, property] long GutterMargin; + }; }; }; }; }; diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 8fc67fdf5206..9cceac0f8d0f 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -66,6 +66,7 @@ #define UNO_NAME_PARA_HYPHENATION_NO_CAPS "ParaHyphenationNoCaps" #define UNO_NAME_LEFT_MARGIN "LeftMargin" #define UNO_NAME_RIGHT_MARGIN "RightMargin" +#define UNO_NAME_GUTTER_MARGIN "GutterMargin" #define UNO_NAME_HEADER_LEFT_MARGIN "HeaderLeftMargin" #define UNO_NAME_HEADER_RIGHT_MARGIN "HeaderRightMargin" #define UNO_NAME_FOOTER_LEFT_MARGIN "FooterLeftMargin" diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx index d3fb8b909608..253da09f67f1 100644 --- a/sw/source/core/unocore/unomap1.cxx +++ b/sw/source/core/unocore/unomap1.cxx @@ -445,6 +445,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPageStylePropertyMa { u"" UNO_NAME_BACK_GRAPHIC_LOCATION, RES_BACKGROUND, cppu::UnoType<css::style::GraphicLocation>::get(), PROPERTY_NONE ,MID_GRAPHIC_POSITION}, { u"" UNO_NAME_LEFT_MARGIN, RES_LR_SPACE, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS}, { u"" UNO_NAME_RIGHT_MARGIN, RES_LR_SPACE, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS}, + { u"" UNO_NAME_GUTTER_MARGIN, RES_LR_SPACE, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_GUTTER_MARGIN | CONVERT_TWIPS}, { u"" UNO_NAME_BACK_TRANSPARENT, RES_BACKGROUND, cppu::UnoType<bool>::get(), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENT }, { u"" UNO_NAME_LEFT_BORDER, RES_BOX, cppu::UnoType<css::table::BorderLine>::get(), 0, LEFT_BORDER |CONVERT_TWIPS }, { u"" UNO_NAME_RIGHT_BORDER, RES_BOX, cppu::UnoType<css::table::BorderLine>::get(), 0, RIGHT_BORDER |CONVERT_TWIPS }, |