summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/dmapper/BorderHandler.cxx42
-rw-r--r--writerfilter/source/ooxml/model.xml12
2 files changed, 43 insertions, 11 deletions
diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index 85fe714c25e3..90e8456ca3b3 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -106,25 +106,45 @@ void BorderHandler::lcl_attribute(Id rName, Value & rVal)
void BorderHandler::lcl_sprm(Sprm & rSprm)
{
+ BorderPosition pos = BORDER_COUNT; // invalid pos
+ bool rtl = false; // TODO detect
switch( rSprm.getId())
{
case NS_ooxml::LN_CT_TblBorders_top:
+ pos = BORDER_TOP;
+ break;
+ case NS_ooxml::LN_CT_TblBorders_start:
+ pos = rtl ? BORDER_RIGHT : BORDER_LEFT;
+ break;
case NS_ooxml::LN_CT_TblBorders_left:
+ pos = BORDER_LEFT;
+ break;
case NS_ooxml::LN_CT_TblBorders_bottom:
+ pos = BORDER_BOTTOM;
+ break;
+ case NS_ooxml::LN_CT_TblBorders_end:
+ pos = rtl ? BORDER_LEFT : BORDER_RIGHT;
+ break;
case NS_ooxml::LN_CT_TblBorders_right:
+ pos = BORDER_RIGHT;
+ break;
case NS_ooxml::LN_CT_TblBorders_insideH:
+ pos = BORDER_HORIZONTAL;
+ break;
case NS_ooxml::LN_CT_TblBorders_insideV:
- {
- writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
- if( pProperties.get())
- pProperties->resolve(*this);
- ConversionHelper::MakeBorderLine( m_nLineWidth, m_nLineType, m_nLineColor,
- m_aBorderLines[rSprm.getId() - NS_ooxml::LN_CT_TblBorders_top], m_bOOXML );
-
- m_aFilledLines[ rSprm.getId( ) - NS_ooxml::LN_CT_TblBorders_top] = true;
- }
- break;
- default:;
+ pos = BORDER_VERTICAL;
+ break;
+ default:
+ break;
+ }
+ if( pos != BORDER_COUNT )
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if( pProperties.get())
+ pProperties->resolve(*this);
+ ConversionHelper::MakeBorderLine( m_nLineWidth, m_nLineType, m_nLineColor,
+ m_aBorderLines[ pos ], m_bOOXML );
+ m_aFilledLines[ pos ] = true;
}
}
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index e715fe7c3142..1e1e0d9dc0d6 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -17933,6 +17933,11 @@
</element>
</optional>
<optional>
+ <element name="start">
+ <ref name="CT_Border"/>
+ </element>
+ </optional>
+ <optional>
<element name="left">
<ref name="CT_Border"/>
</element>
@@ -17943,6 +17948,11 @@
</element>
</optional>
<optional>
+ <element name="end">
+ <ref name="CT_Border"/>
+ </element>
+ </optional>
+ <optional>
<element name="right">
<ref name="CT_Border"/>
</element>
@@ -22810,8 +22820,10 @@
<resource name="CT_TblBorders" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TblBorders_top"/>
+ <element name="start" tokenid="ooxml:CT_TblBorders_start"/>
<element name="left" tokenid="ooxml:CT_TblBorders_left"/>
<element name="bottom" tokenid="ooxml:CT_TblBorders_bottom"/>
+ <element name="end" tokenid="ooxml:CT_TblBorders_end"/>
<element name="right" tokenid="ooxml:CT_TblBorders_right"/>
<element name="insideH" tokenid="ooxml:CT_TblBorders_insideH"/>
<element name="insideV" tokenid="ooxml:CT_TblBorders_insideV"/>