diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-04 08:53:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-04 10:52:41 +0200 |
commit | 7aa7f4d9e4294959748bccf9e763154740251635 (patch) | |
tree | 79fc3855ce0cc1141abdda514df374cd42ab259c /sc | |
parent | 6f511a5de909b2fb6cb42b851e0cc90f54fbdd59 (diff) |
loplugin:unnecessaryparen include c++ casts
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb
Reviewed-on: https://gerrit.libreoffice.org/41874
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/queryparam.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/bcaslot.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen5.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 14 | ||||
-rw-r--r-- | sc/source/core/data/olinetab.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table4.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xerecord.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/formulaparser.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/conflictsdlg.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/afmtuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 4 |
14 files changed, 24 insertions, 24 deletions
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx index 3b406bb49bc5..0c704789e004 100644 --- a/sc/inc/queryparam.hxx +++ b/sc/inc/queryparam.hxx @@ -150,8 +150,8 @@ template<typename charT, typename traits> inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ScQueryParam& rParam) { stream << "{" << - "base=" << *(static_cast<const ScQueryParamBase*>(&rParam)) << - ",table=" << *(static_cast<const ScQueryParamTable*>(&rParam)) << + "base=" << *static_cast<const ScQueryParamBase*>(&rParam) << + ",table=" << *static_cast<const ScQueryParamTable*>(&rParam) << ",destPers=" << (rParam.bDestPers?"YES":"NO") << ",destTab=" << rParam.nDestTab << ",destCol=" << rParam.nDestCol << diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 0882619f66f3..bdcee982a5c1 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -686,7 +686,7 @@ inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset( { const ScSlotData& rSD = i; return rSD.nCumulated + - (static_cast<SCSIZE>(nRow - rSD.nStartRow)) / rSD.nSlice + + static_cast<SCSIZE>(nRow - rSD.nStartRow) / rSD.nSlice + static_cast<SCSIZE>(nCol) / BCA_SLOT_COLS * nBcaSlotsRow; } } diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 2424684fb210..5a673f36ab72 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -200,7 +200,7 @@ bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, OUString& rName if (IsChart(pObject)) { - rName = (static_cast<SdrOle2Obj*>(pObject))->GetPersistName(); + rName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName(); return true; } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 9079c92d67f6..572374180f33 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1406,7 +1406,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, ScAddress( nEndCol, nStartRow+nSize-1, nTabRangeEnd ) ) ); UpdateBroadcastAreas( URM_INSDEL, ScRange( ScAddress( nStartCol, nStartRow+nSize, nTabRangeStart ), - ScAddress( nEndCol, MAXROW, nTabRangeEnd )), 0, -(static_cast<SCROW>(nSize)), 0 ); + ScAddress( nEndCol, MAXROW, nTabRangeEnd )), 0, -static_cast<SCROW>(nSize), 0 ); } else DelBroadcastAreasInRange( ScRange( @@ -1421,7 +1421,7 @@ void ScDocument::DeleteRow( SCCOL nStartCol, SCTAB nStartTab, { lcl_GetFirstTabRange( nTabRangeStart, nTabRangeEnd, pTabMark, static_cast<SCTAB>(maTabs.size()) ); aCxt.meMode = URM_INSDEL; - aCxt.mnRowDelta = -(static_cast<SCROW>(nSize)); + aCxt.mnRowDelta = -static_cast<SCROW>(nSize); if (bLastRowIncluded) { // Last row is included, shift a virtually non-existent row in. @@ -1630,7 +1630,7 @@ void ScDocument::DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTA { lcl_GetFirstTabRange( nTabRangeStart, nTabRangeEnd, pTabMark, static_cast<SCTAB>(maTabs.size()) ); aCxt.meMode = URM_INSDEL; - aCxt.mnColDelta = -(static_cast<SCCOL>(nSize)); + aCxt.mnColDelta = -static_cast<SCCOL>(nSize); if (bLastColIncluded) { // Last column is included, shift a virtually non-existent column in. @@ -2619,7 +2619,7 @@ void ScDocument::CopyBlockFromClip( { if (maTabs[i] && rMark.GetTableSelect(i) ) { - while (!rClipTabs[nClipTab]) nClipTab = (nClipTab+1) % (static_cast<SCTAB>(rClipTabs.size())); + while (!rClipTabs[nClipTab]) nClipTab = (nClipTab+1) % static_cast<SCTAB>(rClipTabs.size()); maTabs[i]->CopyFromClip( rCxt, nCol1, nRow1, nCol2, nRow2, nDx, nDy, rClipTabs[nClipTab]); @@ -2645,7 +2645,7 @@ void ScDocument::CopyBlockFromClip( } } - nClipTab = (nClipTab+1) % (static_cast<SCTAB>(rClipTabs.size())); + nClipTab = (nClipTab+1) % static_cast<SCTAB>(rClipTabs.size()); } } if (rCxt.getInsertFlag() & InsertDeleteFlags::CONTENTS) @@ -2655,7 +2655,7 @@ void ScDocument::CopyBlockFromClip( { if (maTabs[i] && rMark.GetTableSelect(i) ) { - while (!rClipTabs[nClipTab]) nClipTab = (nClipTab+1) % (static_cast<SCTAB>(rClipTabs.size())); + while (!rClipTabs[nClipTab]) nClipTab = (nClipTab+1) % static_cast<SCTAB>(rClipTabs.size()); SCTAB nDz = i - nClipTab; // ranges of consecutive selected tables (in clipboard and dest. doc) @@ -2703,7 +2703,7 @@ void ScDocument::CopyBlockFromClip( UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); } - nClipTab = (nClipTab+nFollow+1) % (static_cast<SCTAB>(rClipTabs.size())); + nClipTab = (nClipTab+nFollow+1) % static_cast<SCTAB>(rClipTabs.size()); i = sal::static_int_cast<SCTAB>( i + nFollow ); } } diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index 808969dcf9c5..97e616837ae8 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -702,7 +702,7 @@ bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize) if ( nEntryEnd >= nStartPos ) { if ( nEntryStart > nEndPos ) // Right - pEntry->Move(-(static_cast<SCCOLROW>(nSize))); + pEntry->Move(-static_cast<SCCOLROW>(nSize)); else if ( nEntryStart < nStartPos && nEntryEnd >= nEndPos ) // Outside pEntry->SetSize( nEntrySize-nSize ); else diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 39baf35e20f2..9f1fcc7ef81b 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -215,7 +215,7 @@ double approxDiff( double a, double b ) // the exponent of the error magnitude and round accordingly. const double e = fabs(d - c); const double fExp = floor( log10( e)); - return rtl::math::round( c, -(static_cast<int>(fExp))-1); + return rtl::math::round( c, -static_cast<int>(fExp)-1); } } diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx index 4d724d77d150..3807ae94258d 100644 --- a/sc/source/filter/excel/xerecord.cxx +++ b/sc/source/filter/excel/xerecord.cxx @@ -165,7 +165,7 @@ void XclExpValueRecord<double>::SaveXml( XclExpXmlStream& rStrm ) void XclExpBoolRecord::WriteBody( XclExpStream& rStrm ) { - rStrm << (static_cast< sal_uInt16 >( mbValue ? 1 : 0 )); + rStrm << static_cast< sal_uInt16 >( mbValue ? 1 : 0 ); } void XclExpBoolRecord::SaveXml( XclExpXmlStream& rStrm ) diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index f304cdda2dad..aab7e0927fbd 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -1581,7 +1581,7 @@ bool OoxFormulaParserImpl::importArrayToken( SequenceInputStream& rStrm ) appendRawToken( OPCODE_PUSH ) <<= BiffHelper::readString( rStrm, false ); break; case BIFF_TOK_ARRAY_BOOL: - appendRawToken( OPCODE_PUSH ) <<= (static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 )); + appendRawToken( OPCODE_PUSH ) <<= static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 ); break; case BIFF_TOK_ARRAY_ERROR: appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( rStrm.readuInt8() ); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index c6fd2f0ea317..1eea60ecd5d4 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1441,7 +1441,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) if ( pSet && SfxItemState::SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) ) { - OUString aFilterOption = (static_cast<const SfxStringItem*>(pItem))->GetValue(); + OUString aFilterOption = static_cast<const SfxStringItem*>(pItem)->GetValue(); lcl_parseHtmlFilterOption(aFilterOption, eLang, bDateConvert); } diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 2c40bf2fdeae..f5b9720b5d5e 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -581,7 +581,7 @@ IMPL_LINK_NOARG(ScConflictsDlg, UpdateSelectionHdl, Timer *, void) if ( pAction && ( pAction->GetType() != SC_CAT_DELETE_TABS ) && ( pAction->IsClickable() || pAction->IsVisible() ) ) { - const ScBigRange& rBigRange = ( static_cast< const ScChangeAction* >( pAction ) )->GetBigRange(); + const ScBigRange& rBigRange = static_cast< const ScChangeAction* >( pAction )->GetBigRange(); if ( rBigRange.IsValid( mpOwnDoc ) ) { bool bSetCursor = !m_pLbConflicts->NextSelected( pEntry ); @@ -687,7 +687,7 @@ void ScConflictsDlg::UpdateView() // only display shared top content entries if ( pAction->GetType() == SC_CAT_CONTENT ) { - ScChangeActionContent* pNextContent = (dynamic_cast<ScChangeActionContent&>(*pAction)).GetNextContent(); + ScChangeActionContent* pNextContent = dynamic_cast<ScChangeActionContent&>(*pAction).GetNextContent(); if ( pNextContent && aItr->HasSharedAction( pNextContent->GetActionNumber() ) ) { continue; @@ -708,7 +708,7 @@ void ScConflictsDlg::UpdateView() // only display own top content entries if ( pAction->GetType() == SC_CAT_CONTENT ) { - ScChangeActionContent* pNextContent = ( dynamic_cast<ScChangeActionContent&>(*pAction) ).GetNextContent(); + ScChangeActionContent* pNextContent = dynamic_cast<ScChangeActionContent&>(*pAction).GetNextContent(); if ( pNextContent && aItr->HasOwnAction( pNextContent->GetActionNumber() ) ) { continue; diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 7bccbd5931d7..a3df348c16a0 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -174,7 +174,7 @@ OUString ScContentTree::getAltLongDescText( SvTreeListEntry* pEntry, bool isAltT case ScContentId::DRAWING: { SdrObject* pFound = nullptr; - ScDocument* pDoc = ( const_cast< ScContentTree* >(this) )->GetSourceDocument(); + ScDocument* pDoc = const_cast< ScContentTree* >(this)->GetSourceDocument(); SdrIterMode eIter = ( nType == ScContentId::DRAWING ) ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups; ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); SfxObjectShell* pShell = pDoc->GetDocumentShell(); diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index 01c78e5484fd..2d492bc6809d 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -756,7 +756,7 @@ uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const OUString& aPrope const SfxPoolItem* pItem = pData->GetItem(nFieldIndex, ATTR_BORDER); if (pItem) { - SvxBoxItem aOuter(*(static_cast<const SvxBoxItem*>(pItem))); + SvxBoxItem aOuter(*static_cast<const SvxBoxItem*>(pItem)); SvxBoxInfoItem aInner(ATTR_BORDER_INNER); if (pEntry->nWID == SC_WID_UNO_TBLBORD2) diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 972617d352ab..3cf1ec0a7861 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1437,7 +1437,7 @@ ScChart2DataProvider::createDataSource( { sal_Int32 nSource(0); if( aArguments[i].Value >>= nSource ) - eSource = (static_cast< chart::ChartDataRowSource >( nSource )); + eSource = static_cast< chart::ChartDataRowSource >( nSource ); } bOrientCol = (eSource == chart::ChartDataRowSource_COLUMNS); } diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 96b90f69ac24..e23568887f47 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1307,7 +1307,7 @@ uno::Any ScStyleObj::getPropertyDefault_Impl( const OUString& aPropertyName ) const SfxPoolItem* pItem = &pItemSet->Get( ATTR_BORDER ); if ( pItem ) { - SvxBoxItem aOuter( *( static_cast<const SvxBoxItem*>( pItem ) ) ); + SvxBoxItem aOuter( * static_cast<const SvxBoxItem*>( pItem ) ); SvxBoxInfoItem aInner( ATTR_BORDER_INNER ); if (nWhich == SC_WID_UNO_TBLBORD2) ScHelperFunctions::AssignTableBorder2ToAny( aAny, aOuter, aInner, true); @@ -1899,7 +1899,7 @@ uno::Any ScStyleObj::getPropertyValue_Impl( const OUString& aPropertyName ) const SfxPoolItem* pItem = &pItemSet->Get( ATTR_BORDER ); if ( pItem ) { - SvxBoxItem aOuter( *( static_cast<const SvxBoxItem*>( pItem ) ) ); + SvxBoxItem aOuter( * static_cast<const SvxBoxItem*>( pItem ) ); SvxBoxInfoItem aInner( ATTR_BORDER_INNER ); if (nWhich == SC_WID_UNO_TBLBORD2) ScHelperFunctions::AssignTableBorder2ToAny( aAny, aOuter, aInner, true); |