summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xediteng/inc/editeng/memberids.hrc1
-rw-r--r--editeng/inc/editeng/ulspitem.hxx4
-rw-r--r--editeng/source/items/frmitems.cxx8
-rw-r--r--offapi/com/sun/star/style/ParagraphProperties.idl9
-rwxr-xr-xsvx/sdi/svxitems.sdi1
-rw-r--r--sw/inc/unoprnms.hxx4
-rw-r--r--sw/source/core/unocore/unomap.cxx2
-rw-r--r--sw/source/core/unocore/unoprnms.cxx2
8 files changed, 30 insertions, 1 deletions
diff --git a/editeng/inc/editeng/memberids.hrc b/editeng/inc/editeng/memberids.hrc
index b53276ccb6e2..45e059fef8f2 100755
--- a/editeng/inc/editeng/memberids.hrc
+++ b/editeng/inc/editeng/memberids.hrc
@@ -134,6 +134,7 @@
#define MID_LO_MARGIN 4
#define MID_UP_REL_MARGIN 5
#define MID_LO_REL_MARGIN 6
+#define MID_CTX_MARGIN 7
//LRSpaceItem
#define MID_LR_MARGIN 0
diff --git a/editeng/inc/editeng/ulspitem.hxx b/editeng/inc/editeng/ulspitem.hxx
index 7a91db0d4b32..f09a18d0b153 100644
--- a/editeng/inc/editeng/ulspitem.hxx
+++ b/editeng/inc/editeng/ulspitem.hxx
@@ -51,6 +51,7 @@ class EDITENG_DLLPUBLIC SvxULSpaceItem : public SfxPoolItem
{
sal_uInt16 nUpper; // Upper space
sal_uInt16 nLower; // Lower space
+ sal_Bool bContext; // Contextual spacing?
sal_uInt16 nPropUpper, nPropLower; // relative or absolute (=100%)
public:
TYPEINFO();
@@ -83,11 +84,13 @@ public:
void SetUpperValue( const sal_uInt16 nU ) { nUpper = nU; }
void SetLowerValue( const sal_uInt16 nL ) { nLower = nL; }
+ void SetContextValue( const sal_Bool bC ) { bContext = bC; }
void SetPropUpper( const sal_uInt16 nU ) { nPropUpper = nU; }
void SetPropLower( const sal_uInt16 nL ) { nPropLower = nL; }
sal_uInt16 GetUpper() const { return nUpper; }
sal_uInt16 GetLower() const { return nLower; }
+ sal_Bool GetContext() const { return bContext; }
sal_uInt16 GetPropUpper() const { return nPropUpper; }
sal_uInt16 GetPropLower() const { return nPropLower; }
};
@@ -96,6 +99,7 @@ inline SvxULSpaceItem &SvxULSpaceItem::operator=( const SvxULSpaceItem &rCpy )
{
nUpper = rCpy.GetUpper();
nLower = rCpy.GetLower();
+ bContext = rCpy.GetContext();
nPropUpper = rCpy.GetPropUpper();
nPropLower = rCpy.GetPropLower();
return *this;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 849439d0e86a..f38ba5da886f 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -837,6 +837,7 @@ bool SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
case MID_UP_MARGIN: rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nUpper) : nUpper); break;
case MID_LO_MARGIN: rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nLower) : nLower); break;
+ case MID_CTX_MARGIN: rVal <<= bContext; break;
case MID_UP_REL_MARGIN: rVal <<= (sal_Int16) nPropUpper; break;
case MID_LO_REL_MARGIN: rVal <<= (sal_Int16) nPropLower; break;
}
@@ -849,6 +850,7 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
sal_Int32 nVal = 0;
+ sal_Bool bVal = 0;
switch( nMemberId )
{
case 0:
@@ -876,6 +878,11 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return false;
SetLower((sal_uInt16)(bConvert ? MM100_TO_TWIP(nVal) : nVal));
break;
+ case MID_CTX_MARGIN :
+ if (!(rVal >>= bVal))
+ return false;
+ SetContextValue(bVal);
+ break;
case MID_UP_REL_MARGIN:
case MID_LO_REL_MARGIN:
{
@@ -907,6 +914,7 @@ int SvxULSpaceItem::operator==( const SfxPoolItem& rAttr ) const
return ( nUpper == ( (SvxULSpaceItem&)rAttr ).nUpper &&
nLower == ( (SvxULSpaceItem&)rAttr ).nLower &&
+ bContext == ( (SvxULSpaceItem&)rAttr ).bContext &&
nPropUpper == ( (SvxULSpaceItem&)rAttr ).nPropUpper &&
nPropLower == ( (SvxULSpaceItem&)rAttr ).nPropLower );
}
diff --git a/offapi/com/sun/star/style/ParagraphProperties.idl b/offapi/com/sun/star/style/ParagraphProperties.idl
index ce770eee1d79..885f320e6c7b 100644
--- a/offapi/com/sun/star/style/ParagraphProperties.idl
+++ b/offapi/com/sun/star/style/ParagraphProperties.idl
@@ -152,6 +152,15 @@ published service ParagraphProperties
*/
[property] long ParaBottomMargin;
+ /** determines if contextual spacing is used.
+
+ @since LibreOffice 3.6
+
+ <p>If true, the top and bottom margins of the paragraph should not be
+ applied when the previous and next paragraphs have the same style.</p>
+ */
+ [optional, property] boolean ParaContextMargin;
+
//-------------------------------------------------------------------------
/** determines if the paragraph is included in the
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index a4f3c3106321..ef1a954f3983 100755
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -546,6 +546,7 @@ struct SvxULSpace
{
INT32 TopMargin MID_UP_MARGIN; // % or direct
INT32 BottomMargin MID_LO_MARGIN; // % or direct
+ BOOL ContextMargin MID_CTX_MARGIN;
INT16 TopRelMargin MID_UP_REL_MARGIN;
INT16 BottomRelMargin MID_LO_REL_MARGIN;
};
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 8114f91d365f..38911ccf386d 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -812,7 +812,9 @@ enum SwPropNameIds
/* 0747 */ UNO_NAME_LINE_STYLE,
/* 0748 */ UNO_NAME_LINE_WIDTH,
-/* 0749 */ SW_PROPNAME_END
+/* 0749 */ UNO_NAME_PARA_CONTEXT_MARGIN,
+
+/* 0750 */ SW_PROPNAME_END
// new items in this array must match SwPropNameTab aPropNameTab
};
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index ca85a1801751..d3f7db100d40 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -209,6 +209,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ SW_PROP_NMID(UNO_NAME_PARA_REGISTER_MODE_ACTIVE), RES_PARATR_REGISTER,CPPU_E2T(CPPUTYPE_BOOLEAN) , PropertyAttribute::MAYBEVOID, 0}, \
{ SW_PROP_NMID(UNO_NAME_PARA_TOP_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_UP_MARGIN|CONVERT_TWIPS}, \
{ SW_PROP_NMID(UNO_NAME_PARA_BOTTOM_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_LO_MARGIN|CONVERT_TWIPS}, \
+ { SW_PROP_NMID(UNO_NAME_PARA_CONTEXT_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, MID_CTX_MARGIN}, \
{ SW_PROP_NMID(UNO_NAME_CHAR_BACK_TRANSPARENT), RES_CHRATR_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID ,MID_GRAPHIC_TRANSPARENT }, \
{ SW_PROP_NMID(UNO_NAME_PARA_BACK_TRANSPARENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID ,MID_GRAPHIC_TRANSPARENT }, \
{ SW_PROP_NMID(UNO_NAME_NUMBERING_STYLE_NAME), RES_PARATR_NUMRULE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, \
@@ -427,6 +428,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ SW_PROP_NMID(UNO_NAME_PARA_REGISTER_MODE_ACTIVE), RES_PARATR_REGISTER, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},\
{ SW_PROP_NMID(UNO_NAME_PARA_TOP_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_UP_MARGIN|CONVERT_TWIPS},\
{ SW_PROP_NMID(UNO_NAME_PARA_BOTTOM_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_LO_MARGIN|CONVERT_TWIPS},\
+ { SW_PROP_NMID(UNO_NAME_PARA_CONTEXT_MARGIN), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_CTX_MARGIN},\
{ SW_PROP_NMID(UNO_NAME_PARA_TOP_MARGIN_RELATIVE), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_UP_REL_MARGIN},\
{ SW_PROP_NMID(UNO_NAME_PARA_BOTTOM_MARGIN_RELATIVE), RES_UL_SPACE, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_LO_REL_MARGIN},\
TABSTOPS_MAP_ENTRY\
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index a3f84d469b8c..9b0f64b56fec 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -787,6 +787,8 @@ const SwPropNameTab aPropNameTab = {
/* 0747 UNO_NAME_LINE_STYLE */ {MAP_CHAR_LEN("LineStyle")},
/* 0748 UNO_NAME_LINE_WIDTH */ {MAP_CHAR_LEN("LineWidth")},
+/* 0749 PARA_CONTEXT_MARGIN */ {MAP_CHAR_LEN("ParaContextMargin")},
+
// new items in this array must match enum SwPropNameIds
};