summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-05 14:06:13 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-07-09 00:51:45 +0200
commitb01a1a825a87a529745b15345060443ebae7be46 (patch)
tree78387a668832572ae75aa711547d0a8509579778
parentee80e50a9e18428b0e135e256da3efeb81a63787 (diff)
cid#1609595 Dereference null return value cib_contract49c-24.2.4.3.M1
Change-Id: I6ae93f46c50e0fe4a29d03fdf02797f808d4d1c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170022 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170090
-rw-r--r--sd/source/ui/view/Outliner.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 7df93444c6cb..ff613cae2b7a 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1844,13 +1844,13 @@ SdrObject* SdOutliner::SetObject (
if(rPosition.meEditMode == EditMode::Page && rPosition.mePageKind == PageKind::Notes)
{
std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock());
- std::shared_ptr<sd::DrawViewShell> pDrawViewShell(
- std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
-
- if (pDrawViewShell->GetEditMode() != EditMode::Page
- || pDrawViewShell->GetCurPagePos() != rPosition.mnPageIndex)
- SetPage(EditMode::Page, static_cast<sal_uInt16>(rPosition.mnPageIndex));
-
+ if (std::shared_ptr<sd::DrawViewShell> pDrawViewShell =
+ std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell))
+ {
+ if (pDrawViewShell->GetEditMode() != EditMode::Page
+ || pDrawViewShell->GetCurPagePos() != rPosition.mnPageIndex)
+ SetPage(EditMode::Page, static_cast<sal_uInt16>(rPosition.mnPageIndex));
+ }
mnText = rPosition.mnText;
return rPosition.mxObject.get().get();
}