From 0bd425c3b51c6934044ce7cadd3fcd5492af8ae6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 12 Sep 2024 12:06:28 +0100 Subject: null pattern deref seen in ScViewData::SetEditEngine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warn and use the default pool pattern if this happens #0 WhichRangesContainer::getOffsetFromWhich (this=this@entry=0x38, nWhich=nWhich@entry=129) at libreoffice/svl/source/items/itemset.cxx:1895 #1 0x00007fe0179fa4ac in SfxItemSet::Get (this=0x10, nWhich=129, bSrchInParent=) at libreoffice/svl/source/items/itemset.cxx:1152 #2 0x00007fe00736aa2e in ScPatternAttr::GetItem (nWhichP=129, this=0x0) at libreoffice/sc/inc/patattr.hxx:71 #3 ScPatternAttr::GetItem (nWhich=..., this=0x0) at libreoffice/sc/inc/patattr.hxx:73 #4 ScViewData::SetEditEngine (this=this@entry=0x3323c540, eWhich=eWhich@entry=SC_SPLIT_BOTTOMLEFT, pNewEngine=, pWin=pWin@entry=0x32eec4f0, nNewX=nNewX@entry=-1, nNewY=nNewY@entry=-1) at libreoffice/sc/source/ui/view/viewdata.cxx:1613 #5 0x00007fe00731c2f1 in ScTabView::UpdateEditView (this=this@entry=0x3323c538) at libreoffice/sc/source/ui/view/tabview3.cxx:2248 #6 0x00007fe00731c9ae in ScTabView::UpdateFormulas (this=this@entry=0x3323c538, nStartCol=nStartCol@entry=-1, nStartRow=nStartRow@entry=-1, nEndCol=nEndCol@entry=-1, nEndRow=nEndRow@entry=-1) at libreoffice/sc/source/ui/view/tabview3.cxx:2393 #7 0x00007fe007338bc5 in ScTabViewShell::Notify (this=0x3323c330, rBC=..., rHint=...) at libreoffice/sc/source/ui/view/tabvwsh5.cxx:219 #8 0x00007fe017a29bb9 in SfxBroadcaster::Broadcast (this=this@entry=0x2fd10a70, rHint=...) at libreoffice/svl/source/notify/SfxBroadcaster.cxx:40 #9 0x00007fe006f27c3f in ScDocShell::PostDataChanged (this=this@entry=0x2fd10a70) at libreoffice/sc/source/ui/docshell/docsh3.cxx:95 #10 0x00007fe006f17dfc in ScDocShell::SetDocumentModified (this=this@entry=0x2fd10a70) at libreoffice/sc/source/ui/docshell/docsh.cxx:3050 #11 0x00007fe007382e7c in ScViewFunc::DeleteTables (this=this@entry=0x3464aa28, TheTabs=std::vector of length 1, capacity 1 = {...}, bRecord=, bRecord@entry=true) at libreoffice/sc/source/ui/view/viewfun2.cxx:2656 #12 0x00007fe007350825 in ScTabViewShell::ExecuteTable (this=0x3464a820, rReq=...) at libreoffice/sc/source/ui/view/tabvwshf.cxx:910 #13 0x00007fe0175d0cef in SfxDispatcher::Call_Impl (this=0x340a1b70, rShell=..., rSlot=..., rReq=..., bRecord=) at libreoffice/sfx2/source/control/dispatch.cxx:254 #14 0x00007fe0175d8daa in SfxDispatcher::Execute (this=0x340a1b70, nSlot=, nCall=nCall@entry=SfxCallMode::RECORD, pArgs=pArgs@entry=0x7ffe3c51edf0, pInternalArgs=pInternalArgs@entry=0x7ffe3c51ed90, nModi=0) at libreoffice/sfx2/source/control/dispatch.cxx:813 #15 0x00007fe0176166f5 in SfxDispatchController_Impl::dispatch (this=, aURL=..., aArgs=uno::Sequence of length 1 = {...}, rListener=empty uno::Reference) at libreoffice/include/sfx2/ctrlitem.hxx:63 Change-Id: Ib4851414a277a293d6bc44b4ffcd33d332e3c57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173183 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 19437715eb41cbe4853d3926e627206709f6810e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173293 Reviewed-by: Xisco Fauli --- sc/source/ui/view/viewdata.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sc') diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 40e9ce7a9d5a..5d1f54c07658 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1610,6 +1611,11 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, bEditActive[eWhich] = true; const ScPatternAttr* pPattern = mrDoc.GetPattern(nNewX, nNewY, nTabNo); + if (!pPattern) + { + SAL_WARN("sc.viewdata", "No Pattern Found for: Col: " << nNewX << ", Row: " << nNewY << ", Tab: " << nTabNo); + pPattern = &mrDoc.getCellAttributeHelper().getDefaultCellAttribute(); + } SvxCellHorJustify eJust = pPattern->GetItem( ATTR_HOR_JUSTIFY ).GetValue(); bool bBreak = ( eJust == SvxCellHorJustify::Block ) || -- cgit