sc/source/ui/view/viewdata.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cb232588e15e9b80cbba1ce698a962eb02e15e5e
Author:     Attila Szűcs <szucs.atti...@nisz.hu>
AuthorDate: Tue Jun 21 15:27:35 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Jun 24 13:48:41 2022 +0200

    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 <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit c4c827e1d370dcc351c4dddc601b3c37fc71564b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136322
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 88d57f106a3b..69ebe09d22d4 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1155,7 +1155,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();

Reply via email to