summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2011-05-18 16:13:20 +0100
committerNoel Power <noel.power@novell.com>2011-05-18 16:14:57 +0100
commit8f1fe65d4fab09515b0b67319fef67c88533b2e0 (patch)
tree810b664f0395d018cb9678a673ff4eae9ca988b4
parent6f2cc24b84ef534c83a4a4d7e69b5ad4e227debb (diff)
fix for fdo#36552
fix up exported column widths
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f9248240b6..dc2891192d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1480,6 +1480,8 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
// Cell prefered width
SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() );
+ if ( pTableTextNodeInfoInner->getCell() )
+ nWidth = nWidth - GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() - 1 );
m_pSerializer->singleElementNS( XML_w, XML_tcW,
FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( nWidth ) ).getStr( ),
FSNS( XML_w, XML_type ), "dxa",
@@ -1714,12 +1716,16 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
// Write the table grid infos
m_pSerializer->startElementNS( XML_w, XML_tblGrid, FSEND );
-
+ sal_Int32 nPrv = 0;
ww8::GridColsPtr pGridCols = GetGridCols( pTableTextNodeInfoInner );
for ( ww8::GridCols::const_iterator it = pGridCols->begin(); it != pGridCols->end(); ++it )
+ {
+ sal_Int32 nWidth = sal_Int32( *it ) - nPrv;
m_pSerializer->singleElementNS( XML_w, XML_gridCol,
- FSNS( XML_w, XML_w ), OString::valueOf( sal_Int32( *it ) ).getStr( ),
+ FSNS( XML_w, XML_w ), OString::valueOf( nWidth ).getStr( ),
FSEND );
+ nPrv = sal_Int32( *it );
+ }
m_pSerializer->endElementNS( XML_w, XML_tblGrid );
}