[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Fri Apr 17 06:21:41 PDT 2015


 sw/source/filter/ww8/docxattributeoutput.cxx |   24 +++++++++++++++---------
 sw/source/filter/ww8/docxattributeoutput.hxx |    3 ++-
 2 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 4b431291bba8429ea80c43721bc6dd5f0ad4d2e8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 17 13:59:52 2015 +0100

    refactor a tiny bit for future plans, no change in logic
    
    Change-Id: If104cdbc7e9d38c9664492f433c53ee5ffb59578

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9ebf5eb..f65ba79 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2812,7 +2812,7 @@ static void impl_cellMargins( FSHelperPtr pSerializer, const SvxBoxItem& rBox, s
     }
 }
 
-void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow )
 {
     m_pSerializer->startElementNS( XML_w, XML_tcPr, FSEND );
 
@@ -2824,9 +2824,9 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
     TableCellRedline( pTableTextNodeInfoInner );
 
     // Cell preferred width
-    SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() );
-    if ( pTableTextNodeInfoInner->getCell() )
-        nWidth = nWidth - GetGridCols( pTableTextNodeInfoInner )->at( pTableTextNodeInfoInner->getCell() - 1 );
+    SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( nCell );
+    if ( nCell )
+        nWidth = nWidth - GetGridCols( pTableTextNodeInfoInner )->at( nCell - 1 );
     m_pSerializer->singleElementNS( XML_w, XML_tcW,
            FSNS( XML_w, XML_w ), OString::number( nWidth ).getStr( ),
            FSNS( XML_w, XML_type ), "dxa",
@@ -2834,8 +2834,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point
 
     // Horizontal spans
     const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
-    SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
-    sal_uInt32 nCell = pTableTextNodeInfoInner->getCell();
+    SwWriteTableRow *pRow = aRows[ nRow ];
     const SwWriteTableCells *tableCells =  &pRow->GetCells();
     if (nCell < tableCells->size() )
     {
@@ -2987,7 +2986,7 @@ void DocxAttributeOutput::EndTableRow( )
     m_pSerializer->endElementNS( XML_w, XML_tr );
 }
 
-void DocxAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+void DocxAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow )
 {
     if ( !m_pTableWrt )
         InitTableHelper( pTableTextNodeInfoInner );
@@ -2995,11 +2994,18 @@ void DocxAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t
     m_pSerializer->startElementNS( XML_w, XML_tc, FSEND );
 
     // Write the cell properties here
-    TableCellProperties( pTableTextNodeInfoInner );
+    TableCellProperties( pTableTextNodeInfoInner, nCell, nRow );
 
     m_tableReference->m_bTableCellOpen = true;
 }
 
+void DocxAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
+{
+    const sal_uInt32 nCell = pTableTextNodeInfoInner->getCell();
+    const sal_uInt32 nRow = pTableTextNodeInfoInner->getRow();
+    StartTableCell(pTableTextNodeInfoInner, nCell, nRow);
+}
+
 void DocxAttributeOutput::EndTableCell( )
 {
     if (m_tableReference->m_bTableCellParaSdtOpen)
@@ -3574,7 +3580,7 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
     const SwWriteTableCells *tableCells =  &pRow->GetCells();
     if (nCell < tableCells->size() )
     {
-        const SwWriteTableCell *pCell = &pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
+        const SwWriteTableCell *pCell = &pRow->GetCells( )[ nCell ];
         switch( pCell->GetVertOri())
         {
         case text::VertOrientation::TOP:
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 093a56b..e3d2fbb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -424,7 +424,8 @@ private:
     void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
-    void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+    void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
+    void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner, sal_uInt32 nCell, sal_uInt32 nRow );
     void EndTableCell( );
     void EndTableRow( );
     void EndTable();


More information about the Libreoffice-commits mailing list