summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-08-24 13:04:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-08-24 17:12:51 +0200
commitee7b7acba288d265001237e3d81a1791e322ed28 (patch)
tree72fb32e42b0e127d9b862abbb89e2e4f70070cd2 /sc
parent2f05a65a4eafcbda3438e50bd0b6518248c04d5d (diff)
cid#1509194 Dereference after null check
Change-Id: Idb290b2780af402f8573c8231e63b2598b34ba43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138768 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index bfbb446e1364..f16e52af8fb6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3458,10 +3458,14 @@ void ScInputHandler::CancelHandler()
eMode = SC_INPUT_NONE;
StopInputWinEngine( true );
+ SCCOL nMaxCol(MAXCOL);
if (pExecuteSh)
+ {
pExecuteSh->StopEditShell();
+ nMaxCol = pExecuteSh->GetViewData().GetDocument().MaxCol();
+ }
- aCursorPos.Set(pExecuteSh->GetViewData().GetDocument().MaxCol()+1,0,0); // Invalid flag
+ aCursorPos.Set(nMaxCol+1,0,0); // Invalid flag
mpEditEngine->SetTextCurrentDefaults(OUString());
if ( !pLastState && pExecuteSh )