summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAttila Szűcs <szucs.attila3@nisz.hu>2022-06-21 15:27:35 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-06-24 11:33:13 +0200
commitdc8d912884f4893f2a3f553ecfe732a234d04e0d (patch)
tree11a9f504b2444531b7b497e178a41e8a1a2a7b98
parentPump XInputStream into an SvMemoryStream rather than an OStringBuffer (diff)
downloadcore-dc8d912884f4893f2a3f553ecfe732a234d04e0d.tar.gz
core-dc8d912884f4893f2a3f553ecfe732a234d04e0d.zip
tdf#149574 sc: fix missing nullptr check
Regression from commit 605b4ba57b2daa447af9d43d3759079e15df8148 "tdf#43958 sc: fix fill by selecting merged cell". Check if GetPattern(actual cell) is not nullptr, before using it. This is not the real problem of Bug 149574, but it is a problem anyway, and it fixes this bug. The real problem is the wrong ViewData::nTabNo, that point to an already deleted table, (fixed in 954d119db932434dc976ef739c643be0d9c7023c "tdf#149502 sc: crash fix: Change in Table destruction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I26fc629ccf354c9e0c2662d61254d01be91d08f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136230 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit c4c827e1d370dcc351c4dddc601b3c37fc71564b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136323 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/source/ui/view/viewdata.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 6ac95430a84e..5cee19f21eb7 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1153,7 +1153,7 @@ ScMarkType ScViewData::GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark )
if (eMarkType == SC_MARK_NONE)
eMarkType = SC_MARK_SIMPLE;
const ScPatternAttr* pMarkPattern = mrDoc.GetPattern(GetCurX(), GetCurY(), GetTabNo());
- if (pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET)
+ if (pMarkPattern && pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET)
{
SCROW nRow = pMarkPattern->GetItem(ATTR_MERGE).GetRowMerge();
SCCOL nCol = pMarkPattern->GetItem(ATTR_MERGE).GetColMerge();