[Libreoffice-commits] core.git: sc/inc sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Sep 13 19:17:57 UTC 2020
sc/inc/arealink.hxx | 2 +-
sc/source/ui/docshell/arealink.cxx | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit b4983e9607134bcf803a895a632412526c2cfe41
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 15:00:05 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Sep 13 21:17:13 2020 +0200
FindExtRange never passed a null ScDocument*
Change-Id: Ifdc0103a17a7e8772fbd91150b9db5e032f7a0a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102584
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/inc/arealink.hxx b/sc/inc/arealink.hxx
index 209bb4a3d0de..9419dc14d13e 100644
--- a/sc/inc/arealink.hxx
+++ b/sc/inc/arealink.hxx
@@ -40,7 +40,7 @@ private:
bool bAddUndo;
bool bInCreate;
bool bDoInsert; // is set to FALSE for first update
- static bool FindExtRange( ScRange& rRange, const ScDocument* pSrcDoc, const OUString& rAreaName );
+ static bool FindExtRange( ScRange& rRange, const ScDocument& rSrcDoc, const OUString& rAreaName );
public:
ScAreaLink( SfxObjectShell* pShell, const OUString& rFile,
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index a07b5573d8d5..d34d1c7ea8d8 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -179,12 +179,12 @@ bool ScAreaLink::IsEqual( const OUString& rFile, const OUString& rFilter, const
aSourceArea == rSource && aDestArea.aStart == rDest.aStart;
}
-// find a range with name >rAreaName< in >pSrcDoc<, return it in >rRange<
-bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument* pSrcDoc, const OUString& rAreaName )
+// find a range with name >rAreaName< in >rSrcDoc<, return it in >rRange<
+bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument& rSrcDoc, const OUString& rAreaName )
{
bool bFound = false;
OUString aUpperName = ScGlobal::getCharClassPtr()->uppercase(rAreaName);
- ScRangeName* pNames = pSrcDoc->GetRangeName();
+ ScRangeName* pNames = rSrcDoc.GetRangeName();
if (pNames) // named ranges
{
const ScRangeData* p = pNames->findByUpperName(aUpperName);
@@ -193,7 +193,7 @@ bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument* pSrcDoc, const
}
if (!bFound) // database ranges
{
- ScDBCollection* pDBColl = pSrcDoc->GetDBCollection();
+ ScDBCollection* pDBColl = rSrcDoc.GetDBCollection();
if (pDBColl)
{
const ScDBData* pDB = pDBColl->getNamedDBs().findByUpperName(aUpperName);
@@ -210,8 +210,8 @@ bool ScAreaLink::FindExtRange( ScRange& rRange, const ScDocument* pSrcDoc, const
}
if (!bFound) // direct reference (range or cell)
{
- ScAddress::Details aDetails(pSrcDoc->GetAddressConvention(), 0, 0);
- if ( rRange.ParseAny( rAreaName, pSrcDoc, aDetails ) & ScRefFlags::VALID )
+ ScAddress::Details aDetails(rSrcDoc.GetAddressConvention(), 0, 0);
+ if ( rRange.ParseAny( rAreaName, &rSrcDoc, aDetails ) & ScRefFlags::VALID )
bFound = true;
}
return bFound;
@@ -291,7 +291,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
do
{
ScRange aTokenRange;
- if( FindExtRange( aTokenRange, &rSrcDoc, aTempArea.getToken( 0, ';', nIdx ) ) )
+ if( FindExtRange( aTokenRange, rSrcDoc, aTempArea.getToken( 0, ';', nIdx ) ) )
{
aSourceRanges.push_back( aTokenRange);
// columns: find maximum
More information about the Libreoffice-commits
mailing list