summaryrefslogtreecommitdiff
path: root/svx/source/table
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:55 +0100
commitc049c76fc521f2b55b39a6e9eb0f0092bcf6ef77 (patch)
tree2bc2c059a6f6a175a0c0e5321887adc077fef419 /svx/source/table
parent0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (diff)
More loplugin:cstylecast: svx
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I100e6c14cbf1d780f0e5ebca6b0c9e71ce1caaf7
Diffstat (limited to 'svx/source/table')
-rw-r--r--svx/source/table/accessibletableshape.cxx4
-rw-r--r--svx/source/table/cell.cxx6
-rw-r--r--svx/source/table/svdotable.cxx2
-rw-r--r--svx/source/table/tablecontroller.cxx16
-rw-r--r--svx/source/table/tablelayouter.cxx14
-rw-r--r--svx/source/table/tablertfimporter.cxx4
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx8
7 files changed, 27 insertions, 27 deletions
diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx
index 2427c36ed3f6..f856d6b6e3d5 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -768,8 +768,8 @@ sal_Int32 SAL_CALL AccessibleTableShape::getSelectedAccessibleChildCount()
CellPos aFirstPos, aLastPos;
pController->getSelectedCells( aFirstPos, aLastPos );
- const sal_Int32 nSelectedColumns = std::max( (sal_Int32)0, aLastPos.mnCol - aFirstPos.mnCol ) + 1;
- const sal_Int32 nSelectedRows = std::max( (sal_Int32)0, aLastPos.mnRow - aFirstPos.mnRow ) + 1;
+ const sal_Int32 nSelectedColumns = std::max( sal_Int32(0), aLastPos.mnCol - aFirstPos.mnCol ) + 1;
+ const sal_Int32 nSelectedRows = std::max( sal_Int32(0), aLastPos.mnRow - aFirstPos.mnRow ) + 1;
return nSelectedRows * nSelectedColumns;
}
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index fec8b197b43c..4cb9eae98fa0 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -998,7 +998,7 @@ Any Cell::GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertySimpleEnt
{
sal_Int32 nValue = 0;
aAny >>= nValue;
- aAny <<= (sal_Int16)nValue;
+ aAny <<= static_cast<sal_Int16>(nValue);
}
else
{
@@ -1433,7 +1433,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName )
case XATTR_FILLHATCH:
case XATTR_LINEDASH:
{
- const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>((sal_uInt16)pMap->nWID);
+ const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(static_cast<sal_uInt16>(pMap->nWID));
if( ( pItem == nullptr ) || pItem->GetName().isEmpty() )
eState = PropertyState_DEFAULT_VALUE;
}
@@ -1448,7 +1448,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName )
case XATTR_LINESTART:
case XATTR_FILLFLOATTRANSPARENCE:
{
- const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>((sal_uInt16)pMap->nWID);
+ const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>(static_cast<sal_uInt16>(pMap->nWID));
if( pItem == nullptr )
eState = PropertyState_DEFAULT_VALUE;
}
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 441b4a01fbbb..d8b3ec449414 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -535,7 +535,7 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int nEdge, sal_Int32 nOffset
if( (bRTL && (nEdge >= 0)) || (!bRTL && (nEdge < mxTable->getColumnCount())) )
{
nWidth = mpLayouter->getColumnWidth( nEdge );
- nWidth = std::max( (sal_Int32)(nWidth - nOffset), (sal_Int32)0 );
+ nWidth = std::max( static_cast<sal_Int32>(nWidth - nOffset), sal_Int32(0) );
Reference< XPropertySet > xColSet( xCols->getByIndex( nEdge ), UNO_QUERY_THROW );
xColSet->setPropertyValue( sSize, Any( nWidth ) );
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 37e267b2eea4..59dec64df181 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2446,7 +2446,7 @@ void SvxTableController::ApplyBorderAttr( const SfxItemSet& rAttr )
const sal_Int32 nLastRow = std::min( aEnd.mnRow + 2, nRowCount );
const sal_Int32 nLastCol = std::min( aEnd.mnCol + 2, nColCount );
- for( sal_Int32 nRow = std::max( aStart.mnRow - 1, (sal_Int32)0 ); nRow < nLastRow; nRow++ )
+ for( sal_Int32 nRow = std::max( aStart.mnRow - 1, sal_Int32(0) ); nRow < nLastRow; nRow++ )
{
CellPosFlag nRowFlags = CellPosFlag::NONE;
nRowFlags |= (nRow == aStart.mnRow) ? CellPosFlag::Top : CellPosFlag::NONE;
@@ -2454,7 +2454,7 @@ void SvxTableController::ApplyBorderAttr( const SfxItemSet& rAttr )
nRowFlags |= (nRow < aStart.mnRow) ? CellPosFlag::Upper : CellPosFlag::NONE;
nRowFlags |= (nRow > aEnd.mnRow) ? CellPosFlag::Lower : CellPosFlag::NONE;
- for( sal_Int32 nCol = std::max( aStart.mnCol - 1, (sal_Int32)0 ); nCol < nLastCol; nCol++ )
+ for( sal_Int32 nCol = std::max( aStart.mnCol - 1, sal_Int32(0) ); nCol < nLastCol; nCol++ )
{
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( !xCell.is() )
@@ -2921,10 +2921,10 @@ void lcl_MergeCommonBorderAttr(LinesState& rLinesState, const SvxBoxItem& rCellB
{
// current cell is inside the selection
- lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetTop(), SvxBoxItemLine::TOP, SvxBoxInfoItemValidFlags::TOP, (bool)(nCellPosFlags & CellPosFlag::Top));
- lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetBottom(), SvxBoxItemLine::BOTTOM, SvxBoxInfoItemValidFlags::BOTTOM, (bool)(nCellPosFlags & CellPosFlag::Bottom));
- lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetLeft(), SvxBoxItemLine::LEFT, SvxBoxInfoItemValidFlags::LEFT, (bool)(nCellPosFlags & CellPosFlag::Left));
- lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetRight(), SvxBoxItemLine::RIGHT, SvxBoxInfoItemValidFlags::RIGHT, (bool)(nCellPosFlags & CellPosFlag::Right));
+ lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetTop(), SvxBoxItemLine::TOP, SvxBoxInfoItemValidFlags::TOP, static_cast<bool>(nCellPosFlags & CellPosFlag::Top));
+ lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetBottom(), SvxBoxItemLine::BOTTOM, SvxBoxInfoItemValidFlags::BOTTOM, static_cast<bool>(nCellPosFlags & CellPosFlag::Bottom));
+ lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetLeft(), SvxBoxItemLine::LEFT, SvxBoxInfoItemValidFlags::LEFT, static_cast<bool>(nCellPosFlags & CellPosFlag::Left));
+ lcl_MergeBorderOrInnerLine(rLinesState, rCellBoxItem.GetRight(), SvxBoxItemLine::RIGHT, SvxBoxInfoItemValidFlags::RIGHT, static_cast<bool>(nCellPosFlags & CellPosFlag::Right));
lcl_MergeDistance(rLinesState, SvxBoxItemLine::TOP, rCellBoxItem.GetDistance(SvxBoxItemLine::TOP));
lcl_MergeDistance(rLinesState, SvxBoxItemLine::BOTTOM, rCellBoxItem.GetDistance(SvxBoxItemLine::BOTTOM));
@@ -2963,7 +2963,7 @@ void SvxTableController::FillCommonBorderAttrFromSelectedCells( SvxBoxItem& rBox
* it will be set to indeterminate state (SetValid() on
* rBoxInfoItem).
*/
- for( sal_Int32 nRow = std::max( aStart.mnRow - 1, (sal_Int32)0 ); nRow < nLastRow; nRow++ )
+ for( sal_Int32 nRow = std::max( aStart.mnRow - 1, sal_Int32(0) ); nRow < nLastRow; nRow++ )
{
CellPosFlag nRowFlags = CellPosFlag::NONE;
nRowFlags |= (nRow == aStart.mnRow) ? CellPosFlag::Top : CellPosFlag::NONE;
@@ -2971,7 +2971,7 @@ void SvxTableController::FillCommonBorderAttrFromSelectedCells( SvxBoxItem& rBox
nRowFlags |= (nRow < aStart.mnRow) ? CellPosFlag::Upper : CellPosFlag::NONE;
nRowFlags |= (nRow > aEnd.mnRow) ? CellPosFlag::Lower : CellPosFlag::NONE;
- for( sal_Int32 nCol = std::max( aStart.mnCol - 1, (sal_Int32)0 ); nCol < nLastCol; nCol++ )
+ for( sal_Int32 nCol = std::max( aStart.mnCol - 1, sal_Int32(0) ); nCol < nLastCol; nCol++ )
{
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( !xCell.is() )
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index d1de33c1b464..9a31f56288cc 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -79,10 +79,10 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellRef& xCell, const CellPo
CellPos aPos( rPos );
sal_Int32 nRowCount = getRowCount();
- sal_Int32 nRowSpan = std::max( xCell->getRowSpan(), (sal_Int32)1 );
+ sal_Int32 nRowSpan = std::max( xCell->getRowSpan(), sal_Int32(1) );
while( nRowSpan && (aPos.mnRow < nRowCount) )
{
- if( ((sal_Int32)maRows.size()) <= aPos.mnRow )
+ if( static_cast<sal_Int32>(maRows.size()) <= aPos.mnRow )
break;
height = o3tl::saturating_add(height, maRows[aPos.mnRow++].mnSize);
@@ -90,10 +90,10 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellRef& xCell, const CellPo
}
sal_Int32 nColCount = getColumnCount();
- sal_Int32 nColSpan = std::max( xCell->getColumnSpan(), (sal_Int32)1 );
+ sal_Int32 nColSpan = std::max( xCell->getColumnSpan(), sal_Int32(1) );
while( nColSpan && (aPos.mnCol < nColCount ) )
{
- if( ((sal_Int32)maColumns.size()) <= aPos.mnCol )
+ if( static_cast<sal_Int32>(maColumns.size()) <= aPos.mnCol )
break;
width = o3tl::saturating_add(width, maColumns[aPos.mnCol++].mnSize);
@@ -119,7 +119,7 @@ bool TableLayouter::getCellArea( const CellRef& xCell, const CellPos& rPos, base
const basegfx::B2ITuple aCellSize( getCellSize( xCell, rPos ) );
const bool bRTL = (mxTable->getSdrTableObj()->GetWritingMode() == WritingMode_RL_TB);
- if( (rPos.mnCol < ((sal_Int32)maColumns.size())) && (rPos.mnRow < ((sal_Int32)maRows.size()) ) )
+ if( (rPos.mnCol < static_cast<sal_Int32>(maColumns.size())) && (rPos.mnRow < static_cast<sal_Int32>(maRows.size()) ) )
{
const sal_Int32 y = maRows[rPos.mnRow].mnPos;
@@ -220,7 +220,7 @@ sal_Int32 TableLayouter::getHorizontalEdge( int nEdgeY, sal_Int32* pnMin /*= 0*/
sal_Int32 nRet = 0;
const sal_Int32 nRowCount = getRowCount();
if( (nEdgeY >= 0) && (nEdgeY <= nRowCount ) )
- nRet = maRows[std::min((sal_Int32)nEdgeY,nRowCount-1)].mnPos;
+ nRet = maRows[std::min(static_cast<sal_Int32>(nEdgeY),nRowCount-1)].mnPos;
if( nEdgeY == nRowCount )
nRet += maRows[nEdgeY - 1].mnSize;
@@ -251,7 +251,7 @@ sal_Int32 TableLayouter::getVerticalEdge( int nEdgeX, sal_Int32* pnMin /*= 0*/,
const sal_Int32 nColCount = getColumnCount();
if( (nEdgeX >= 0) && (nEdgeX <= nColCount ) )
- nRet = maColumns[std::min((sal_Int32)nEdgeX,nColCount-1)].mnPos;
+ nRet = maColumns[std::min(static_cast<sal_Int32>(nEdgeX),nColCount-1)].mnPos;
const bool bRTL = (mxTable->getSdrTableObj()->GetWritingMode() == WritingMode_RL_TB);
if( bRTL )
diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx
index 07c2e0395600..3860bf1759b2 100644
--- a/svx/source/table/tablertfimporter.cxx
+++ b/svx/source/table/tablertfimporter.cxx
@@ -298,12 +298,12 @@ void SdrTableRTFParser::FillTable()
xRows->insertByIndex( nRowCount, mnRowCnt - nRowCount );
}
- for( sal_Int32 nRow = 0; nRow < (sal_Int32)maRows.size(); nRow++ )
+ for( sal_Int32 nRow = 0; nRow < static_cast<sal_Int32>(maRows.size()); nRow++ )
{
RTFColumnVectorPtr xColumn( maRows[nRow] );
nCol = 0;
auto aEdge = maColumnEdges.begin();
- for( sal_Int32 nIdx = 0; nCol < nColMax && nIdx < (sal_Int32)xColumn->size(); nIdx++ )
+ for( sal_Int32 nIdx = 0; nCol < nColMax && nIdx < static_cast<sal_Int32>(xColumn->size()); nIdx++ )
{
RTFCellInfoPtr xCellInfo( (*xColumn)[nIdx] );
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 2f818e5ee7f2..7ca200fc0e6e 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -277,10 +277,10 @@ namespace sdr
{
// create cell transformation matrix
basegfx::B2DHomMatrix aCellMatrix;
- aCellMatrix.set(0, 0, (double)aCellArea.getWidth());
- aCellMatrix.set(1, 1, (double)aCellArea.getHeight());
- aCellMatrix.set(0, 2, (double)aCellArea.getMinX() + aObjectRange.getMinX());
- aCellMatrix.set(1, 2, (double)aCellArea.getMinY() + aObjectRange.getMinY());
+ aCellMatrix.set(0, 0, static_cast<double>(aCellArea.getWidth()));
+ aCellMatrix.set(1, 1, static_cast<double>(aCellArea.getHeight()));
+ aCellMatrix.set(0, 2, static_cast<double>(aCellArea.getMinX()) + aObjectRange.getMinX());
+ aCellMatrix.set(1, 2, static_cast<double>(aCellArea.getMinY()) + aObjectRange.getMinY());
// handle cell fillings and text
const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();