diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-12 12:06:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-12 17:44:30 +0200 |
commit | 19437715eb41cbe4853d3926e627206709f6810e (patch) | |
tree | 8c2e264a415bc1592512ce1fc39f3c05caee4198 /sc | |
parent | e5a0209d4b1e1f09191a442e04d626b21c49b9df (diff) |
null pattern deref seen in ScViewData::SetEditEngine
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=<optimized out>) 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<SvxHorJustifyItem> (nWhich=..., this=0x0) at libreoffice/sc/inc/patattr.hxx:73
#4 ScViewData::SetEditEngine (this=this@entry=0x3323c540, eWhich=eWhich@entry=SC_SPLIT_BOTTOMLEFT, pNewEngine=<optimized out>, 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=<optimized out>, 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=<optimized out>)
at libreoffice/sfx2/source/control/dispatch.cxx:254
#14 0x00007fe0175d8daa in SfxDispatcher::Execute (this=0x340a1b70, nSlot=<optimized out>, 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=<optimized out>, 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 <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 102c7ad9adb1..34ba5cee8197 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -45,6 +45,7 @@ #include <attrib.hxx> #include <tabview.hxx> #include <tabvwsh.hxx> +#include <docpool.hxx> #include <docsh.hxx> #include <patattr.hxx> #include <editutil.hxx> @@ -1611,6 +1612,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 ) || |