summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-15 12:32:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-15 12:50:54 +0100
commitb8fdb51d76ae08b94fd8d9d613b4fc21cedcbe22 (patch)
tree85bda7aad5091911c4715a3c5e1fd5bb715f4fef
parent06853ea625b81fa8635da4bbbdb86e54eecc603d (diff)
Resolves: rhbz#738255 avoid crash on NULL pointer
-rw-r--r--sc/source/ui/app/inputhdl.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1524397a121f..c30a8fd5824a 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2469,13 +2469,16 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocument();
// #i67990# don't use pLastPattern in EnterHandler
const ScPatternAttr* pPattern = pDoc->GetPattern( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab() );
- SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
- // without conditional format, as in ScColumn::SetString
- sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
- double nVal;
- if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
+ if (pPattern)
{
- bSpellErrors = false; // ignore the spelling errors
+ SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
+ // without conditional format, as in ScColumn::SetString
+ sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter );
+ double nVal;
+ if ( pFormatter->IsNumberFormat( aString, nFormat, nVal ) )
+ {
+ bSpellErrors = false; // ignore the spelling errors
+ }
}
}
}