From ea404ac36ac36def92b5df27e42645af9e0eda68 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Mon, 5 Jan 2015 09:55:16 +0100 Subject: Use more proper integer types and avoid unneeded downcasts Change-Id: Idcb8f5fd47ae4a7952f313a4402a980359c90a83 --- sw/source/filter/ww8/WW8TableInfo.cxx | 5 ++--- sw/source/filter/ww8/attributeoutputbase.hxx | 2 +- sw/source/filter/ww8/docxattributeoutput.cxx | 13 ++++++------- sw/source/filter/ww8/rtfattributeoutput.cxx | 7 +++---- sw/source/filter/ww8/wrtww8.cxx | 4 ++-- 5 files changed, 14 insertions(+), 17 deletions(-) (limited to 'sw/source/filter/ww8') diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 051a661feddb..13efc756540f 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -201,11 +201,10 @@ GridColsPtr WW8TableNodeInfoInner::getGridColsOfRow(AttributeOutputBase & rBase, const SwFmtFrmSize &rSize = pFmt->GetFrmSize(); unsigned long nTblSz = static_cast(rSize.GetWidth()); - sal_uInt32 nPageSize = 0; + long nPageSize = 0; bool bRelBoxSize = false; - rBase.GetTablePageSize - ( this, nPageSize, bRelBoxSize ); + rBase.GetTablePageSize( this, nPageSize, bRelBoxSize ); SwTwips nSz = 0; Widths::const_iterator aWidthsEnd = pWidths->end(); diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 1dffa6340def..3916eb32fa6e 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -647,7 +647,7 @@ public: void GetTablePageSize ( ww8::WW8TableNodeInfoInner * pTableTextNodeInfoInner, - sal_uInt32& rPageSize, bool& rRelBoxSize ); + long& rPageSize, bool& rRelBoxSize ); /// Exports the definition (image, size) of a single numbering picture bullet. virtual void BulletDefinition(int /*nId*/, const Graphic& /*rGraphic*/, Size /*aSize*/) {} diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 15b5dea6e8f6..a1c9832065ef 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2598,8 +2598,8 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co pBorderLine->GetBorderLineStyle(), pBorderLine->GetWidth())); // The unit is the 8th of point sal_Int32 nWidth = sal_Int32( fConverted / 2.5 ); - sal_uInt16 nMinWidth = 2; - sal_uInt16 nMaxWidth = 96; + const sal_Int32 nMinWidth = 2; + const sal_Int32 nMaxWidth = 96; if ( nWidth > nMaxWidth ) nWidth = nMaxWidth; @@ -2939,7 +2939,7 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { - sal_uInt32 nPageSize = 0; + long nPageSize = 0; bool bRelBoxSize = false; // Create the SwWriteTable instance to use col spans (and maybe other infos) @@ -2947,14 +2947,13 @@ void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t const SwTable* pTable = pTableTextNodeInfoInner->getTable( ); const SwFrmFmt *pFmt = pTable->GetFrmFmt( ); - SwTwips nTblSz = pFmt->GetFrmSize( ).GetWidth( ); + const sal_uInt32 nTblSz = static_cast(pFmt->GetFrmSize( ).GetWidth( )); const SwHTMLTableLayout *pLayout = pTable->GetHTMLTableLayout(); if( pLayout && pLayout->IsExportable() ) m_pTableWrt = new SwWriteTable( pLayout ); else - m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), (sal_uInt16)nPageSize, - (sal_uInt16)nTblSz, false); + m_pTableWrt = new SwWriteTable( pTable->GetTabLines(), nPageSize, nTblSz, false); } void DocxAttributeOutput::StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) @@ -3115,7 +3114,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t m_pSerializer->mark( aSeqOrder ); - sal_uInt32 nPageSize = 0; + long nPageSize = 0; const char* widthType = "dxa"; bool bRelBoxSize = false; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index d6e6115d235c..3ae033e35dd4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -844,7 +844,7 @@ void RtfAttributeOutput::TableRowEnd(sal_uInt32 /*nDepth*/) void RtfAttributeOutput::InitTableHelper(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) { - sal_uInt32 nPageSize = 0; + long nPageSize = 0; bool bRelBoxSize = false; // Create the SwWriteTable instance to use col spans @@ -852,14 +852,13 @@ void RtfAttributeOutput::InitTableHelper(ww8::WW8TableNodeInfoInner::Pointer_t p const SwTable* pTable = pTableTextNodeInfoInner->getTable(); const SwFrmFmt* pFmt = pTable->GetFrmFmt(); - SwTwips nTblSz = pFmt->GetFrmSize().GetWidth(); + const sal_uInt32 nTblSz = static_cast(pFmt->GetFrmSize().GetWidth()); const SwHTMLTableLayout* pLayout = pTable->GetHTMLTableLayout(); if (pLayout && pLayout->IsExportable()) m_pTableWrt = new SwWriteTable(pLayout); else - m_pTableWrt = new SwWriteTable(pTable->GetTabLines(), (sal_uInt16)nPageSize, - (sal_uInt16)nTblSz, false); + m_pTableWrt = new SwWriteTable(pTable->GetTabLines(), nPageSize, nTblSz, false); } void RtfAttributeOutput::StartTable(ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index af4167581941..b724c243da0c 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2330,9 +2330,9 @@ ww8::WidthsPtr AttributeOutputBase::GetColumnWidths( ww8::WW8TableNodeInfoInner: return pTableTextNodeInfoInner->getGridColsOfRow(*this, true); } -void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner * pTableTextNodeInfoInner, sal_uInt32& rPageSize, bool& rRelBoxSize ) +void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner * pTableTextNodeInfoInner, long& rPageSize, bool& rRelBoxSize ) { - sal_uInt32 nPageSize = 0; + long nPageSize = 0; const SwNode *pTxtNd = pTableTextNodeInfoInner->getNode( ); const SwTable *pTable = pTableTextNodeInfoInner->getTable( ); -- cgit