summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-08-15 10:21:00 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-15 17:09:11 +0200
commit69fd51d606619d90f291059b1cd82ec65a2c91e5 (patch)
tree51409eaa8419bc8353b728aaef371ba7042771b6 /writerfilter
parenta9a2ed7705c8248142aa0897fcdac422edd3b123 (diff)
DOCX import: handle w:topFromText and w:bottomFromText for floating tables
Change-Id: Ia3a95d785d19f7be750e3723c1c159395ae8476f
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/TablePositionHandler.cxx12
-rw-r--r--writerfilter/source/dmapper/TablePositionHandler.hxx2
-rw-r--r--writerfilter/source/ooxml/model.xml6
3 files changed, 16 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/TablePositionHandler.cxx b/writerfilter/source/dmapper/TablePositionHandler.cxx
index 6d32bba7bb54..19613a0d6489 100644
--- a/writerfilter/source/dmapper/TablePositionHandler.cxx
+++ b/writerfilter/source/dmapper/TablePositionHandler.cxx
@@ -30,6 +30,8 @@ TablePositionHandler::TablePositionHandler() :
m_aXSpec( ),
m_nY( 0 ),
m_nX( 0 ),
+ m_nTopFromText(0),
+ m_nBottomFromText(0),
m_nLeftBorderDistance(DEF_BORDER_DIST),
m_nRightBorderDistance(DEF_BORDER_DIST)
{
@@ -62,6 +64,12 @@ void TablePositionHandler::lcl_attribute(Id rName, Value& rVal)
case NS_ooxml::LN_CT_TblPPr_tblpX:
m_nX = rVal.getInt();
break;
+ case NS_ooxml::LN_CT_TblPPr_topFromText:
+ m_nTopFromText = rVal.getInt();
+ break;
+ case NS_ooxml::LN_CT_TblPPr_bottomFromText:
+ m_nBottomFromText = rVal.getInt();
+ break;
default:
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->element("unhandled");
@@ -95,9 +103,9 @@ uno::Sequence<beans::PropertyValue> TablePositionHandler::getTablePosition() con
pFrameProperties[5].Name = "RightMargin";
pFrameProperties[5].Value <<= sal_Int32(0);
pFrameProperties[6].Name = "TopMargin";
- pFrameProperties[6].Value <<= sal_Int32(0);
+ pFrameProperties[6].Value <<= ConversionHelper::convertTwipToMM100(m_nTopFromText);
pFrameProperties[7].Name = "BottomMargin";
- pFrameProperties[7].Value <<= sal_Int32(0);
+ pFrameProperties[7].Value <<= ConversionHelper::convertTwipToMM100(m_nBottomFromText);
table::BorderLine2 aEmptyBorder;
pFrameProperties[8].Name = "TopBorder";
diff --git a/writerfilter/source/dmapper/TablePositionHandler.hxx b/writerfilter/source/dmapper/TablePositionHandler.hxx
index 43eabbcddae5..366a6e438303 100644
--- a/writerfilter/source/dmapper/TablePositionHandler.hxx
+++ b/writerfilter/source/dmapper/TablePositionHandler.hxx
@@ -27,6 +27,8 @@ namespace writerfilter {
OUString m_aXSpec;
sal_Int32 m_nY;
sal_Int32 m_nX;
+ sal_Int32 m_nTopFromText;
+ sal_Int32 m_nBottomFromText;
sal_Int32 m_nLeftBorderDistance;
sal_Int32 m_nRightBorderDistance;
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 64126ce275cd..402323fc1ff6 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -17993,11 +17993,11 @@
<xs:documentation>(Distance From Right of Table to Text</xs:documentation>
</attribute>
<attribute name="topFromText">
- <text/>
+ <ref name="ST_SignedTwipsMeasure"/>
<xs:documentation>Distance From Top of Table to Text</xs:documentation>
</attribute>
<attribute name="bottomFromText">
- <text/>
+ <ref name="ST_SignedTwipsMeasure"/>
<xs:documentation>Distance From Bottom of Table to Text</xs:documentation>
</attribute>
<attribute name="vertAnchor">
@@ -22913,6 +22913,8 @@
<attribute name="tblpXSpec" tokenid="ooxml:CT_TblPPr_tblpXSpec"/>
<attribute name="tblpY" tokenid="ooxml:CT_TblPPr_tblpY"/>
<attribute name="tblpX" tokenid="ooxml:CT_TblPPr_tblpX"/>
+ <attribute name="topFromText" tokenid="ooxml:CT_TblPPr_topFromText"/>
+ <attribute name="bottomFromText" tokenid="ooxml:CT_TblPPr_bottomFromText"/>
</resource>
<resource name="CT_TblGridCol" resource="Value" tag="table">
<attribute name="w" tokenid="ooxml:CT_TblGridCol_w" action="setValue"/>