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 /sc/qa | |
parent | ee3e23842e7bb0bfe23b6f070b0677dd3d70fd92 (diff) |
Improved loplugin:redundantcast, static_cast on arithmetic types: sc
Change-Id: Id56d3e3d7c4485e24dc8fe6349631837101e86fe
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/helper/qahelper.hxx | 3 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 16 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 12 |
4 files changed, 15 insertions, 18 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. |