summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-22 13:49:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-22 16:35:20 +0200
commitc18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch)
treea63721b18626947e5278a51feb7fd64604e80eee /sc/qa/unit
parent7cf4bcef41448218f76fa1e974f541e13dc03023 (diff)
New loplugin:data
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx10
-rw-r--r--sc/qa/unit/ucalc.cxx8
-rw-r--r--sc/qa/unit/ucalc_sharedformula.cxx2
3 files changed, 10 insertions, 10 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 1879924d705a..ef7346967397 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -1484,7 +1484,7 @@ void ScExportTest::testRichTextExportODS()
return false;
// Check the first bold section.
- const editeng::Section* pAttr = &aSecAttrs[0];
+ const editeng::Section* pAttr = aSecAttrs.data();
if (pAttr->mnParagraph != 0 ||pAttr->mnStart != 0 || pAttr->mnEnd != 4)
return false;
@@ -1576,7 +1576,7 @@ void ScExportTest::testRichTextExportODS()
return false;
// Check the first strike-out section.
- const editeng::Section* pAttr = &aSecAttrs[0];
+ const editeng::Section* pAttr = aSecAttrs.data();
if (pAttr->mnParagraph != 0 ||pAttr->mnStart != 0 || pAttr->mnEnd != 6)
return false;
@@ -1605,7 +1605,7 @@ void ScExportTest::testRichTextExportODS()
return false;
// First section should have "Courier" font applied.
- const editeng::Section* pAttr = &aSecAttrs[0];
+ const editeng::Section* pAttr = aSecAttrs.data();
if (pAttr->mnParagraph != 0 ||pAttr->mnStart != 0 || pAttr->mnEnd != 5)
return false;
@@ -1640,7 +1640,7 @@ void ScExportTest::testRichTextExportODS()
return false;
// First section shoul have overline applied.
- const editeng::Section* pAttr = &aSecAttrs[0];
+ const editeng::Section* pAttr = aSecAttrs.data();
if (pAttr->mnParagraph != 0 ||pAttr->mnStart != 0 || pAttr->mnEnd != 4)
return false;
@@ -1675,7 +1675,7 @@ void ScExportTest::testRichTextExportODS()
return false;
// superscript
- const editeng::Section* pAttr = &aSecAttrs[0];
+ const editeng::Section* pAttr = aSecAttrs.data();
if (pAttr->mnParagraph != 0 ||pAttr->mnStart != 0 || pAttr->mnEnd != 3)
return false;
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a445d2df2eb7..06881c84b5bb 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4227,7 +4227,7 @@ void Test::testCopyPasteRepeatOneFormula()
CPPUNIT_ASSERT(pBASM);
std::vector<sc::AreaListener> aListeners = pBASM->GetAllListeners(aWholeSheet, sc::AreaInside);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aListeners.size());
- const sc::AreaListener* pListener = &aListeners[0];
+ const sc::AreaListener* pListener = aListeners.data();
CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,1,0,0), pListener->maArea);
CPPUNIT_ASSERT_MESSAGE("This listener shouldn't be a group listener.", !pListener->mbGroupListening);
#endif
@@ -4260,7 +4260,7 @@ void Test::testCopyPasteRepeatOneFormula()
// a group listener listening on A1:B10.
aListeners = pBASM->GetAllListeners(aWholeSheet, sc::AreaInside);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aListeners.size());
- pListener = &aListeners[0];
+ pListener = aListeners.data();
CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,1,9,0), pListener->maArea);
CPPUNIT_ASSERT_MESSAGE("This listener should be a group listener.", pListener->mbGroupListening);
#endif
@@ -4278,7 +4278,7 @@ void Test::testCopyPasteRepeatOneFormula()
// Make there we only have one group area listener listening on A2:B11.
aListeners = pBASM->GetAllListeners(aWholeSheet, sc::AreaInside);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aListeners.size());
- pListener = &aListeners[0];
+ pListener = aListeners.data();
CPPUNIT_ASSERT_EQUAL(ScRange(0,1,0,1,10,0), pListener->maArea);
CPPUNIT_ASSERT_MESSAGE("This listener should be a group listener.", pListener->mbGroupListening);
#endif
@@ -4305,7 +4305,7 @@ void Test::testCopyPasteRepeatOneFormula()
// Check the group area listener again to make sure it's listening on A1:B10 once again.
aListeners = pBASM->GetAllListeners(aWholeSheet, sc::AreaInside);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aListeners.size());
- pListener = &aListeners[0];
+ pListener = aListeners.data();
CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,1,9,0), pListener->maArea);
CPPUNIT_ASSERT_MESSAGE("This listener should be a group listener.", pListener->mbGroupListening);
#endif
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index c478e4c0b3f4..ea22e3651d4d 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -1406,7 +1406,7 @@ void Test::testSharedFormulaMoveBlock()
aRows.push_back(0);
aRows.push_back(1);
aRows.push_back(2);
- bool bRes = checkFormulaPositions(*m_pDoc, 0, 1, &aRows[0], aRows.size());
+ bool bRes = checkFormulaPositions(*m_pDoc, 0, 1, aRows.data(), aRows.size());
CPPUNIT_ASSERT(bRes);
SfxUndoManager* pUndoMgr = m_pDoc->GetUndoManager();