diff options
author | Noel Grandin <noel@peralex.com> | 2014-02-17 11:41:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-02-17 14:04:54 +0200 |
commit | 0beb64bfcdd02c17938396448f861b9fb55f20a3 (patch) | |
tree | efdcbcc4350975161c11b9c5ed3343cd4ff43c44 | |
parent | 4d15e903bf7d49a2bb2fa532037eb84429012a42 (diff) |
cid#736789 dereference before null check
Change-Id: I657880e7ed37f9933efcfc110daae8b4c4791497
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 8083bfc814f5..6145fcf98b44 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1171,15 +1171,12 @@ SdrPage* ScShapeChildren::GetDrawPage() const { SCTAB nTab( mpViewShell->GetLocationData().GetPrintTab() ); SdrPage* pDrawPage = NULL; - if (mpViewShell) + ScDocument* pDoc = mpViewShell->GetDocument(); + if (pDoc && pDoc->GetDrawLayer()) { - ScDocument* pDoc = mpViewShell->GetDocument(); - if (pDoc && pDoc->GetDrawLayer()) - { - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab)) - pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab))); - } + ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); + if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab)) + pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab))); } return pDrawPage; } |