Kaydet (Commit) e5d8be32 authored tarafından Noel Grandin's avatar Noel Grandin

ubsan fix after "drop GetId() from SfxUndoAction"

bug introduced by
commit 64ea8306
drop GetId() from SfxUndoAction

Change-Id: I75b23650c7dc15fc76fe1b9118129ff8ead35315
Reviewed-on: https://gerrit.libreoffice.org/35333Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 545ad832
......@@ -385,7 +385,12 @@ UndoManager::GetLastUndoInfo(
}
if (o_pId)
{
*o_pId = static_cast<const SwUndo*>(pAction)->GetId();
if (auto pListAction = dynamic_cast<const SfxListUndoAction*>(pAction))
*o_pId = (SwUndoId)pListAction->GetId();
else if (auto pSwAction = dynamic_cast<const SwUndo*>(pAction))
*o_pId = pSwAction->GetId();
else
*o_pId = SwUndoId::EMPTY;
}
return true;
......@@ -443,7 +448,12 @@ bool UndoManager::GetFirstRedoInfo(OUString *const o_pStr,
}
if (o_pId)
{
*o_pId = static_cast<const SwUndo*>(pAction)->GetId();
if (auto pListAction = dynamic_cast<const SfxListUndoAction*>(pAction))
*o_pId = (SwUndoId)pListAction->GetId();
else if (auto pSwAction = dynamic_cast<const SwUndo*>(pAction))
*o_pId = pSwAction->GetId();
else
*o_pId = SwUndoId::EMPTY;
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment