summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-15 20:52:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-17 21:36:25 +0200
commita242a8bb064f38b5ce4ca8c71aca5d50cc77df0b (patch)
treea2ed811fe13be733c68664b1f9b3792754d2b53e /sc/qa
parent0df22a9e42f4b1a3d6febe309be0debaba1006df (diff)
ScRange::Parse never passed a null ScDocument*
Change-Id: I2c504f051f77c89f7e2e6d54990d030351824121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102956 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/extras/anchor.cxx12
-rw-r--r--sc/qa/unit/copy_paste_test.cxx6
-rw-r--r--sc/qa/unit/helper/qahelper.cxx2
-rw-r--r--sc/qa/unit/range.cxx2
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx2
-rw-r--r--sc/qa/unit/ucalc_formula.cxx30
6 files changed, 27 insertions, 27 deletions
diff --git a/sc/qa/extras/anchor.cxx b/sc/qa/extras/anchor.cxx
index 8801e9690b3d..7fdb6a33d23d 100644
--- a/sc/qa/extras/anchor.cxx
+++ b/sc/qa/extras/anchor.cxx
@@ -267,13 +267,13 @@ void ScAnchorTest::testCopyColumnWithImages()
{
// 1. Copy source range
ScRange aSrcRange;
- aSrcRange.Parse("A1:A11", pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse("A1:A11", *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, true, false);
// 2. Paste to target range
ScRange aDstRange;
- aDstRange.Parse("D1:D11", pDoc, pDoc->GetAddressConvention());
+ aDstRange.Parse("D1:D11", *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
@@ -290,13 +290,13 @@ void ScAnchorTest::testCopyColumnWithImages()
{
// 1. Copy source cells
ScRange aSrcRange;
- aSrcRange.Parse("A3:B3", pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse("A3:B3", *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CopyToClip(&aClipDoc, false, false, true, false);
// 2. Paste to target cells
ScRange aDstRange;
- aDstRange.Parse("G3:H3", pDoc, pDoc->GetAddressConvention());
+ aDstRange.Parse("G3:H3", *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
@@ -337,7 +337,7 @@ void ScAnchorTest::testCutWithImages()
{
// Cut source range
ScRange aSrcRange;
- aSrcRange.Parse("A1:A11", pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse("A1:A11", *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CutToClip();
@@ -355,7 +355,7 @@ void ScAnchorTest::testCutWithImages()
{
// Cut source cells
ScRange aSrcRange;
- aSrcRange.Parse("A3:B3", pDoc, pDoc->GetAddressConvention());
+ aSrcRange.Parse("A3:B3", *pDoc, pDoc->GetAddressConvention());
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetView()->CutToClip();
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index a15dee9aad62..70971c1d804a 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -90,7 +90,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
// 2. Highlight B2:C5
ScRange aSrcRange;
- ScRefFlags nRes = aSrcRange.Parse("B2:C5", &rDoc, rDoc.GetAddressConvention());
+ ScRefFlags nRes = aSrcRange.Parse("B2:C5", rDoc, rDoc.GetAddressConvention());
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
ScMarkData aMark(rDoc.GetSheetLimits());
@@ -150,7 +150,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, ScDocument&
// 1. Copy
ScRange aSrcRange;
- ScRefFlags nRes = aSrcRange.Parse(rSrcRange, &rDoc, rDoc.GetAddressConvention());
+ ScRefFlags nRes = aSrcRange.Parse(rSrcRange, rDoc, rDoc.GetAddressConvention());
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aSrcRange));
@@ -158,7 +158,7 @@ void lcl_copy( const OUString& rSrcRange, const OUString& rDstRange, ScDocument&
// 2. Paste
ScRange aDstRange;
- nRes = aDstRange.Parse(rDstRange, &rDoc, rDoc.GetAddressConvention());
+ nRes = aDstRange.Parse(rDstRange, rDoc, rDoc.GetAddressConvention());
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
pViewShell->GetViewData().GetMarkData().SetMarkArea(aDstRange);
pViewShell->GetViewData().GetMarkData().SetSelectedTabs(TabsInRange(aDstRange));
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 560d4c51fd21..b0a6084d9db9 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -396,7 +396,7 @@ ScRangeList getChartRanges(ScDocument& rDoc, const SdrOle2Obj& rChartObj)
for (size_t i = 0, n = aRangeReps.size(); i < n; ++i)
{
ScRange aRange;
- ScRefFlags nRes = aRange.Parse(aRangeReps[i], &rDoc, rDoc.GetAddressConvention());
+ ScRefFlags nRes = aRange.Parse(aRangeReps[i], rDoc, rDoc.GetAddressConvention());
if (nRes & ScRefFlags::VALID)
// This is a range address.
aRanges.push_back(aRange);
diff --git a/sc/qa/unit/range.cxx b/sc/qa/unit/range.cxx
index 7ca6e631caf0..f20def220318 100644
--- a/sc/qa/unit/range.cxx
+++ b/sc/qa/unit/range.cxx
@@ -82,7 +82,7 @@ void ScRangeTest::testRangeParsing()
{
ScRange aRange;
ScDocument& rDoc = m_xDocShRef->GetDocument();
- ScRefFlags nRes = aRange.Parse(":1", &rDoc, formula::FormulaGrammar::CONV_OOO);
+ ScRefFlags nRes = aRange.Parse(":1", rDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
}
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 42118a15fc4c..e2033cadebc6 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -4326,7 +4326,7 @@ void ScFiltersTest::testEmptyRowsXLSXML()
};
ScRange aDataRange;
- aDataRange.Parse("A1:B9", &rDoc);
+ aDataRange.Parse("A1:B9", rDoc);
bool bSuccess = checkOutput(&rDoc, aDataRange, aOutputCheck, "Expected output");
CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
}
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index b82f1271fb12..00bffef9de29 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -317,47 +317,47 @@ void Test::testFormulaParseReference()
ScRange aRange;
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":B", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(":B", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B:", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("B:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":B2", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(":B2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B2:", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("B2:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":2", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(":2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("2:", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("2:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse(":2B", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse(":2B", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("2B:", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("2B:", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("abc_foo:abc_bar", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("abc_foo:abc_bar", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B1:B2~C1", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("B1:B2~C1", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Should fail to parse.", !(nRes & ScRefFlags::VALID));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B:B", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("B:B", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col());
@@ -375,7 +375,7 @@ void Test::testFormulaParseReference()
static_cast<sal_uInt16>(nRes & (ScRefFlags::ROW_ABS | ScRefFlags::ROW2_ABS)));
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("2:2", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("2:2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col());
@@ -392,7 +392,7 @@ void Test::testFormulaParseReference()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS),
static_cast<sal_uInt16>(nRes & (ScRefFlags::COL_ABS | ScRefFlags::COL2_ABS)));
- nRes = aRange.Parse("NoQuote.B:C", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("NoQuote.B:C", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(4), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col());
@@ -411,7 +411,7 @@ void Test::testFormulaParseReference()
// Both rows at sheet bounds and relative => convert to absolute => entire column reference.
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("B1:B1048576", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("B1:B1048576", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(1), aRange.aStart.Col());
@@ -430,7 +430,7 @@ void Test::testFormulaParseReference()
// Both columns at sheet bounds and relative => convert to absolute => entire row reference.
aRange.aStart.SetTab(0);
- nRes = aRange.Parse("A2:AMJ2", m_pDoc, formula::FormulaGrammar::CONV_OOO);
+ nRes = aRange.Parse("A2:AMJ2", *m_pDoc, formula::FormulaGrammar::CONV_OOO);
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(0), aRange.aStart.Tab());
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOL>(0), aRange.aStart.Col());