summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-23 09:47:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-23 09:48:10 +0000
commited76d1d3504c92bff6bb3e6417e4440572fcd959 (patch)
tree6d06b4a20bef5acf0c1a4118685f09acdd27fbb7 /sc/source
parenta61c4ae9cef23a53ea88f957e090bd5ee9b28ca6 (diff)
loplugins:redundantcast teach it about c-style typedef casts
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c Reviewed-on: https://gerrit.libreoffice.org/35558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/attarray.cxx16
-rw-r--r--sc/source/core/data/column3.cxx2
-rw-r--r--sc/source/core/data/poolhelp.cxx2
-rw-r--r--sc/source/core/data/table2.cxx4
-rw-r--r--sc/source/core/tool/appoptio.cxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx2
-rw-r--r--sc/source/filter/html/htmlexp.cxx4
-rw-r--r--sc/source/filter/starcalc/scflt.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleCellBase.cxx2
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx4
-rw-r--r--sc/source/ui/dbgui/validate.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx3
-rw-r--r--sc/source/ui/optdlg/tpview.cxx3
-rw-r--r--sc/source/ui/unoobj/appluno.cxx2
-rw-r--r--sc/source/ui/view/select.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx2
18 files changed, 29 insertions, 31 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index d6ea28a409b9..a55f8dcfd260 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1264,7 +1264,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf
SCROW nTmpEnd;
for (SCSIZE i=nStartIndex; i<=nEndIndex;)
{
- nTmpEnd = std::min( (SCROW)(nEndRow-1), (SCROW)(pData[i].nRow) );
+ nTmpEnd = std::min( (SCROW)(nEndRow-1), pData[i].nRow );
bool bChanged = ApplyFrame( pLineOuter, pLineInner, nTmpStart, nTmpEnd,
bLeft, nDistRight, false, nEndRow-nTmpEnd );
nTmpStart = nTmpEnd+1;
@@ -1587,7 +1587,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow,
{
if (nThisRow < nStartRow) nThisRow = nStartRow;
nRow = pData[nIndex].nRow;
- SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow );
+ SCROW nAttrRow = std::min( nRow, nEndRow );
pItem = static_cast<const ScMergeFlagAttr*>( &pOldPattern->GetItem( ATTR_MERGE_FLAG ) );
if (pItem->IsOverlapped() || pItem->HasAutoFilter())
@@ -1644,7 +1644,7 @@ bool ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags )
if ( (nOldValue | nFlags) != nOldValue )
{
nRow = pData[nIndex].nRow;
- SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow );
+ SCROW nAttrRow = std::min( nRow, nEndRow );
ScPatternAttr aNewPattern(*pOldPattern);
aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue | nFlags ) );
SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
@@ -1681,7 +1681,7 @@ bool ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, ScMF nFlags )
if ( (nOldValue & ~nFlags) != nOldValue )
{
nRow = pData[nIndex].nRow;
- SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow );
+ SCROW nAttrRow = std::min( nRow, nEndRow );
ScPatternAttr aNewPattern(*pOldPattern);
aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue & ~nFlags ) );
SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
@@ -1716,7 +1716,7 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16*
aNewPattern.ClearItems( pWhich );
nRow = pData[nIndex].nRow;
- SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow );
+ SCROW nAttrRow = std::min( nRow, nEndRow );
SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true );
Search( nThisRow, nIndex ); // data changed
}
@@ -2378,7 +2378,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow)
if ( pOldPattern->GetItemSet().Count() ) // hard attributes ?
{
nRow = pData[nIndex].nRow;
- SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow );
+ SCROW nAttrRow = std::min( nRow, nEndRow );
ScPatternAttr aNewPattern(*pOldPattern);
SfxItemSet& rSet = aNewPattern.GetItemSet();
@@ -2411,10 +2411,10 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray
if ((pData[i].nRow >= nStartRow) && (i == 0 || pData[i-1].nRow < nEndRow))
{
// copy (bPutToPool=TRUE)
- rAttrArray.SetPatternArea( nStart, std::min( (SCROW)pData[i].nRow, (SCROW)nEndRow ),
+ rAttrArray.SetPatternArea( nStart, std::min( pData[i].nRow, nEndRow ),
pData[i].pPattern, true );
}
- nStart = std::max( (SCROW)nStart, (SCROW)(pData[i].nRow + 1) );
+ nStart = std::max( nStart, pData[i].nRow + 1 );
}
DeleteArea(nStartRow, nEndRow);
}
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index a143f88bd0b4..e378dd0384b8 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1780,7 +1780,7 @@ bool ScColumn::ParseString(
if ( bOverwrite )
{
ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT,
- (sal_uInt32) nIndex) );
+ nIndex) );
bNumFmtSet = true;
}
}
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index 32b0bd2cb462..0ad8c56acf19 100644
--- a/sc/source/core/data/poolhelp.cxx
+++ b/sc/source/core/data/poolhelp.cxx
@@ -84,7 +84,7 @@ void ScPoolHelper::SetFormTableOpt(const ScDocOptions& rOpt)
sal_Int16 y;
aOpt.GetDate( d,m,y );
pFormTable->ChangeNullDate( d,m,y );
- pFormTable->ChangeStandardPrec( (sal_uInt16)aOpt.GetStdPrecision() );
+ pFormTable->ChangeStandardPrec( aOpt.GetStdPrecision() );
pFormTable->SetYear2000( aOpt.GetYear2000() );
}
}
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 7d7ed84dad15..25f81d0d4cac 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3026,7 +3026,7 @@ sal_uInt16 ScTable::GetRowHeight( SCROW nRow, SCROW* pStartRow, SCROW* pEndRow,
*pStartRow = nRow;
if (pEndRow)
*pEndRow = nRow;
- return (sal_uInt16) ScGlobal::nStdRowHeight;
+ return ScGlobal::nStdRowHeight;
}
}
@@ -3102,7 +3102,7 @@ sal_uInt16 ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if
if (ValidRow(nRow) && mpRowHeights)
return mpRowHeights->getValue(nRow);
else
- return (sal_uInt16) ScGlobal::nStdRowHeight;
+ return ScGlobal::nStdRowHeight;
}
// Column/Row -Flags
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index 8b06ea8bbf63..1f726f5c1828 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -672,10 +672,10 @@ IMPL_LINK_NOARG(ScAppCfg, MiscCommitHdl, ScLinkConfigItem&, void)
switch(nProp)
{
case SCMISCOPT_DEFOBJWIDTH:
- pValues[nProp] <<= (sal_Int32) GetDefaultObjectSizeWidth();
+ pValues[nProp] <<= GetDefaultObjectSizeWidth();
break;
case SCMISCOPT_DEFOBJHEIGHT:
- pValues[nProp] <<= (sal_Int32) GetDefaultObjectSizeHeight();
+ pValues[nProp] <<= GetDefaultObjectSizeHeight();
break;
case SCMISCOPT_SHOWSHAREDDOCWARN:
pValues[nProp] <<= GetShowSharedDocumentWarning();
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index fc5e8384c9b6..f8d682a9c1c5 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8077,7 +8077,7 @@ bool SAL_CALL lcl_getScriptClass(sal_uInt32 currentChar)
return true;
sal_uInt16 i;
static bool bRet = false;
- UBlockCode block = ublock_getCode((sal_uInt32)currentChar);
+ UBlockCode block = ublock_getCode(currentChar);
for ( i = 0; i < scriptListCount; i++) {
if (block <= scriptList[i].to) break;
}
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 500efa900c36..6372fee39669 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -362,7 +362,7 @@ void ScHTMLExport::WriteHeader()
{ // Fontlist, VCL: Semicolon as separator
// CSS1: Comma as separator and every single font name quoted
const OUString& rList = aHTMLStyle.aFontFamilyName;
- for ( sal_Int32 j = 0, nPos = 0; j < (sal_Int32) nFonts; j++ )
+ for ( sal_Int32 j = 0, nPos = 0; j < nFonts; j++ )
{
rStrm.WriteChar( '\"' );
OUT_STR( rList.getToken( 0, ';', nPos ) );
@@ -1116,7 +1116,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
else
{ // Font list, VCL: Semicolon as separator, HTML: Comma
const OUString& rList = rFontItem.GetFamilyName();
- for ( sal_Int32 j = 0, nPos = 0; j < (sal_Int32)nFonts; j++ )
+ for ( sal_Int32 j = 0, nPos = 0; j < nFonts; j++ )
{
OString aTmpStr = HTMLOutFuncs::ConvertStringToHTML(
rList.getToken( 0, ';', nPos ), eDestEnc,
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 44529b1e58b7..0f7f337bedbf 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -1353,7 +1353,7 @@ void Sc10Import::LoadDataBaseCollection()
{
Sc10DataBaseData* pOldData = pDataBaseCollection->At(i);
ScDBData* pNewData = new ScDBData( SC10TOSTRING( pOldData->DataBaseRec.Name ),
- ( SCTAB ) pOldData->DataBaseRec.Tab,
+ pOldData->DataBaseRec.Tab,
( SCCOL ) pOldData->DataBaseRec.Block.x1,
( SCROW ) pOldData->DataBaseRec.Block.y1,
( SCCOL ) pOldData->DataBaseRec.Block.x2,
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 6a7ca5c2cc4a..db77e64f573f 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1417,7 +1417,7 @@ void ExcEScenario::SaveCont( XclExpStream& rStrm )
{
sal_uInt16 count = aCells.size();
- rStrm << (sal_uInt16) count // number of cells
+ rStrm << count // number of cells
<< sal_uInt8(bProtected) // fProtection
<< (sal_uInt8) 0 // fHidden
<< (sal_uInt8) sName.Len() // length of scen name
diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
index acece6d3de55..ef31889dbb29 100644
--- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -411,7 +411,7 @@ OUString SAL_CALL ScAccessibleCellBase::getShadowAttrs()
}
//else return all the shadow properties
sShadowAttrs += "Location=";
- sShadowAttrs += OUString::number( (sal_Int32)nLocationVal );
+ sShadowAttrs += OUString::number( nLocationVal );
sShadowAttrs += sInnerSplit;
sShadowAttrs += "ShadowWidth=";
sShadowAttrs += OUString::number( (sal_Int32)aShadowFmt.ShadowWidth ) ;
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 33db5aa95bd0..38ec2fbdf6c8 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -184,7 +184,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aStr = pFieldSepTab->GetDelimiter( nCode );
if ( aStr.isEmpty() )
- m_pEdFieldSep->SetText( OUString((sal_Unicode)nCode) );
+ m_pEdFieldSep->SetText( OUString(nCode) );
else
m_pEdFieldSep->SetText( aStr );
@@ -192,7 +192,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aStr = pTextSepTab->GetDelimiter( nCode );
if ( aStr.isEmpty() )
- m_pEdTextSep->SetText( OUString((sal_Unicode)nCode) );
+ m_pEdTextSep->SetText( OUString(nCode) );
else
m_pEdTextSep->SetText( aStr );
}
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index e7ac7891b1bb..b2f690c73a70 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -272,7 +272,7 @@ void lclGetFormulaFromStringList( OUString& rFmlaStr, const OUString& rStringLis
{
rFmlaStr.clear();
sal_Int32 nTokenCnt = comphelper::string::getTokenCount(rStringList, '\n');
- for( sal_Int32 nToken = 0, nStringIx = 0; nToken < (sal_Int32) nTokenCnt; ++nToken )
+ for( sal_Int32 nToken = 0, nStringIx = 0; nToken < nTokenCnt; ++nToken )
{
OUString aToken( rStringList.getToken( 0, '\n', nStringIx ) );
ScGlobal::AddQuotes( aToken, '"' );
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 6e7d2b63d47c..9f7942a86081 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -124,7 +124,7 @@ namespace
::std::vector< rtl_TextEncoding > aEncodings;
svxform::charset_helper::getSupportedTextEncodings( aEncodings );
- ::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(),(rtl_TextEncoding) eCharSet);
+ ::std::vector< rtl_TextEncoding >::iterator aIter = ::std::find(aEncodings.begin(),aEncodings.end(), eCharSet);
if ( aIter == aEncodings.end() )
{
OSL_FAIL( "DBaseImport: dbtools::OCharsetMap doesn't know text encoding" );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 3887ac22669b..ce6f08f1329b 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -1081,8 +1081,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
// Zeilenabstand
- sal_uInt16 nLineSpace = (sal_uInt16)
- static_cast<const SvxLineSpacingItem&>(aAttrSet.
+ sal_uInt16 nLineSpace = static_cast<const SvxLineSpacingItem&>(aAttrSet.
Get( EE_PARA_SBL )).GetPropLineSpace();
switch( nLineSpace )
{
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 84b6535f61e0..986f9d2dd06d 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -427,8 +427,7 @@ bool ScTpLayoutOptions::FillItemSet( SfxItemSet* rCoreSet )
if ( m_pUnitLB->IsValueChangedFromSaved() )
{
sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( nMPos ));
- rCoreSet->Put( SfxUInt16Item( SID_ATTR_METRIC,
- (sal_uInt16)nFieldUnit ) );
+ rCoreSet->Put( SfxUInt16Item( SID_ATTR_METRIC, nFieldUnit ) );
bRet = true;
}
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index fcf724a9f486..4904d755e110 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -418,7 +418,7 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp
// added to avoid warnings
}
}
- aRet <<= (sal_Int16) nZoomVal;
+ aRet <<= nZoomVal;
}
else if (aPropertyName == SC_UNONAME_ULISTS )
{
diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index b4c99e6831ca..014bd6371450 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -679,7 +679,7 @@ bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, bool bScrol
SCROW nOldY = pViewData->GetCurY();
pView->InitBlockMode( nOldX, nOldY, nTab, true );
- pView->MarkCursor( (SCCOL) nOldX, (SCROW) nOldY, nTab );
+ pView->MarkCursor( nOldX, nOldY, nTab );
if ( nOldX != nPosX || nOldY != nPosY )
{
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 9b03379f4cc2..abbd807a1ade 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -169,7 +169,7 @@ void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, bool bControl )
{
DoneBlockMode( bControl );
aViewData.ResetOldCursor();
- SetCursor( (SCCOL) nPosX, (SCROW) nPosY );
+ SetCursor( nPosX, nPosY );
}
}