[Libreoffice-commits] .: sw/source

Noel Power noelp at kemper.freedesktop.org
Wed May 18 08:15:12 PDT 2011


 sw/source/filter/ww8/docxattributeoutput.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 8f1fe65d4fab09515b0b67319fef67c88533b2e0
Author: Noel Power <noel.power at novell.com>
Date:   Wed May 18 16:13:20 2011 +0100

    fix for fdo#36552
    
    fix up exported column widths

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f924824..dc28911 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 );
 }


More information about the Libreoffice-commits mailing list