diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-02 09:36:49 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-02 09:36:49 +0200 |
commit | c72d788410c13321c7079b2f185a26baea735b59 (patch) | |
tree | 56dfdf66d764f8420daa56ea6ca0d3387aa9179a | |
parent | b38b619681465459e0330b9a3417fffcc4e15a17 (diff) |
Improved loplugin:redundantcast static_cast handling: sc
Change-Id: I11f0deb6913a7a3adc6bc31890451e05bfa00802
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 12 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 22 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_condformat.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpformula.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh5.cxx | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 8bbad1cb6e60..63b1279cd266 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1274,7 +1274,7 @@ void checkCellValidity( const ScAddress& rValBaseAddr, const ScRange& rRange, co { SCCOL nBCol( rValBaseAddr.Col() ); SCROW nBRow( rValBaseAddr.Row() ); - SCTAB nTab( static_cast<const sal_Int32>(rValBaseAddr.Tab()) ); + SCTAB nTab( static_cast<sal_Int32>(rValBaseAddr.Tab()) ); //get from the document the data validation entry we are checking against const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(rDoc.GetAttr(nBCol, nBRow, nTab, ATTR_VALIDDATA) ); const ScValidationData* pValData = rDoc.GetValidationEntry( pItem->GetValue() ); @@ -1290,12 +1290,12 @@ void checkCellValidity( const ScAddress& rValBaseAddr, const ScRange& rRange, co //prevent string operations for occurring unnecessarily if(!(pValDataTest && pValData->GetKey() == pValDataTest->GetKey())) { - sal_Int32 nCol = static_cast<const sal_Int32>(i); - sal_Int32 nRow = static_cast<const sal_Int32>(j); - sal_Int32 nTab32 = static_cast<const sal_Int32>(nTab); + sal_Int32 nCol = static_cast<sal_Int32>(i); + sal_Int32 nRow = static_cast<sal_Int32>(j); + sal_Int32 nTab32 = static_cast<sal_Int32>(nTab); OStringBuffer sMsg("\nData validation entry base-cell-address: ("); - sMsg.append( static_cast<const sal_Int32>(nBCol) ).append(","); - sMsg.append( static_cast<const sal_Int32>(nBRow) ).append(","); + sMsg.append( static_cast<sal_Int32>(nBCol) ).append(","); + sMsg.append( static_cast<sal_Int32>(nBRow) ).append(","); sMsg.append( nTab32 ).append(")\n"); sMsg.append("Cell: (").append(nCol).append(",").append(nRow).append(",").append(nTab32).append(")"); sal_uInt32 expectedKey(pValData->GetKey()); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 94d04e2f433f..1948add201cd 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2708,7 +2708,7 @@ void Test::testGraphicsInGroup() pPage->InsertObject(pObj); const tools::Rectangle &rNewRect = pObj->GetLogicRect(); CPPUNIT_ASSERT_EQUAL_MESSAGE("must have equal position and size", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetPageAnchored(*pObj); @@ -2716,15 +2716,15 @@ void Test::testGraphicsInGroup() m_pDoc->ShowRows(0, 100, 0, false); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when page anchored", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); m_pDoc->ShowRows(0, 100, 0, true); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when page anchored", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); CPPUNIT_ASSERT_EQUAL_MESSAGE("That shouldn't change size or positioning", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); m_pDoc->ShowRows(0, 100, 0, false); m_pDoc->SetDrawPageSize(0); @@ -2735,7 +2735,7 @@ void Test::testGraphicsInGroup() m_pDoc->ShowRows(0, 100, 0, true); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when page anchored", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); } { @@ -2745,11 +2745,11 @@ void Test::testGraphicsInGroup() pPage->InsertObject(pObj); const tools::Rectangle& rNewRect = pObj->GetLogicRect(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Position and size of the circle shouldn't change when inserted into the page.", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size changed when cell anchored. Not good.", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); // Insert 2 rows at the top. This should push the circle object down. m_pDoc->InsertRow(0, 0, MAXCOL, 0, 0, 2); @@ -2763,7 +2763,7 @@ void Test::testGraphicsInGroup() m_pDoc->DeleteRow(0, 0, MAXCOL, 0, 0, 2); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to move back to its original position.", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); } { @@ -2778,18 +2778,18 @@ void Test::testGraphicsInGroup() pPage->InsertObject(pObj); const tools::Rectangle& rNewRect = pObj->GetLogicRect(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size differ.", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size changed when cell-anchored. Not good.", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); // Insert 2 rows at the top and delete them immediately. m_pDoc->InsertRow(0, 0, MAXCOL, 0, 0, 2); m_pDoc->DeleteRow(0, 0, MAXCOL, 0, 0, 2); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size of a line object changed after row insertion and removal.", - static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); sal_Int32 n = pObj->GetPointCount(); CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly 2 points in a line object.", static_cast<sal_Int32>(2), n); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index d436b2b0aff8..d4a85cd6cd8a 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -134,7 +134,7 @@ void Test::testCondFormatInsertCol() m_pDoc->InsertCol(0,0,MAXROW,0,4,2); const ScRangeList& rRange = pFormat->GetRange(); - CPPUNIT_ASSERT_EQUAL(static_cast<const ScRangeList&>(ScRangeList(ScRange(0,0,0,5,3,0))), rRange); + CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(0,0,0,5,3,0)), rRange); m_pDoc->DeleteTab(0); } diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 376a22681259..ffa726a7c27a 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -253,9 +253,9 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet) if ( mpLbFormulaSyntax->GetSavedValue() != aSyntaxPos || mpCbEnglishFuncName->GetSavedValue() != (bEnglishFuncName ? 1 : 0) - || static_cast<OUString>(mpEdSepFuncArg->GetSavedValue()) != aSep - || static_cast<OUString>(mpEdSepArrayCol->GetSavedValue()) != aSepArrayCol - || static_cast<OUString>(mpEdSepArrayRow->GetSavedValue()) != aSepArrayRow + || mpEdSepFuncArg->GetSavedValue() != aSep + || mpEdSepArrayCol->GetSavedValue() != aSepArrayCol + || mpEdSepArrayRow->GetSavedValue() != aSepArrayRow || mpLbOOXMLRecalcOptions->GetSavedValue() != nOOXMLRecalcMode || mpLbODFRecalcOptions->GetSavedValue() != nODFRecalcMode || maSavedConfig != maCurrentConfig diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx index bee5f1501dd7..a75efc3e9f71 100644 --- a/sc/source/ui/view/tabvwsh5.cxx +++ b/sc/source/ui/view/tabvwsh5.cxx @@ -377,7 +377,7 @@ SvxNumberInfoItem* ScTabViewShell::MakeNumberInfoItem( ScDocument* pDoc, ScViewD } return new SvxNumberInfoItem( - pDoc->GetFormatTable(), static_cast<const sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)); + pDoc->GetFormatTable(), static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)); } void ScTabViewShell::UpdateNumberFormatter( |