summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-02 15:49:16 +0100
committerAndras Timar <andras.timar@collabora.com>2021-04-01 08:48:15 +0200
commit1f138117c7262a5df0e1f80f2423339380431f67 (patch)
treed6e7bdbc7d9583a9f5d9cbd148d5ac6f9824e49e
parentsw page gutter margin: add doc model (diff)
downloadcore-1f138117c7262a5df0e1f80f2423339380431f67.tar.gz
core-1f138117c7262a5df0e1f80f2423339380431f67.zip
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.cxx9
-rw-r--r--include/editeng/memberids.h1
-rw-r--r--offapi/com/sun/star/style/PageProperties.idl7
-rw-r--r--sw/inc/unoprnms.hxx1
-rw-r--r--sw/source/core/unocore/unomap1.cxx1
5 files changed, 19 insertions, 0 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 1f2d3975a995..0d147f6204c7 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -371,6 +371,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?
@@ -446,6 +451,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 5b3d6bd33408..987e913a03f8 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 11508d462912..3171ea6099cb 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -447,6 +447,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 },