diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-06 18:31:44 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-06 18:31:44 +0200 |
commit | 93c0b1f5dafa1c9d01c804f350129dde047bb8dc (patch) | |
tree | 861bc6da163d72fedcf690c0029be980d4b76f06 | |
parent | ee3e23842e7bb0bfe23b6f070b0677dd3d70fd92 (diff) |
Improved loplugin:redundantcast, static_cast on arithmetic types: sc
Change-Id: Id56d3e3d7c4485e24dc8fe6349631837101e86fe
27 files changed, 43 insertions, 46 deletions
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index a4a93c24bee9..8ffcb047919c 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -245,9 +245,6 @@ public: #define ASSERT_DOUBLES_EQUAL_MESSAGE( message, expected, result ) \ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( (message), (expected), (result), 1e-14 ) -#define ASSERT_EQUAL_TYPE( type, expected, result ) \ - CPPUNIT_ASSERT_EQUAL( static_cast<type>(expected), static_cast<type>(result) ); - SCQAHELPER_DLLPUBLIC void checkFormula(ScDocument& rDoc, const ScAddress& rPos, const char* expected, const char* msg, CppUnit::SourceLine const & sourceLine); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index f9dd4bbb0e12..b27414722eae 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -2811,7 +2811,7 @@ void ScFiltersTest::testCondFormatParentXLSX() const ScPatternAttr* pPattern = rDoc.GetPattern(2, 5, 0); const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet); const SvxVerJustifyItem& rVerJustify = static_cast<const SvxVerJustifyItem&>(rPoolItem); - CPPUNIT_ASSERT_EQUAL(SVX_VER_JUSTIFY_TOP, static_cast<SvxCellVerJustify>(rVerJustify.GetValue())); + CPPUNIT_ASSERT_EQUAL(SVX_VER_JUSTIFY_TOP, rVerJustify.GetValue()); xDocSh->DoClose(); } diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 06fda94ff40b..4ee671a7122f 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -224,7 +224,7 @@ void ScTiledRenderingTest::testRowColumnSelections() aArgs[0].Name = OUString::fromUtf8("Row"); aArgs[0].Value <<= static_cast<sal_Int32>(10 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_SHIFT); + aArgs[1].Value <<= KEY_SHIFT; comphelper::dispatchCommand(".uno:SelectRow", aArgs); // Check if all the rows from 5th to 10th get selected @@ -236,7 +236,7 @@ void ScTiledRenderingTest::testRowColumnSelections() aArgs[0].Name = OUString::fromUtf8("Row"); aArgs[0].Value <<= static_cast<sal_Int32>(13 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_MOD1); + aArgs[1].Value <<= KEY_MOD1; comphelper::dispatchCommand(".uno:SelectRow", aArgs); // When we copy this, we don't get anything useful, but we must not crash @@ -250,7 +250,7 @@ void ScTiledRenderingTest::testRowColumnSelections() aArgs[0].Name = OUString::fromUtf8("Col"); aArgs[0].Value <<= static_cast<sal_Int32>(5 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_MOD1); + aArgs[1].Value <<= KEY_MOD1; comphelper::dispatchCommand(".uno:SelectColumn", aArgs); // When we copy this, we don't get anything useful, but we must not crash @@ -265,21 +265,21 @@ void ScTiledRenderingTest::testRowColumnSelections() aArgs[0].Name = OUString::fromUtf8("Row"); aArgs[0].Value <<= static_cast<sal_Int32>(13 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_MOD1); + aArgs[1].Value <<= KEY_MOD1; comphelper::dispatchCommand(".uno:SelectRow", aArgs); // Deselect row 10 aArgs[0].Name = OUString::fromUtf8("Row"); aArgs[0].Value <<= static_cast<sal_Int32>(10 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_MOD1); + aArgs[1].Value <<= KEY_MOD1; comphelper::dispatchCommand(".uno:SelectRow", aArgs); // Click at row 6 holding shift aArgs[0].Name = OUString::fromUtf8("Row"); aArgs[0].Value <<= static_cast<sal_Int32>(6 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_SHIFT); + aArgs[1].Value <<= KEY_SHIFT; comphelper::dispatchCommand(".uno:SelectRow", aArgs); // only row 5 should remain selected @@ -903,7 +903,7 @@ void ScTiledRenderingTest::testHideColRow() aArgs[0].Name = OUString::fromUtf8("Col"); aArgs[0].Value <<= static_cast<sal_Int32>(2 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_SHIFT); + aArgs[1].Value <<= KEY_SHIFT; comphelper::dispatchCommand(".uno:SelectColumn", aArgs); @@ -934,7 +934,7 @@ void ScTiledRenderingTest::testHideColRow() aArgs[0].Name = OUString::fromUtf8("Row"); aArgs[0].Value <<= static_cast<sal_Int32>(6 - 1); aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(KEY_SHIFT); + aArgs[1].Value <<= KEY_SHIFT; comphelper::dispatchCommand(".uno:SelectRow", aArgs); diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index a3ad3c082289..0c552491fcdc 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -979,17 +979,17 @@ void Test::testFormulaRefData() ScSingleRefData aRef; aRef.InitAddress(aAddr); CPPUNIT_ASSERT_MESSAGE("Wrong ref data state.", !aRef.IsRowRel() && !aRef.IsColRel() && !aRef.IsTabRel()); - ASSERT_EQUAL_TYPE(SCCOL, 4, aRef.Col()); - ASSERT_EQUAL_TYPE(SCROW, 5, aRef.Row()); - ASSERT_EQUAL_TYPE(SCTAB, 3, aRef.Tab()); + CPPUNIT_ASSERT_EQUAL(SCCOL(4), aRef.Col()); + CPPUNIT_ASSERT_EQUAL(SCROW(5), aRef.Row()); + CPPUNIT_ASSERT_EQUAL(SCTAB(3), aRef.Tab()); aRef.SetRowRel(true); aRef.SetColRel(true); aRef.SetTabRel(true); aRef.SetAddress(aAddr, aPos); - ASSERT_EQUAL_TYPE(SCCOL, 2, aRef.Col()); - ASSERT_EQUAL_TYPE(SCROW, 3, aRef.Row()); - ASSERT_EQUAL_TYPE(SCTAB, 1, aRef.Tab()); + CPPUNIT_ASSERT_EQUAL(SCCOL(2), aRef.Col()); + CPPUNIT_ASSERT_EQUAL(SCROW(3), aRef.Row()); + CPPUNIT_ASSERT_EQUAL(SCTAB(1), aRef.Tab()); // Test extension of range reference. diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 92df7a1c8f21..97cb5fe7ada7 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -1269,7 +1269,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) // combine if ( nThisCol == nThisEndCol || ValidCol(static_cast<SCCOL>(pOtherCols[nThisCol+1])) ) { - SCCOL nFirstNew = static_cast<SCCOL>(nThisCol); + SCCOL nFirstNew = nThisCol; while ( nFirstNew > 0 && pOtherCols[nFirstNew-1] > MAXCOL ) --nFirstNew; SCCOL nDiff = nThisCol - nFirstNew; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 6b1f12a1f4a5..8fee2dd71f45 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2220,7 +2220,7 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields, uno::Any aOrigAny = xDimProp->getPropertyValue(SC_UNO_DP_ORIGINAL_POS); sal_Int32 nTmp = 0; if (aOrigAny >>= nTmp) - nDupSource = static_cast<sal_Int32>(nTmp); + nDupSource = nTmp; } catch(uno::Exception&) { diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index d76f8a39abbe..b2da05afb10a 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -394,7 +394,7 @@ void ScFlatBoolRowSegments::insertSegment(SCROW nRow, SCROW nSize) SCROW ScFlatBoolRowSegments::findLastTrue() const { - return static_cast<SCROW>(mpImpl->findLastTrue(false)); + return mpImpl->findLastTrue(false); } ScFlatBoolColSegments::ScFlatBoolColSegments() : @@ -522,7 +522,7 @@ void ScFlatUInt16RowSegments::insertSegment(SCROW nRow, SCROW nSize) SCROW ScFlatUInt16RowSegments::findLastTrue(sal_uInt16 nValue) const { - return static_cast<SCROW>(mpImpl->findLastTrue(nValue)); + return mpImpl->findLastTrue(nValue); } void ScFlatUInt16RowSegments::enableTreeSearch(bool bEnable) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index db5b1bebbb40..bd9dd0385773 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1653,8 +1653,8 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, { if(!RowHidden(nAtRow)) { - aCol[nCol].SetPatternArea( static_cast<SCROW>(nAtRow), - static_cast<SCROW>(nAtRow), *pSrcPattern); + aCol[nCol].SetPatternArea( nAtRow, + nAtRow, *pSrcPattern); for(std::vector<sal_uInt32>::const_iterator itr = rCondFormatIndex.begin(), itrEnd = rCondFormatIndex.end(); itr != itrEnd; ++itr) { diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index 285062260d8a..e1d12a0098cf 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -39,7 +39,7 @@ XclImpColRowSettings::XclImpColRowSettings( const XclImpRoot& rRoot ) : maHiddenRows(0, MAXROWCOUNT, false), mnLastScRow( -1 ), mnDefWidth( STD_COL_WIDTH ), - mnDefHeight( static_cast< sal_uInt16 >( ScGlobal::nStdRowHeight ) ), + mnDefHeight( ScGlobal::nStdRowHeight ), mnDefRowFlags( EXC_DEFROW_DEFAULTFLAGS ), mbHasStdWidthRec( false ), mbHasDefHeight( false ), @@ -106,7 +106,7 @@ void XclImpColRowSettings::SetDefHeight( sal_uInt16 nDefHeight, sal_uInt16 nFlag mnDefRowFlags = nFlags; if( mnDefHeight == 0 ) { - mnDefHeight = static_cast< sal_uInt16 >( ScGlobal::nStdRowHeight ); + mnDefHeight = ScGlobal::nStdRowHeight; ::set_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN ); } mbHasDefHeight = true; diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index 469a576c4130..f8fbf68ce02f 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -1463,7 +1463,7 @@ void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData // relative column references wrap around nRelCol = static_cast<sal_Int16>(256 + (int)nRelCol); } - rSRD.SetRelCol(static_cast<SCCOL>(nRelCol)); + rSRD.SetRelCol(nRelCol); } else rSRD.SetAbsCol(static_cast<SCCOL>(nCol)); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 959b8b0e77a4..050f59ea4f93 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -241,7 +241,7 @@ void ImportExcel8::Boundsheet() OUString aName( aIn.ReadUniString( nLen ) ); GetTabInfo().AppendXclTabName( aName, nBdshtTab ); - SCTAB nScTab = static_cast< SCTAB >( nBdshtTab ); + SCTAB nScTab = nBdshtTab; if( nScTab > 0 ) { OSL_ENSURE( !pD->HasTable( nScTab ), "ImportExcel8::Boundsheet - sheet exists already" ); diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index ee9e04ac8bb2..47962db8ab0b 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -726,7 +726,7 @@ void ImportExcel::Boundsheet() OUString aName( aIn.ReadByteString( false ) ); - SCTAB nScTab = static_cast< SCTAB >( nBdshtTab ); + SCTAB nScTab = nBdshtTab; if( nScTab > 0 ) { OSL_ENSURE( !pD->HasTable( nScTab ), "ImportExcel::Boundsheet - sheet exists already" ); diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index bd9622c84d8d..53599bb3b2e1 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -165,7 +165,7 @@ void XclExpPCItem::WriteBody( XclExpStream& rStrm ) else if( const DateTime* pDateTime = GetDateTime() ) { sal_uInt16 nYear = static_cast< sal_uInt16 >( pDateTime->GetYear() ); - sal_uInt16 nMonth = static_cast< sal_uInt16 >( pDateTime->GetMonth() ); + sal_uInt16 nMonth = pDateTime->GetMonth(); sal_uInt8 nDay = static_cast< sal_uInt8 >( pDateTime->GetDay() ); sal_uInt8 nHour = static_cast< sal_uInt8 >( pDateTime->GetHour() ); sal_uInt8 nMin = static_cast< sal_uInt8 >( pDateTime->GetMin() ); diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index aeb46ac33e33..832698f3bd00 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -3221,7 +3221,7 @@ XclImpSimpleDffConverter::~XclImpSimpleDffConverter() bool XclImpSimpleDffConverter::GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const { - ColorData nColor = GetPalette().GetColorData( static_cast< sal_uInt16 >( nIndex ) ); + ColorData nColor = GetPalette().GetColorData( nIndex ); if( nColor == COL_AUTO ) return false; diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 576d809986d4..9c29a8ef505a 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -286,7 +286,7 @@ void XclImpFont::ReadCFFontBlock( XclImpStream& rStrm ) if( (mbHeightUsed = (nHeight <= 0x7FFF)) ) maData.mnHeight = static_cast< sal_uInt16 >( nHeight ); if( (mbWeightUsed = !::get_flag( nFontFlags1, EXC_CF_FONT_STYLE ) && (nWeight < 0x7FFF)) ) - maData.mnWeight = static_cast< sal_uInt16 >( nWeight ); + maData.mnWeight = nWeight; if( (mbItalicUsed = !::get_flag( nFontFlags1, EXC_CF_FONT_STYLE )) ) maData.mbItalic = ::get_flag( nStyle, EXC_CF_FONT_STYLE ); if( (mbUnderlUsed = !::get_flag( nFontFlags3, EXC_CF_FONT_UNDERL ) && (nUnderl <= 0x7F)) ) diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 02944b7096a6..d22c06163240 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -293,7 +293,7 @@ void DrawingFragment::onEndElement() SdrObject* pObj = SdrObject::getSdrObjectFromXShape( mxShape->getXShape() ); if ( pObj ) { - ScDrawLayer::SetCellAnchoredFromPosition( *pObj, getScDocument(), static_cast<SCTAB>( getSheetIndex() ) ); + ScDrawLayer::SetCellAnchoredFromPosition( *pObj, getScDocument(), getSheetIndex() ); } } } diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index 0be493426951..815007fe3cd0 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -321,7 +321,7 @@ void SAL_CALL ScXMLTableRowsContext::endFastElement(sal_Int32 /*nElement*/) ScOutlineTable* pOutlineTable(pDoc->GetOutlineTable(nSheet, true)); ScOutlineArray& rRowArray(pOutlineTable->GetRowArray()); bool bResized; - rRowArray.Insert(static_cast<SCROW>(nGroupStartRow), static_cast<SCROW>(nGroupEndRow), bResized, !bGroupDisplay); + rRowArray.Insert(nGroupStartRow, nGroupEndRow, bResized, !bGroupDisplay); } } } diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index d4b339a970db..16d4d3142bd7 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -816,7 +816,7 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() long nOffsetY = 0; const SvxVerJustifyItem* pVerJustifyItem = static_cast< const SvxVerJustifyItem* >( rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_VER_JUSTIFY ) ); - SvxCellVerJustify eVerJust = ( pVerJustifyItem ? static_cast< SvxCellVerJustify >( pVerJustifyItem->GetValue() ) : SVX_VER_JUSTIFY_STANDARD ); + SvxCellVerJustify eVerJust = ( pVerJustifyItem ? pVerJustifyItem->GetValue() : SVX_VER_JUSTIFY_STANDARD ); switch ( eVerJust ) { case SVX_VER_JUSTIFY_STANDARD: diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index d9490d97d503..1a13fe7fd3b2 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -554,7 +554,7 @@ void ScCsvGrid::FillColumnDataFix( ScAsciiOptions& rOptions ) const for( sal_uInt32 nColIx = 0; nColIx < nCount; ++nColIx ) { ScCsvExpData& rData = aDataVec[ nColIx ]; - rData.mnIndex = static_cast< sal_Int32 >( GetColumnPos( nColIx ) ); + rData.mnIndex = GetColumnPos( nColIx ); rData.mnType = lcl_GetExtColumnType( GetColumnType( nColIx ) ); } aDataVec[ nCount ].mnIndex = SAL_MAX_INT32; diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 74ba3f181dd5..7bf29db6c805 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -737,7 +737,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou lclFillListBox( *m_pLbHierarchy, maLabelData.maHiers ); sal_Int32 nHier = maLabelData.mnUsedHier; if( (nHier < 0) || (nHier >= maLabelData.maHiers.getLength()) ) nHier = 0; - m_pLbHierarchy->SelectEntryPos( static_cast< sal_Int32 >( nHier ) ); + m_pLbHierarchy->SelectEntryPos( nHier ); m_pLbHierarchy->SetSelectHdl( LINK( this, ScDPSubtotalOptDlg, SelectHdl ) ); } else diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 2b7f7a50cd9c..ebf8ac90867f 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -595,7 +595,7 @@ void ScImportAsciiDlg::SaveParameters() pCkbQuotedAsText->IsChecked(), pCkbDetectNumber->IsChecked(), pRbFixed->IsChecked(), static_cast<sal_Int32>(pNfRow->GetValue()), - static_cast<sal_Int32>(pLbCharSet->GetSelectEntryPos()), + pLbCharSet->GetSelectEntryPos(), static_cast<sal_Int32>(pLbCustomLang->GetSelectLanguage()), meCall ); } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 6f7b15ae5e9a..5e986635b820 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -932,7 +932,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if ( aDlg->Execute() == RET_OK ) { bool bSetShared = aDlg->IsShareDocumentChecked(); - if ( bSetShared != static_cast< bool >( IsDocShared() ) ) + if ( bSetShared != IsDocShared() ) { if ( bSetShared ) { diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index b4f19bbf4889..71e8a86b8865 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -251,7 +251,7 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales continue; sal_uInt32 nOldFormat; - rDoc.GetNumberFormat(static_cast<SCCOL>(i), 0, 0, nOldFormat); + rDoc.GetNumberFormat(i, 0, 0, nOldFormat); const SvNumberformat* pOldEntry = pFormatter->GetEntry(nOldFormat); if (!pOldEntry) continue; @@ -280,7 +280,7 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales ScPatternAttr aNewAttrs( rDoc.GetPool() ); SfxItemSet& rSet = aNewAttrs.GetItemSet(); rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat) ); - rDoc.ApplyPatternAreaTab(static_cast<SCCOL>(i), 0, static_cast<SCCOL>(i), MAXROW, 0, aNewAttrs); + rDoc.ApplyPatternAreaTab(i, 0, i, MAXROW, 0, aNewAttrs); } } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 8c302a68974f..2a21fd58107a 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2794,7 +2794,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint } } - OSL_ENSURE(m_pRangeIndices->size() == static_cast<size_t>(aRanges.size()), + OSL_ENSURE(m_pRangeIndices->size() == aRanges.size(), "range list and range index list have different sizes."); unique_ptr<ScRangeList> pUndoRanges; diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 30e9fdb3828b..6f5baf5ff3d6 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -273,7 +273,7 @@ ScVbaWorksheet::createSheetCopy(uno::Reference<excel::XWorksheet> const & xSheet ScDocShell* pDestDocShell = excel::getDocShell( pDestSheet->getModel() ); ScDocShell* pSrcDocShell = excel::getDocShell( getModel() ); if ( pDestDocShell && pSrcDocShell ) - pDestDocShell->TransferTab( *pSrcDocShell, static_cast<SCTAB>(nSrc), static_cast<SCTAB>(nDest), true, true ); + pDestDocShell->TransferTab( *pSrcDocShell, nSrc, nDest, true, true ); } } // return new sheet diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx index 51ff1a6abcb6..3b565efeaa3a 100644 --- a/sc/source/ui/view/cellsh4.cxx +++ b/sc/source/ui/view/cellsh4.cxx @@ -375,7 +375,7 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq ) pReqArgs->HasItem( FN_PARAM_2, &pModifierItem ) ) { SCCOL nCol = static_cast<SCCOL>(static_cast<const SfxInt32Item*>(pColItem)->GetValue()); - sal_Int16 nModifier = static_cast<sal_Int16>(static_cast<const SfxInt16Item*>(pModifierItem)->GetValue()); + sal_Int16 nModifier = static_cast<const SfxInt16Item*>(pModifierItem)->GetValue(); pTabViewShell->MarkColumns( nCol, nModifier ); } @@ -392,7 +392,7 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq ) pReqArgs->HasItem( FN_PARAM_2, &pModifierItem ) ) { SCROW nRow = static_cast<SCROW>(static_cast<const SfxInt32Item*>(pRowItem)->GetValue()); - sal_Int16 nModifier = static_cast<sal_Int16>(static_cast<const SfxInt16Item*>(pModifierItem)->GetValue()); + sal_Int16 nModifier = static_cast<const SfxInt16Item*>(pModifierItem)->GetValue(); pTabViewShell->MarkRows( nRow, nModifier ); } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index a84cc588401d..19e441eade83 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2698,7 +2698,7 @@ void ScViewFunc::MoveTable( nDestTab1 = nDestTab; for(SCTAB nTab : TheTabs) { - nErrVal = pDestShell->TransferTab( *pDocShell, nTab, static_cast<SCTAB>(nDestTab1), false, false ); + nErrVal = pDestShell->TransferTab( *pDocShell, nTab, nDestTab1, false, false ); nDestTab1++; } } |