Skip to content

Commit

Permalink
crashtesting: SvBaseLink::Update can invalidate later entries
Browse files Browse the repository at this point in the history
e.g. load forum-mso-en4-62141.xls and update links

 #0  sfx2::LinkManager::Remove (this=0x270d720, pLink=0x27b5780) at core/sfx2/source/appl/linkmgr2.cxx:118
 #1  0x00007fffa9813eef in ScDocument::UpdateRefAreaLinks (this=0x1f5d740, eUpdateRefMode=URM_INSDEL, rRange=..., nDx=0, nDy=-6, nDz=0)
     at core/sc/source/core/data/documen8.cxx:1141
 #2  0x00007fffa97a8639 in ScDocument::UpdateReference (this=0x1f5d740, rCxt=..., pUndoDoc=0x0, bIncludeDraw=true, bUpdateNoteCaptionPos=false)
     at core/sc/source/core/data/documen3.cxx:1053
 #3  0x00007fffa9829c9e in ScDocument::DeleteRow (this=0x1f5d740, nStartCol=1, nStartTab=0, nEndCol=7, nEndTab=0, nStartRow=3, nSize=6, pRefUndoDoc=0x0, pUndoOutline=0x0, pTabMark=0x0)
     at core/sc/source/core/data/document.cxx:1431
 #4  0x00007fffa982a324 in ScDocument::DeleteRow (this=0x1f5d740, rRange=...) at core/sc/source/core/data/document.cxx:1484
 #5  0x00007fffa982d1a4 in ScDocument::FitBlock (this=0x1f5d740, rOld=..., rNew=..., bClear=true) at core/sc/source/core/data/document.cxx:1883
 #6  0x00007fffaa6c385d in ScAreaLink::Refresh
     (this=0x27b5780, rNewFile="http://stocks.tradingcharts.com/stocks/symbols/s/NYSE/Boeing", rNewFilter="calc_HTML_WebQuery", rNewArea="HTML_2", nNewRefreshDelaySeconds=0)
     at core/sc/source/ui/docshell/arealink.cxx:365
 #7  0x00007fffaa6c5069 in ScAreaLink::DataChanged (this=0x27b5780) at core/sc/source/ui/docshell/arealink.cxx:128
 #8  0x00007ffff3ac81e1 in sfx2::SvBaseLink::Update (this=0x27b5780) at core/sfx2/source/appl/lnkbase2.cxx:324
 #9  0x00007fffa98137b6 in ScDocument::UpdateAreaLinks (this=0x1f5d740) at core/sc/source/core/data/documen8.cxx:1058

Change-Id: Ie6c59b240d9a24cbf427be9c5bfda1660fe888c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181078
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
  • Loading branch information
caolanm committed Feb 4, 2025
1 parent bfb8dbc commit cdb0c1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sc/source/core/data/documen8.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1051,9 +1051,10 @@ void ScDocument::UpdateAreaLinks()
return;

const ::sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
for (const auto & rLink : rLinks)
// Note: SvBaseLink::Update can remove entries after the current one
for (size_t i = 0; i < rLinks.size(); ++i)
{
::sfx2::SvBaseLink* pBase = rLink.get();
::sfx2::SvBaseLink* pBase = rLinks[i].get();
if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
pBase->Update();
}
Expand Down

0 comments on commit cdb0c1e

Please sign in to comment.