summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-15 15:36:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-17 09:41:42 +0200
commitcded40e436340163fd537946749019b68800be4d (patch)
tree51b4cf263f621c3c06d2d882e55f54bf54dd3141 /sc/source
parentfd5470a12a33683a69cc580b6f6e297fbec45245 (diff)
compileRangeRepresentation never called with null ScDocument*
Change-Id: I910731ecc1b7a36b9532841c7cc9c9288110bfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102880 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/reftokenhelper.cxx12
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx14
3 files changed, 14 insertions, 14 deletions
diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx
index bddb458f5004..a1ae5510e2d3 100644
--- a/sc/source/core/tool/reftokenhelper.cxx
+++ b/sc/source/core/tool/reftokenhelper.cxx
@@ -34,7 +34,7 @@ using namespace formula;
using ::std::vector;
void ScRefTokenHelper::compileRangeRepresentation(
- vector<ScTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument* pDoc,
+ vector<ScTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument& rDoc,
const sal_Unicode cSep, FormulaGrammar::Grammar eGrammar, bool bOnly3DRef)
{
// #i107275# ignore parentheses
@@ -51,7 +51,7 @@ void ScRefTokenHelper::compileRangeRepresentation(
if (nOffset < 0)
break;
- ScCompiler aCompiler(pDoc, ScAddress(0,0,0), eGrammar);
+ ScCompiler aCompiler(&rDoc, ScAddress(0,0,0), eGrammar);
std::unique_ptr<ScTokenArray> pArray(aCompiler.CompileString(aToken));
// There MUST be exactly one reference per range token and nothing
@@ -77,7 +77,7 @@ void ScRefTokenHelper::compileRangeRepresentation(
case svSingleRef:
{
const ScSingleRefData& rRef = *p->GetSingleRef();
- if (!rRef.Valid(pDoc))
+ if (!rRef.Valid(&rDoc))
bFailure = true;
else if (bOnly3DRef && !rRef.IsFlag3D())
bFailure = true;
@@ -86,7 +86,7 @@ void ScRefTokenHelper::compileRangeRepresentation(
case svDoubleRef:
{
const ScComplexRefData& rRef = *p->GetDoubleRef();
- if (!rRef.Valid(pDoc))
+ if (!rRef.Valid(&rDoc))
bFailure = true;
else if (bOnly3DRef && !rRef.Ref1.IsFlag3D())
bFailure = true;
@@ -94,13 +94,13 @@ void ScRefTokenHelper::compileRangeRepresentation(
break;
case svExternalSingleRef:
{
- if (!p->GetSingleRef()->ValidExternal(pDoc))
+ if (!p->GetSingleRef()->ValidExternal(&rDoc))
bFailure = true;
}
break;
case svExternalDoubleRef:
{
- if (!p->GetDoubleRef()->ValidExternal(pDoc))
+ if (!p->GetDoubleRef()->ValidExternal(&rDoc))
bFailure = true;
}
break;
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index bac71f2ab82d..84bc25588cdd 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -84,7 +84,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
unique_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>);
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- *pRefTokens, aRangeStr, pDoc, cSep, pDoc->GetGrammar());
+ *pRefTokens, aRangeStr, *pDoc, cSep, pDoc->GetGrammar());
if (pRefTokens->empty())
return;
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 8b13cbc19304..75593140747d 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1001,7 +1001,7 @@ sal_Bool SAL_CALL ScChart2DataProvider::createDataSourcePossible( const uno::Seq
vector<ScTokenRef> aTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aTokens, aRangeRepresentation, *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
return !aTokens.empty();
}
@@ -1432,7 +1432,7 @@ ScChart2DataProvider::createDataSource(
vector<ScTokenRef> aRefTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aRefTokens, aRangeRepresentation, *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
if (aRefTokens.empty())
// Invalid range representation. Bail out.
throw lang::IllegalArgumentException();
@@ -1774,7 +1774,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
vector<ScTokenRef> aTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aTokens, xLabel->getSourceRangeRepresentation(), m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aTokens, xLabel->getSourceRangeRepresentation(), *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
aLabel.initRangeAnalyzer(aTokens);
for (const auto& rxToken : aTokens)
{
@@ -1792,7 +1792,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
vector<ScTokenRef> aTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aTokens, xValues->getSourceRangeRepresentation(), m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aTokens, xValues->getSourceRangeRepresentation(), *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
aValues.initRangeAnalyzer(aTokens);
for (const auto& rxToken : aTokens)
{
@@ -1976,7 +1976,7 @@ sal_Bool SAL_CALL ScChart2DataProvider::createDataSequenceByRangeRepresentationP
vector<ScTokenRef> aTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aTokens, aRangeRepresentation, *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
return !aTokens.empty();
}
@@ -1994,7 +1994,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
vector<ScTokenRef> aRefTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aRefTokens, aRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aRefTokens, aRangeRepresentation, *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
if (aRefTokens.empty())
return xResult;
@@ -2164,7 +2164,7 @@ OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const OUString& sRang
vector<ScTokenRef> aRefTokens;
const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
ScRefTokenHelper::compileRangeRepresentation(
- aRefTokens, sRangeRepresentation, m_pDocument, cSep, m_pDocument->GetGrammar(), true);
+ aRefTokens, sRangeRepresentation, *m_pDocument, cSep, m_pDocument->GetGrammar(), true);
if (aRefTokens.empty())
throw lang::IllegalArgumentException();