sc/source/ui/view/viewdata.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c5b3f8853751d67c364a91fdeaed3f36cea3179c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun May 22 13:44:21 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun May 22 15:34:46 2022 +0200

    cid#1504537 silence Dereference after null check
    
    no change in practice because either pDoc or pDocSh and not both
    are set
    
    Change-Id: I1da19bef2a2a5cec700cbc6126f873079efcba88
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134733
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 31f3e5fdeaa9..ac31e522ac79 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -782,7 +782,7 @@ ScViewData::ScViewData(ScDocument* pDoc, ScDocShell* 
pDocSh, ScTabViewShell* pVi
         nPPTY(0.0),
         maMarkData  (pDocSh ? pDocSh->GetDocument().GetSheetLimits() : 
pDoc->GetSheetLimits()),
         pDocShell   ( pDocSh ),
-        mrDoc       (pDoc ? *pDoc : pDocSh->GetDocument()),
+        mrDoc       (pDocSh ? pDocSh->GetDocument() : *pDoc),
         pView       ( pViewSh ),
         maOptions   (pDocSh ? pDocSh->GetDocument().GetViewOptions() : 
DefaultOptions()),
         pSpellingView ( nullptr ),

Reply via email to