[Libreoffice-commits] core.git: sc/qa sc/source
Stephan Bergmann
sbergman at redhat.com
Fri Jun 29 19:57:29 UTC 2018
sc/qa/unit/ucalc.cxx | 4 ++--
sc/qa/unit/ucalc_formula.cxx | 10 +++++-----
sc/source/ui/dbgui/csvgrid.cxx | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 671538c601f6171fd27432528620a6ff1f5d2d4d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 29 15:54:20 2018 +0200
Improved loplugin:redundantcast (const-qualified typedefs): sc
Change-Id: I2bba240b444811ff0b29149b4b731a1fa01d6270
Reviewed-on: https://gerrit.libreoffice.org/56700
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 6fb52101ed0c..6db74263c27b 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5001,7 +5001,7 @@ void Test::testFindAreaPosVertical()
m_pDoc->FindAreaPos(nCol, nRow, 0, SC_MOVE_DOWN);
- CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), nRow);
+ CPPUNIT_ASSERT_EQUAL(MAXROW, nRow);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), nCol);
nCol = 1;
@@ -5068,7 +5068,7 @@ void Test::testFindAreaPosColRight()
m_pDoc->FindAreaPos(nCol, nRow, 0, SC_MOVE_RIGHT);
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(0), nRow);
- CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(MAXCOL), nCol);
+ CPPUNIT_ASSERT_EQUAL(MAXCOL, nCol);
nCol = 2;
nRow = 1;
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 5900e3555ada..a3b0125c9beb 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -373,7 +373,7 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(0), aRange.aStart.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aEnd.Col());
- CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), aRange.aEnd.Row());
+ CPPUNIT_ASSERT_EQUAL(MAXROW, aRange.aEnd.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID),
static_cast<sal_uInt16>(nRes & (ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
@@ -390,7 +390,7 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), aRange.aStart.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab());
- CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(MAXCOL), aRange.aEnd.Col());
+ CPPUNIT_ASSERT_EQUAL(MAXCOL, aRange.aEnd.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), aRange.aEnd.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID),
@@ -408,7 +408,7 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(0), aRange.aStart.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(4), aRange.aEnd.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(2), aRange.aEnd.Col());
- CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), aRange.aEnd.Row());
+ CPPUNIT_ASSERT_EQUAL(MAXROW, aRange.aEnd.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID),
static_cast<sal_uInt16>(nRes & (ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
@@ -427,7 +427,7 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(0), aRange.aStart.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aEnd.Col());
- CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(MAXROW), aRange.aEnd.Row());
+ CPPUNIT_ASSERT_EQUAL(MAXROW, aRange.aEnd.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID),
static_cast<sal_uInt16>(nRes & (ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
@@ -445,7 +445,7 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), aRange.aStart.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aEnd.Tab());
- CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(MAXCOL), aRange.aEnd.Col());
+ CPPUNIT_ASSERT_EQUAL(MAXCOL, aRange.aEnd.Col());
CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), aRange.aEnd.Row());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID |
ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID),
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 3852ca0f0728..32ac2515f7de 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -813,7 +813,7 @@ void ScCsvGrid::ImplSetTextLineFix( sal_Int32 nLine, const OUString& rTextLine )
for( sal_uInt32 nColIx = 0; (nColIx < nColCount) && (nStrIx < nStrLen); ++nColIx )
{
sal_Int32 nColWidth = GetColumnWidth( nColIx );
- sal_Int32 nLen = std::min( std::min( nColWidth, static_cast<sal_Int32>(CSV_MAXSTRLEN) ), nStrLen - nStrIx);
+ sal_Int32 nLen = std::min( std::min( nColWidth, CSV_MAXSTRLEN ), nStrLen - nStrIx);
rStrVec.push_back( rTextLine.copy( nStrIx, nLen ) );
nStrIx = nStrIx + nColWidth;
}
More information about the Libreoffice-commits
mailing list