[Libreoffice-commits] core.git: sc/inc sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 15 13:28:10 UTC 2020
sc/inc/address.hxx | 2 +-
sc/source/core/tool/address.cxx | 4 ++--
sc/source/core/tool/interpr1.cxx | 4 ++--
sc/source/core/tool/rangeutl.cxx | 6 +++---
sc/source/ui/miscdlgs/tabopdlg.cxx | 8 ++++----
5 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit 2ee88d0ebe767ccd5f49300be5bd675edec0c2cf
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 14 12:27:37 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Sep 15 15:27:21 2020 +0200
ConvertSingleRef never passed a null ScDocument*
Change-Id: I1ce4f369d8078e1950204b3046457582d9d67397
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102736
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index c2304965b240..5fc9a361cb66 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -959,7 +959,7 @@ template< typename T > inline void PutInOrder( T& nStart, T& nEnd )
}
}
-bool ConvertSingleRef( const ScDocument* pDocument, const OUString& rRefString,
+bool ConvertSingleRef( const ScDocument& pDocument, const OUString& rRefString,
SCTAB nDefTab, ScRefAddress& rRefAddress,
const ScAddress::Details& rDetails,
ScAddress::ExternalInfo* pExtInfo = nullptr );
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index dc820a73582c..4596074e102a 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1493,7 +1493,7 @@ static ScRefFlags lcl_ScAddress_Parse ( const sal_Unicode* p, const ScDocument*
}
}
-bool ConvertSingleRef( const ScDocument* pDoc, const OUString& rRefString,
+bool ConvertSingleRef( const ScDocument& rDoc, const OUString& rRefString,
SCTAB nDefTab, ScRefAddress& rRefAddress,
const ScAddress::Details& rDetails,
ScAddress::ExternalInfo* pExtInfo /* = NULL */ )
@@ -1502,7 +1502,7 @@ bool ConvertSingleRef( const ScDocument* pDoc, const OUString& rRefString,
if (pExtInfo || (ScGlobal::FindUnquoted( rRefString, SC_COMPILER_FILE_TAB_SEP) == -1))
{
ScAddress aAddr( 0, 0, nDefTab );
- ScRefFlags nRes = aAddr.Parse( rRefString, pDoc, rDetails, pExtInfo);
+ ScRefFlags nRes = aAddr.Parse( rRefString, &rDoc, rDetails, pExtInfo);
if ( nRes & ScRefFlags::VALID )
{
rRefAddress.Set( aAddr,
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 3c6dea7ce105..7e906aa18ea5 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8106,8 +8106,8 @@ void ScInterpreter::ScIndirect()
else
PushDoubleRef( aRefAd, aRefAd2);
}
- else if ( ConvertSingleRef(&mrDoc, sRefStr, nTab, aRefAd, aDetails, &aExtInfo) ||
- ( bTryXlA1 && ConvertSingleRef (&mrDoc, sRefStr, nTab, aRefAd,
+ else if ( ConvertSingleRef(mrDoc, sRefStr, nTab, aRefAd, aDetails, &aExtInfo) ||
+ ( bTryXlA1 && ConvertSingleRef (mrDoc, sRefStr, nTab, aRefAd,
aDetailsXlA1, &aExtInfo) ) )
{
if (aExtInfo.mbExternal)
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 24f62c9c5de5..c90c61d0055c 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -128,9 +128,9 @@ bool ScRangeUtil::IsAbsTabArea( const OUString& rAreaStr,
aStartPosStr = aTempAreaStr.copy( 0, nColonPos );
aEndPosStr = aTempAreaStr.copy( nColonPos+1 );
- if ( ConvertSingleRef( pDoc, aStartPosStr, 0, aStartPos, rDetails ) )
+ if ( ConvertSingleRef( *pDoc, aStartPosStr, 0, aStartPos, rDetails ) )
{
- if ( ConvertSingleRef( pDoc, aEndPosStr, aStartPos.Tab(), aEndPos, rDetails ) )
+ if ( ConvertSingleRef( *pDoc, aEndPosStr, aStartPos.Tab(), aEndPos, rDetails ) )
{
aStartPos.SetRelCol( false );
aStartPos.SetRelRow( false );
@@ -216,7 +216,7 @@ bool ScRangeUtil::IsAbsPos( const OUString& rPosStr,
{
ScRefAddress thePos;
- bool bIsAbsPos = ConvertSingleRef( &rDoc, rPosStr, nTab, thePos, rDetails );
+ bool bIsAbsPos = ConvertSingleRef( rDoc, rPosStr, nTab, thePos, rDetails );
thePos.SetRelCol( false );
thePos.SetRelRow( false );
thePos.SetRelTab( false );
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index 5fda368f1c40..7e9be6ea820a 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -216,7 +216,7 @@ static bool lcl_Parse( const OUString& rString, const ScDocument& rDoc, SCTAB nC
bRet = ConvertDoubleRef( rDoc, rString, nCurTab, rStart, rEnd, eConv );
else
{
- bRet = ConvertSingleRef( &rDoc, rString, nCurTab, rStart, eConv );
+ bRet = ConvertSingleRef( rDoc, rString, nCurTab, rStart, eConv );
rEnd = rStart;
}
return bRet;
@@ -250,7 +250,7 @@ IMPL_LINK(ScTabOpDlg, BtnHdl, weld::Button&, rBtn, void)
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
if (!m_xEdRowCell->GetText().isEmpty())
{
- if (!ConvertSingleRef( pDoc, m_xEdRowCell->GetText(), nCurTab,
+ if (!ConvertSingleRef( *pDoc, m_xEdRowCell->GetText(), nCurTab,
theRowCell, eConv ))
nError = TABOPERR_WRONGROW;
else
@@ -264,7 +264,7 @@ IMPL_LINK(ScTabOpDlg, BtnHdl, weld::Button&, rBtn, void)
}
if (!m_xEdColCell->GetText().isEmpty())
{
- if (!ConvertSingleRef( pDoc, m_xEdColCell->GetText(), nCurTab,
+ if (!ConvertSingleRef( *pDoc, m_xEdColCell->GetText(), nCurTab,
theColCell, eConv ))
nError = TABOPERR_WRONGCOL;
else
@@ -272,7 +272,7 @@ IMPL_LINK(ScTabOpDlg, BtnHdl, weld::Button&, rBtn, void)
if (eMode == ScTabOpParam::Row) // both
{
eMode = ScTabOpParam::Both;
- ConvertSingleRef( pDoc, m_xEdFormulaRange->GetText(), nCurTab,
+ ConvertSingleRef( *pDoc, m_xEdFormulaRange->GetText(), nCurTab,
theFormulaCell, eConv );
}
else if (theFormulaCell.Row() != theFormulaEnd.Row())
More information about the Libreoffice-commits
mailing list