summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-16 16:06:49 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-19 15:33:13 +0100
commit481e04cd43701e6f760715e1c22000707f63ce32 (patch)
treeb50244f0e59075ca4349da431f6ecaf91d39995b /sw
parent67697d941503b52c4fb455e3c8cf2fcdc58377bd (diff)
Added column separator style in ODF
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unomap.hxx1
-rw-r--r--sw/inc/unoprnms.hxx3
-rw-r--r--sw/inc/unosett.hxx3
-rw-r--r--sw/source/core/layout/atrfrm.cxx8
-rw-r--r--sw/source/core/unocore/unomap.cxx1
-rw-r--r--sw/source/core/unocore/unoprnms.cxx1
-rw-r--r--sw/source/core/unocore/unosett.cxx26
7 files changed, 41 insertions, 2 deletions
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index cfc373e9887b..46b370bc0027 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -316,6 +316,7 @@
#define WID_TXTCOL_LINE_IS_ON 4
#define WID_TXTCOL_IS_AUTOMATIC 5
#define WID_TXTCOL_AUTO_DISTANCE 6
+#define WID_TXTCOL_LINE_STYLE 7
class SwItemPropertySet : public SfxItemPropertySet
{
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index e9a2deb5e8c9..3462d6c1e182 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -807,7 +807,8 @@ enum SwPropNameIds
/* 0739 */ UNO_NAME_IS_TEMPLATE,
/* 0740 */ UNO_NAME_VBA_DOCOBJ,
/* 0741 */ UNO_NAME_NESTED_TEXT_CONTENT,
-/* 0742 */ SW_PROPNAME_END
+/* 0742 */ UNO_NAME_SEPARATOR_LINE_STYLE,
+/* 0743 */ SW_PROPNAME_END
};
struct SwPropNameLen
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index 6b2cd2048f96..c5e75de6eb8f 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -262,6 +262,8 @@ class SwXTextColumns : public cppu::WeakAggImplHelper4
sal_Int8 nSepLineHeightRelative;
sal_Int8 nSepLineVertAlign;//style::VerticalAlignment
sal_Bool bSepLineIsOn;
+ sal_Int8 nSepLineStyle;
+
protected:
virtual ~SwXTextColumns();
public:
@@ -301,6 +303,7 @@ public:
sal_Int8 GetSepLineHeightRelative() const {return nSepLineHeightRelative;}
sal_Int8 GetSepLineVertAlign() const {return nSepLineVertAlign;}
sal_Bool GetSepLineIsOn() const {return bSepLineIsOn;}
+ sal_Int8 GetSepLineStyle() const {return nSepLineStyle;}
sal_Bool IsAutomaticWidth() const {return bIsAutomaticWidth;}
};
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index f6f46d37a1d9..6d224e058aa1 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1071,6 +1071,14 @@ bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
nLineWidth = pSwColums->GetSepLineWidth();
aLineColor.SetColor(pSwColums->GetSepLineColor());
nLineHeight = pSwColums->GetSepLineHeightRelative();
+ switch ( pSwColums->GetSepLineStyle() )
+ {
+ default:
+ case 0: eLineStyle = NO_STYLE; break;
+ case 1: eLineStyle = SOLID; break;
+ case 2: eLineStyle = DOTTED; break;
+ case 3: eLineStyle = DASHED; break;
+ }
if(!pSwColums->GetSepLineIsOn())
eAdj = COLADJ_NONE;
else switch(pSwColums->GetSepLineVertAlign())
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index b6ed84989dbf..e7a54869b0b6 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1613,6 +1613,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT), WID_TXTCOL_LINE_REL_HGT, CPPU_E2T(CPPUTYPE_INT32),PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_VERTIVAL_ALIGNMENT), WID_TXTCOL_LINE_ALIGN, CPPU_E2T(CPPUTYPE_VERTALIGN),PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_IS_ON), WID_TXTCOL_LINE_IS_ON, CPPU_E2T(CPPUTYPE_BOOLEAN),PROPERTY_NONE, 0},
+ {SW_PROP_NMID(UNO_NAME_SEPARATOR_LINE_STYLE), WID_TXTCOL_LINE_STYLE, CPPU_E2T(CPPUTYPE_INT8),PROPERTY_NONE, 0},
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aTextColumns_Impl;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 9e3437915ee5..dbe03057b66f 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -785,6 +785,7 @@ const SwPropNameTab aPropNameTab = {
/* 0740 UNO_NAME_VBA_DOCOBJ */ {MAP_CHAR_LEN("ThisVBADocObj")},
/* 0741 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
+/* 0742 UNO_NAME_SEPARATOR_LINE_STYLE */ {MAP_CHAR_LEN("SeparatorLineStyle")},
};
const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index dc407cbed2bb..eb88942ec893 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -100,6 +100,12 @@ struct PropValData
{}
};
+// Constants for the css::text::ColumnSeparatorStyle
+#define API_COL_LINE_NONE 0
+#define API_COL_LINE_SOLID 1
+#define API_COL_LINE_DOTTED 2
+#define API_COL_LINE_DASHED 3
+
typedef PropValData* PropValDataPtr;
SV_DECL_PTRARR(PropValDataArr, PropValDataPtr, 5, 5 )
SV_IMPL_PTRARR(PropValDataArr, PropValDataPtr)
@@ -2354,7 +2360,8 @@ SwXTextColumns::SwXTextColumns(sal_uInt16 nColCount) :
nSepLineColor(0), //black
nSepLineHeightRelative(100),//full height
nSepLineVertAlign(style::VerticalAlignment_MIDDLE),
- bSepLineIsOn(sal_False)
+ bSepLineIsOn(sal_False),
+ nSepLineStyle(API_COL_LINE_NONE) // None
{
if(nColCount)
setColumnCount(nColCount);
@@ -2390,6 +2397,15 @@ SwXTextColumns::SwXTextColumns(const SwFmtCol& rFmtCol) :
nSepLineColor = rFmtCol.GetLineColor().GetColor();
nSepLineHeightRelative = rFmtCol.GetLineHeight();
bSepLineIsOn = rFmtCol.GetLineAdj() != COLADJ_NONE;
+ sal_Int8 nStyle = API_COL_LINE_NONE;
+ switch (rFmtCol.GetLineStyle())
+ {
+ case SOLID: nStyle = API_COL_LINE_SOLID; break;
+ case DOTTED: nStyle = API_COL_LINE_DOTTED; break;
+ case DASHED: nStyle = API_COL_LINE_DASHED; break;
+ default: break;
+ }
+ nSepLineStyle = nStyle;
switch(rFmtCol.GetLineAdj())
{
case COLADJ_TOP: nSepLineVertAlign = style::VerticalAlignment_TOP; break;
@@ -2488,6 +2504,11 @@ void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any&
case WID_TXTCOL_LINE_COLOR:
aValue >>= nSepLineColor;
break;
+ case WID_TXTCOL_LINE_STYLE:
+ {
+ aValue >>= nSepLineStyle;
+ }
+ break;
case WID_TXTCOL_LINE_REL_HGT:
{
sal_Int8 nTmp = 0;
@@ -2551,6 +2572,9 @@ Any SwXTextColumns::getPropertyValue( const OUString& rPropertyName )
case WID_TXTCOL_LINE_COLOR:
aRet <<= nSepLineColor;
break;
+ case WID_TXTCOL_LINE_STYLE:
+ aRet <<= nSepLineStyle;
+ break;
case WID_TXTCOL_LINE_REL_HGT:
aRet <<= nSepLineHeightRelative;
break;