summaryrefslogtreecommitdiff
path: root/sc/source
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/source
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/source')
-rw-r--r--sc/source/core/tool/address.cxx12
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/rangenam.cxx4
-rw-r--r--sc/source/core/tool/rangeutl.cxx2
-rw-r--r--sc/source/filter/excel/xename.cxx4
-rw-r--r--sc/source/filter/oox/revisionfragment.cxx2
-rw-r--r--sc/source/filter/orcus/interface.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx14
-rw-r--r--sc/source/ui/app/inputhdl.cxx2
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx2
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx6
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx2
-rw-r--r--sc/source/ui/docshell/servobj.cxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx2
-rw-r--r--sc/source/ui/miscdlgs/datastreamdlg.cxx2
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx22
20 files changed, 45 insertions, 45 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 4596074e102a..39e950aa0418 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1524,7 +1524,7 @@ bool ConvertDoubleRef( const ScDocument& rDoc, const OUString& rRefString, SCTAB
if (pExtInfo || (ScGlobal::FindUnquoted( rRefString, SC_COMPILER_FILE_TAB_SEP) == -1))
{
ScRange aRange( ScAddress( 0, 0, nDefTab));
- ScRefFlags nRes = aRange.Parse( rRefString, &rDoc, rDetails, pExtInfo);
+ ScRefFlags nRes = aRange.Parse( rRefString, rDoc, rDetails, pExtInfo);
if ( nRes & ScRefFlags::VALID )
{
rStartRefAddress.Set( aRange.aStart,
@@ -1735,7 +1735,7 @@ static ScRefFlags lcl_ScRange_Parse_OOo( ScRange& rRange,
return nRes1;
}
-ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument* pDoc,
+ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument& rDoc,
const ScAddress::Details& rDetails,
ScAddress::ExternalInfo* pExtInfo,
const uno::Sequence<sheet::ExternalLinkInfo>* pExternalLinks,
@@ -1749,20 +1749,20 @@ ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument* pDoc,
case formula::FormulaGrammar::CONV_XL_A1:
case formula::FormulaGrammar::CONV_XL_OOX:
{
- return lcl_ScRange_Parse_XL_A1( *this, rString.getStr(), pDoc, false, pExtInfo,
+ return lcl_ScRange_Parse_XL_A1( *this, rString.getStr(), &rDoc, false, pExtInfo,
(rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : nullptr),
nullptr, pErrRef );
}
case formula::FormulaGrammar::CONV_XL_R1C1:
{
- return lcl_ScRange_Parse_XL_R1C1( *this, rString.getStr(), pDoc, rDetails, false, pExtInfo, nullptr );
+ return lcl_ScRange_Parse_XL_R1C1( *this, rString.getStr(), &rDoc, rDetails, false, pExtInfo, nullptr );
}
default:
case formula::FormulaGrammar::CONV_OOO:
{
- return lcl_ScRange_Parse_OOo( *this, rString, pDoc, pExtInfo, pErrRef );
+ return lcl_ScRange_Parse_OOo( *this, rString, &rDoc, pExtInfo, pErrRef );
}
}
}
@@ -1771,7 +1771,7 @@ ScRefFlags ScRange::Parse( const OUString& rString, const ScDocument* pDoc,
ScRefFlags ScRange::ParseAny( const OUString& rString, const ScDocument& rDoc,
const ScAddress::Details& rDetails )
{
- ScRefFlags nRet = Parse( rString, &rDoc, rDetails );
+ ScRefFlags nRet = Parse( rString, rDoc, rDetails );
const ScRefFlags nValid = ScRefFlags::VALID | ScRefFlags::COL2_VALID | ScRefFlags::ROW2_VALID | ScRefFlags::TAB2_VALID;
if ( (nRet & nValid) != nValid )
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 134f89d68612..d9ceab95ea8f 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3190,7 +3190,7 @@ bool ScCompiler::IsDoubleReference( const OUString& rName, const OUString* pErrR
ScRange aRange( aPos, aPos );
const ScAddress::Details aDetails( pConv->meConv, aPos );
ScAddress::ExternalInfo aExtInfo;
- ScRefFlags nFlags = aRange.Parse( rName, &rDoc, aDetails, &aExtInfo, &maExternalLinks, pErrRef );
+ ScRefFlags nFlags = aRange.Parse( rName, rDoc, aDetails, &aExtInfo, &maExternalLinks, pErrRef );
if( nFlags & ScRefFlags::VALID )
{
ScComplexRefData aRef;
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index 5f84aa08742f..5fa5cf59c3db 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -451,7 +451,7 @@ void ScRangeData::MakeValidName( const ScDocument& rDoc, OUString& rName )
ScAddress::Details details( static_cast<FormulaGrammar::AddressConvention>( nConv ) );
// Don't check Parse on VALID, any partial only VALID may result in
// #REF! during compile later!
- while (aRange.Parse(rName, &rDoc, details) != ScRefFlags::ZERO ||
+ while (aRange.Parse(rName, rDoc, details) != ScRefFlags::ZERO ||
aAddr.Parse(rName, &rDoc, details) != ScRefFlags::ZERO)
{
// Range Parse is partially valid also with invalid sheet name,
@@ -487,7 +487,7 @@ ScRangeData::IsNameValidType ScRangeData::IsNameValid( const OUString& rName, co
ScAddress::Details details( static_cast<FormulaGrammar::AddressConvention>( nConv ) );
// Don't check Parse on VALID, any partial only VALID may result in
// #REF! during compile later!
- if (aRange.Parse(rName, &rDoc, details) != ScRefFlags::ZERO ||
+ if (aRange.Parse(rName, rDoc, details) != ScRefFlags::ZERO ||
aAddr.Parse(rName, &rDoc, details) != ScRefFlags::ZERO )
{
return NAME_INVALID_CELL_REF;
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 49a5d227614b..034c0063a492 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -497,7 +497,7 @@ bool ScRangeStringConverter::GetRangeFromString(
aUIString[ nIndex + 1 ] == '.' )
aUIString = aUIString.replaceAt( nIndex + 1, 1, "" );
- bResult = ((rRange.Parse(aUIString, &rDocument, eConv) & ScRefFlags::VALID) ==
+ bResult = ((rRange.Parse(aUIString, rDocument, eConv) & ScRefFlags::VALID) ==
ScRefFlags::VALID);
// #i77703# chart ranges in the file format contain both sheet names, even for an external reference sheet.
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index ed729725695d..5881990eb535 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -309,10 +309,10 @@ OUString XclExpName::GetWithDefaultRangeSeparator( const OUString& rSymbol ) con
// convert with validation
ScRange aRange;
ScAddress::Details detailsXL( ::formula::FormulaGrammar::CONV_XL_A1 );
- ScRefFlags nRes = aRange.Parse( rSymbol.copy(0, nPos), &GetDoc(), detailsXL );
+ ScRefFlags nRes = aRange.Parse( rSymbol.copy(0, nPos), GetDoc(), detailsXL );
if ( nRes & ScRefFlags::VALID )
{
- nRes = aRange.Parse( rSymbol.copy(nPos+1), &GetDoc(), detailsXL );
+ nRes = aRange.Parse( rSymbol.copy(nPos+1), GetDoc(), detailsXL );
if ( nRes & ScRefFlags::VALID )
{
return rSymbol.replaceFirst(";", ",");
diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx
index 537149108597..69d5786fe0ec 100644
--- a/sc/source/filter/oox/revisionfragment.cxx
+++ b/sc/source/filter/oox/revisionfragment.cxx
@@ -410,7 +410,7 @@ void RevisionLogFragment::importRrc( const AttributeList& rAttribs )
return;
OUString aRefStr = rAttribs.getString(XML_ref, OUString());
- mpImpl->maRange.Parse(aRefStr, &getScDocument(), formula::FormulaGrammar::CONV_XL_OOX);
+ mpImpl->maRange.Parse(aRefStr, getScDocument(), formula::FormulaGrammar::CONV_XL_OOX);
if (!mpImpl->maRange.IsValid())
return;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index ccce5bb9e436..142f78a5205b 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -188,7 +188,7 @@ os::src_range_t ScOrcusRefResolver::resolve_range(const char* p, size_t n)
OUString aStr(p, n, mrGlobalSettings.getTextEncoding());
ScRange aRange;
- aRange.Parse(aStr, &mrGlobalSettings.getDoc().getDoc(),
+ aRange.Parse(aStr, mrGlobalSettings.getDoc().getDoc(),
formula::FormulaGrammar::extractRefConvention(
mrGlobalSettings.getCalcGrammar()));
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 11c0b9b792ad..59073a9b3516 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1171,26 +1171,26 @@ GetEditAs( const XclObjAny& rObj )
namespace {
-ScRefFlags parseRange(const OUString& rString, ScRange& rRange, const ScDocument* pDoc)
+ScRefFlags parseRange(const OUString& rString, ScRange& rRange, const ScDocument& rDoc)
{
// start with the address convention set in the document
- formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- ScRefFlags nResult = rRange.Parse(rString, pDoc, eConv);
+ formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention();
+ ScRefFlags nResult = rRange.Parse(rString, rDoc, eConv);
if ( nResult & ScRefFlags::VALID )
return nResult;
// try the default calc address convention
- nResult = rRange.Parse(rString, pDoc);
+ nResult = rRange.Parse(rString, rDoc);
if ( nResult & ScRefFlags::VALID )
return nResult;
// try excel a1
- nResult = rRange.Parse(rString, pDoc, formula::FormulaGrammar::CONV_XL_A1);
+ nResult = rRange.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_A1);
if ( nResult & ScRefFlags::VALID )
return nResult;
// try r1c1
- return rRange.Parse(rString, pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
+ return rRange.Parse(rString, rDoc, formula::FormulaGrammar::CONV_XL_R1C1);
}
ScRefFlags parseAddress(const OUString& rString, ScAddress& rAddress, const ScDocument* pDoc)
@@ -1226,7 +1226,7 @@ void transformURL(const OUString& rOldURL, OUString& rNewURL, const ScDocument&
ScRange aRange;
ScAddress aAddress;
- ScRefFlags nResult = parseRange(aAddressString, aRange, &rDoc);
+ ScRefFlags nResult = parseRange(aAddressString, aRange, rDoc);
if ( nResult & ScRefFlags::VALID )
{
OUString aString = aRange.Format(rDoc, nResult, formula::FormulaGrammar::CONV_XL_OOX);
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9c008807e3b4..23e7c0cb2af0 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1756,7 +1756,7 @@ static OUString lcl_Calculate( const OUString& rFormula, ScDocument& rDoc, const
}
ScRange aTestRange;
- if ( bColRowName || (aTestRange.Parse(rFormula, &rDoc) & ScRefFlags::VALID) )
+ if ( bColRowName || (aTestRange.Parse(rFormula, rDoc) & ScRefFlags::VALID) )
aValue += " ...";
return aValue;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index ddece83a3b2a..f2e36c577f40 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2326,7 +2326,7 @@ static ScNameInputType lcl_GetInputType( const OUString& rText )
if (rText == ScResId(STR_MANAGE_NAMES))
eRet = SC_MANAGE_NAMES;
- else if ( aRange.Parse( rText, &rDoc, eConv ) & ScRefFlags::VALID )
+ else if ( aRange.Parse( rText, rDoc, eConv ) & ScRefFlags::VALID )
eRet = SC_NAME_INPUT_RANGE;
else if ( aAddress.Parse( rText, &rDoc, eConv ) & ScRefFlags::VALID )
eRet = SC_NAME_INPUT_CELL;
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index f8aa54ad60d4..2b1ab6abc576 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -407,7 +407,7 @@ void ScPivotLayoutDialog::UpdateSourceRange()
{
OUString aSourceString = mxSourceEdit->GetText();
ScRange aSourceRange;
- ScRefFlags nResult = aSourceRange.Parse(aSourceString, &mrDocument, maAddressDetails);
+ ScRefFlags nResult = aSourceRange.Parse(aSourceString, mrDocument, maAddressDetails);
bool bIsValid = (nResult & ScRefFlags::VALID) == ScRefFlags::VALID; // aSourceString is valid
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 585e862d3c33..cd2c84a5b885 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -287,7 +287,7 @@ IMPL_LINK(ScSpecialFilterDlg, EndDlgHdl, weld::Button&, rBtn, void)
if ( bEditInputOk )
{
- ScRefFlags nResult = ScRange().Parse( theAreaStr, pDoc, eConv );
+ ScRefFlags nResult = ScRange().Parse( theAreaStr, *pDoc, eConv );
if ( (nResult & ScRefFlags::VALID) == ScRefFlags::ZERO )
{
@@ -304,7 +304,7 @@ IMPL_LINK(ScSpecialFilterDlg, EndDlgHdl, weld::Button&, rBtn, void)
* a ScQueryParam from the filter area:
*/
- ScRefFlags nResult = theFilterArea.Parse( theAreaStr, pDoc, eConv );
+ ScRefFlags nResult = theFilterArea.Parse( theAreaStr, *pDoc, eConv );
if ( (nResult & ScRefFlags::VALID) == ScRefFlags::VALID )
{
@@ -413,7 +413,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit&, rEd, void )
if ( pDoc && pViewData )
{
OUString theCurAreaStr = rEd.GetText();
- ScRefFlags nResult = ScRange().Parse( theCurAreaStr, pDoc );
+ ScRefFlags nResult = ScRange().Parse( theCurAreaStr, *pDoc );
if ( (nResult & ScRefFlags::VALID) == ScRefFlags::VALID )
{
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index eadec19d03ee..8b752a0f5411 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2459,7 +2459,7 @@ bool ScDocShell::DdeSetData( const OUString& rItem,
// because the address item in a DDE entry is *not* normalized when saved
// into ODF.
ScRange aRange;
- bool bValid = ( (aRange.Parse(aPos, &m_aDocument, formula::FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID) ||
+ bool bValid = ( (aRange.Parse(aPos, m_aDocument, formula::FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID) ||
(aRange.aStart.Parse(aPos, &m_aDocument, formula::FormulaGrammar::CONV_OOO) & ScRefFlags::VALID) );
ScServerObject* pObj = nullptr; // NULL = error
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 4bae9f2a798b..68df1169a93f 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -183,7 +183,7 @@ ScImportExport::ScImportExport( ScDocument& r, const OUString& rPos )
}
formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention();
// Range?
- if (aRange.Parse(aPos, &rDoc, eConv) & ScRefFlags::VALID)
+ if (aRange.Parse(aPos, rDoc, eConv) & ScRefFlags::VALID)
bSingle = false;
// Cell?
else if (aRange.aStart.Parse(aPos, &rDoc, eConv) & ScRefFlags::VALID)
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 02d87033a00d..84287b3f93d1 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -87,7 +87,7 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const OUString& rItem ) :
// For DDE link, we always must parse references using OOO A1 convention.
- if ( aRange.Parse( rItem, &rDoc, FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID )
+ if ( aRange.Parse( rItem, rDoc, FormulaGrammar::CONV_OOO ) & ScRefFlags::VALID )
{
// area reference
}
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 36a8905fa10e..20f60edbc6c4 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -350,7 +350,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
}
ScRange aTestRange;
- if ( bColRowName || (aTestRange.Parse(rStrExp, m_pDoc) & ScRefFlags::VALID) )
+ if ( bColRowName || (aTestRange.Parse(rStrExp, *m_pDoc) & ScRefFlags::VALID) )
rStrResult += " ...";
// area
}
diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx
index bdc42cdd5be8..f56b09149a83 100644
--- a/sc/source/ui/miscdlgs/datastreamdlg.cxx
+++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx
@@ -106,7 +106,7 @@ ScRange DataStreamDlg::GetStartRange()
OUString aStr = m_xEdRange->get_text();
ScDocument& rDoc = m_pDocShell->GetDocument();
ScRange aRange;
- ScRefFlags nRes = aRange.Parse(aStr, &rDoc, rDoc.GetAddressConvention());
+ ScRefFlags nRes = aRange.Parse(aStr, rDoc, rDoc.GetAddressConvention());
if ( ((nRes & ScRefFlags::VALID) == ScRefFlags::ZERO) || !aRange.IsValid())
{
// Invalid range.
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 9ac58fb569d6..42223748f0f9 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -332,7 +332,7 @@ bool ScPrintAreasDlg::Impl_CheckRefStrings()
for ( sal_Int32 nIdx = 0; nIdx >= 0; )
{
const OUString aOne = aStrPrintArea.getToken(0, sep, nIdx);
- ScRefFlags nResult = aRange.Parse( aOne, pDoc, eConv );
+ ScRefFlags nResult = aRange.Parse( aOne, *pDoc, eConv );
if ((nResult & nValidRange) != nValidRange)
{
ScRefFlags nAddrResult = aAddr.Parse( aOne, pDoc, eConv );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 948cef3aa6ee..237441bffef2 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1397,7 +1397,7 @@ static bool lcl_ParseTarget( const OUString& rTarget, ScRange& rTargetRange, too
bool bRangeValid = false;
bool bRectValid = false;
- if ( rTargetRange.Parse( rTarget, &rDoc ) & ScRefFlags::VALID )
+ if ( rTargetRange.Parse( rTarget, rDoc ) & ScRefFlags::VALID )
{
bRangeValid = true; // range reference
}
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 86961c989cc5..5d94edb3ba99 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -84,22 +84,22 @@ namespace
};
ScRefFlagsAndType lcl_ParseRangeOrAddress(ScRange& rScRange, ScAddress& rScAddress,
- const OUString& aAddress, const ScDocument* pDoc)
+ const OUString& aAddress, const ScDocument& rDoc)
{
ScRefFlagsAndType aRet;
formula::FormulaGrammar::AddressConvention eConv;
// start with the address convention set in the document
- eConv = pDoc->GetAddressConvention();
- aRet.nResult = rScRange.Parse(aAddress, pDoc, eConv);
+ eConv = rDoc.GetAddressConvention();
+ aRet.nResult = rScRange.Parse(aAddress, rDoc, eConv);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::RANGE;
return aRet;
}
- aRet.nResult = rScAddress.Parse(aAddress, pDoc, eConv);
+ aRet.nResult = rScAddress.Parse(aAddress, &rDoc, eConv);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::ADDRESS;
@@ -107,14 +107,14 @@ namespace
}
// try the default Calc (A1) address convention
- aRet.nResult = rScRange.Parse(aAddress, pDoc);
+ aRet.nResult = rScRange.Parse(aAddress, rDoc);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::RANGE;
return aRet;
}
- aRet.nResult = rScAddress.Parse(aAddress, pDoc);
+ aRet.nResult = rScAddress.Parse(aAddress, &rDoc);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::ADDRESS;
@@ -122,7 +122,7 @@ namespace
}
// try the Excel A1 address convention
- aRet.nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1);
+ aRet.nResult = rScRange.Parse(aAddress, rDoc, formula::FormulaGrammar::CONV_XL_A1);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::RANGE;
@@ -130,7 +130,7 @@ namespace
}
// try the Excel A1 address convention
- aRet.nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1);
+ aRet.nResult = rScAddress.Parse(aAddress, &rDoc, formula::FormulaGrammar::CONV_XL_A1);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::ADDRESS;
@@ -138,14 +138,14 @@ namespace
}
// try Excel R1C1 address convention
- aRet.nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
+ aRet.nResult = rScRange.Parse(aAddress, rDoc, formula::FormulaGrammar::CONV_XL_R1C1);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::RANGE;
return aRet;
}
- aRet.nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
+ aRet.nResult = rScAddress.Parse(aAddress, &rDoc, formula::FormulaGrammar::CONV_XL_R1C1);
if (aRet.nResult & ScRefFlags::VALID)
{
aRet.eDetected = DetectFlags::ADDRESS;
@@ -324,7 +324,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
ScMarkData& rMark = rViewData.GetMarkData();
ScRange aScRange;
ScAddress aScAddress;
- ScRefFlagsAndType aResult = lcl_ParseRangeOrAddress(aScRange, aScAddress, aAddress, &rDoc);
+ ScRefFlagsAndType aResult = lcl_ParseRangeOrAddress(aScRange, aScAddress, aAddress, rDoc);
ScRefFlags nResult = aResult.nResult;
SCTAB nTab = rViewData.GetTabNo();
bool bMark = true;