forked from amazingfate/loongoffice
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>
This commit is contained in:
@ -2356,6 +2356,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);
|
||||
|
||||
Reference in New Issue
Block a user