summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-17 14:15:29 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-17 20:43:30 +0200
commit6449247af9b5509723f2c0e616504b468e2afc49 (patch)
treefa3fd1f7b16293deb2f2ba30d05492385d22f922 /sc/source/ui
parent4058ca814a794cc80a4ebb2089df95798b2de85e (diff)
cid#1606549 Dereference null return value
Change-Id: Ic9c25d9b4ac3d8e368848cb9bbc42f5076bc321f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170631 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 204854b09764..d3512500037a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -623,14 +623,14 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
if (pDBData == rDoc.GetAnonymousDBData( nTab) || rDoc.GetDBCollection()->getAnonDBs().has( pDBData))
pDBData->UpdateFromSortParam( rSortParam);
- if (comphelper::LibreOfficeKit::isActive())
+ if (SfxViewShell* pKitSomeViewForThisDoc = comphelper::LibreOfficeKit::isActive() ?
+ rDocShell.GetBestViewShell(false) : nullptr)
{
- SfxViewShell* pSomeViewForThisDoc = rDocShell.GetBestViewShell(false);
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
- if (pTabViewShell && pSomeViewForThisDoc && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
+ if (pTabViewShell && pTabViewShell->GetDocId() == pKitSomeViewForThisDoc->GetDocId())
{
if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nTab))
pPosHelper->invalidateByIndex(nStartRow);
@@ -639,7 +639,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
}
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
- pSomeViewForThisDoc, false /* bColumns */, true /* bRows */, true /* bSizes*/,
+ pKitSomeViewForThisDoc, false /* bColumns */, true /* bRows */, true /* bSizes*/,
true /* bHidden */, true /* bFiltered */, true /* bGroups */, nTab);
}