You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libreoffice/0001-Resolves-rhbz-738255-a...

40 lines
1.7 KiB

From 76cf006837fdb687ce0a34ac673f3b8531b19700 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 15 Sep 2011 12:32:51 +0100
Subject: [PATCH] Resolves: rhbz#738255 avoid crash on NULL pointer
---
sc/source/ui/app/inputhdl.cxx | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1524397..c30a8fd 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
+ }
}
}
}
--
1.7.6