From faf8d79ef617090a710bd98f5ad936dd27a0867d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 30 May 2014 09:25:09 +0100 Subject: coverity#705870 Dereference before null check Change-Id: Ie4588f8cb0f11b831d091b0f478b78d0472af160 --- sd/source/ui/view/Outliner.cxx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'sd/source/ui/view') diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index d56f754a140e..ba7d1a0e67da 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -816,13 +816,10 @@ void Outliner::DetectChange (void) } } - - - -bool Outliner::DetectSelectionChange (void) +bool Outliner::DetectSelectionChange() { bool bSelectionHasChanged = false; - sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount(); + sal_uLong nMarkCount = mpView ? mpView->GetMarkedObjectList().GetMarkCount() : 0; // If mpObj is NULL then we have not yet found our first match. // Detecting a change makes no sense. @@ -853,10 +850,7 @@ bool Outliner::DetectSelectionChange (void) return bSelectionHasChanged; } - - - -void Outliner::RememberStartPosition (void) +void Outliner::RememberStartPosition() { ::boost::shared_ptr pViewShell (mpWeakViewShell.lock()); if ( ! pViewShell) @@ -909,10 +903,7 @@ void Outliner::RememberStartPosition (void) } } - - - -void Outliner::RestoreStartPosition (void) +void Outliner::RestoreStartPosition() { bool bRestore = true; // Take a negative start page index as inidicator that restoring the -- cgit