summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-17 13:59:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-04-17 14:19:04 +0100
commit4b431291bba8429ea80c43721bc6dd5f0ad4d2e8 (patch)
tree3aee23097bfa40ac8b45e92a48cf8aa4ae5fc87d /sw
parent3ac1584549364c573d4d4e3baed9ad39ad6ce8e4 (diff)
refactor a tiny bit for future plans, no change in logic
Change-Id: If104cdbc7e9d38c9664492f433c53ee5ffb59578
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx24
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx3
2 files changed, 17 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9ebf5eb4aee7..f65ba793dca4 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 093a56b4a69e..e3d2fbb143eb 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();