summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-04-24 09:37:35 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2024-05-03 11:42:03 +0200
commit1f49854c0d18000f52d3ad4525bb52b2f35cc064 (patch)
tree4375133a9ac541dca25b08740ead1154bf7f3e3c
parent8dc932a517818b5b721653b372aa0124aff2375f (diff)
sc: fix crash in ScColumn::SetEditText()
Crashreport: > SIG Fatal signal received: SIGSEGV code: 128 for address: 0x0 > program/libsclo.so > ScColumn::SetEditText(int, std::unique_ptr<EditTextObject, std::default_delete<EditTextObject> >) > sc/source/core/data/column3.cxx:2362 > program/libsclo.so > ScTable::SetEditText(short, int, std::unique_ptr<EditTextObject, std::default_delete<EditTextObject> >) > /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395 > program/libsclo.so > ScDocument::SetEditText(ScAddress const&, std::unique_ptr<EditTextObject, std::default_delete<EditTextObject> >) > /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395 > program/libsclo.so > ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, bool) > /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395 > program/libsclo.so > (anonymous namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous namespace)::FormulaProcessingContext>) > sc/source/ui/view/viewfunc.cxx:565 Change-Id: I331ca8784702fdcb0ebad6a0a73390dbe2615ece Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166612 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit e3ce4aad47c052dcd67107f7c91336f4ecc949be) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166526 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 58b85fc5e4ebe6c8a77e2b1935c23bf0ebebad0a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166848 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/data/column3.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f0f4cc83263b..5a1582e560d7 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2358,6 +2358,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const OUString& rString,
void ScColumn::SetEditText( SCROW nRow, std::unique_ptr<EditTextObject> pEditText )
{
+ if (!pEditText)
+ {
+ return;
+ }
+
pEditText->NormalizeString(GetDoc().GetSharedStringPool());
std::vector<SCROW> aNewSharedRows;
sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, false);