[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 14 11:18:25 UTC 2019
sc/source/core/tool/address.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 11722e2e3d48d97841f64dffebbf65d3557ea3ac
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 14 10:08:50 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 14 12:17:19 2019 +0100
lcl_Split_DocTab always dereferences pDoc
Change-Id: If93e63be39498803d4c93e71df0368bdfdb9c485
Reviewed-on: https://gerrit.libreoffice.org/82659
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 7df7f06866e9..142d5f42fd84 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -2123,12 +2123,12 @@ OUString ScAddress::Format(ScRefFlags nFlags, const ScDocument* pDoc,
return r.makeStringAndClear();
}
-static void lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab,
+static void lcl_Split_DocTab( const ScDocument& rDoc, SCTAB nTab,
const ScAddress::Details& rDetails,
ScRefFlags nFlags,
OUString& rTabName, OUString& rDocName )
{
- pDoc->GetName(nTab, rTabName);
+ rDoc.GetName(nTab, rTabName);
rDocName.clear();
// External reference, same as in ScCompiler::MakeTabStr()
if ( rTabName[0] == '\'' )
@@ -2147,7 +2147,7 @@ static void lcl_Split_DocTab( const ScDocument* pDoc, SCTAB nTab,
// needlessly complicated if it constructed an actual external
// reference so we add this somewhat cheesy kludge to force the
// addition of the document name even for non-external references
- rDocName = getFileNameFromDoc( pDoc );
+ rDocName = getFileNameFromDoc(&rDoc);
}
ScCompiler::CheckTabQuotes( rTabName, rDetails.eConv);
}
@@ -2159,7 +2159,7 @@ static void lcl_ScRange_Format_XL_Header( OUStringBuffer& rString, const ScRange
if( nFlags & ScRefFlags::TAB_3D )
{
OUString aTabName, aDocName;
- lcl_Split_DocTab( pDoc, rRange.aStart.Tab(), rDetails, nFlags, aTabName, aDocName );
+ lcl_Split_DocTab( *pDoc, rRange.aStart.Tab(), rDetails, nFlags, aTabName, aDocName );
switch (rDetails.eConv)
{
case formula::FormulaGrammar::CONV_XL_OOX:
@@ -2186,7 +2186,7 @@ static void lcl_ScRange_Format_XL_Header( OUStringBuffer& rString, const ScRange
}
if( nFlags & ScRefFlags::TAB2_3D )
{
- lcl_Split_DocTab( pDoc, rRange.aEnd.Tab(), rDetails, nFlags, aTabName, aDocName );
+ lcl_Split_DocTab( *pDoc, rRange.aEnd.Tab(), rDetails, nFlags, aTabName, aDocName );
rString.append(":");
rString.append(aTabName);
}
More information about the Libreoffice-commits
mailing list