summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-01-04 12:56:40 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-01-04 17:04:39 +0100
commit0d40dfd6e0a66e36d5ee1479a4b5fd84470ed502 (patch)
treecd59dc8b77ec3c21c37446e02f34ec15b1e19ef6
parentf60a7f9af31f69ebe22f2deffa6ebe4132a50e56 (diff)
n#793262 DOCX: import w:tcMar inside w:tc
These were ignored previously, and in case they contained some margins, the resulting table was potentially smaller than necessary. (cherry picked from commit 672de66ff8ad6d1fbf8a198ee518c996611b9e2d)
-rw-r--r--writerfilter/source/dmapper/CellMarginHandler.cxx6
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.cxx20
2 files changed, 25 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx
index 36a85f165832..8b149752362b 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.cxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.cxx
@@ -84,6 +84,7 @@ void CellMarginHandler::lcl_sprm(Sprm & rSprm)
switch( rSprm.getId() )
{
case NS_ooxml::LN_CT_TblCellMar_top:
+ case NS_ooxml::LN_CT_TcMar_top:
m_nTopMargin = m_nValue;
m_bTopMarginValid = true;
break;
@@ -100,10 +101,12 @@ void CellMarginHandler::lcl_sprm(Sprm & rSprm)
}
break;
case NS_ooxml::LN_CT_TblCellMar_left:
+ case NS_ooxml::LN_CT_TcMar_left:
m_nLeftMargin = m_nValue;
m_bLeftMarginValid = true;
break;
case NS_ooxml::LN_CT_TblCellMar_bottom:
+ case NS_ooxml::LN_CT_TcMar_bottom:
m_nBottomMargin = m_nValue;
m_bBottomMarginValid = true;
break;
@@ -120,11 +123,12 @@ void CellMarginHandler::lcl_sprm(Sprm & rSprm)
}
break;
case NS_ooxml::LN_CT_TblCellMar_right:
+ case NS_ooxml::LN_CT_TcMar_right:
m_nRightMargin = m_nValue;
m_bRightMarginValid = true;
break;
default:
- OSL_FAIL( "unknown attribute");
+ OSL_FAIL( "unknown sprm");
}
}
m_nValue = 0;
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index 4e7e1d2d22cb..5de8cf1a5051 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -152,6 +152,26 @@ namespace dmapper {
}
}
break;
+ case NS_ooxml::LN_CT_TcPrBase_tcMar:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if (pProperties.get())
+ {
+ CellMarginHandlerPtr pCellMarginHandler(new CellMarginHandler);
+ pProperties->resolve(*pCellMarginHandler);
+ TablePropertyMapPtr pCellProperties(new TablePropertyMap);
+ if (pCellMarginHandler->m_bTopMarginValid)
+ pCellProperties->Insert(PROP_TOP_BORDER_DISTANCE, false, uno::makeAny(pCellMarginHandler->m_nTopMargin));
+ if (pCellMarginHandler->m_bLeftMarginValid)
+ pCellProperties->Insert(PROP_LEFT_BORDER_DISTANCE, false, uno::makeAny(pCellMarginHandler->m_nLeftMargin));
+ if (pCellMarginHandler->m_bBottomMarginValid)
+ pCellProperties->Insert(PROP_BOTTOM_BORDER_DISTANCE, false, uno::makeAny(pCellMarginHandler->m_nBottomMargin));
+ if (pCellMarginHandler->m_bRightMarginValid)
+ pCellProperties->Insert(PROP_RIGHT_BORDER_DISTANCE, false, uno::makeAny(pCellMarginHandler->m_nRightMargin));
+ cellProps(pCellProperties);
+ }
+ }
+ break;
case NS_ooxml::LN_CT_TblPrBase_shd:
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();