From 7e259e7b6e28e08a1ac2055b5a4c9d6bc97f78d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 16 Jun 2022 13:47:31 +0100 Subject: [PATCH] tdf#149529 crash on deref deleted ScDocument* maybe a problem since commit 46419cd7a2d453c6f252c28dfb9dbfb08605e1c4 Date: Tue Jun 18 15:11:30 2013 -0400 ScFormulaCell is no longer a child class of ScBaseCell. Change-Id: Id33072f193045e2eaf51373b47dac803f9a5d52c presumably the cloned ScColorScaleEntry should end up with a ScFormulaCell for the destination document and not the source one Change-Id: I451d5827be183198b61116ab8c582cfda03b2031 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135998 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 10404751bcb643605c50d530e3855ae005e60a5e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135992 --- sc/source/core/data/colorscale.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 81944e4dd0c3..5cbf21cf8094 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -189,7 +189,7 @@ ScColorScaleEntry::ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry& setListener(); if(rEntry.mpCell) { - mpCell.reset(new ScFormulaCell(*rEntry.mpCell, rEntry.mpCell->GetDocument(), rEntry.mpCell->aPos, ScCloneFlags::NoMakeAbsExternal)); + mpCell.reset(new ScFormulaCell(*rEntry.mpCell, *pDoc, rEntry.mpCell->aPos, ScCloneFlags::NoMakeAbsExternal)); mpCell->StartListeningTo( *pDoc ); mpListener.reset(new ScFormulaListener(mpCell.get())); if (mpFormat) -- 2.11.4.GIT