Kaydet (Commit) 19eab7b7 authored tarafından Miklos Vajna's avatar Miklos Vajna

svl: no need to iterate in reverse order in GetRedoActionsInfo()

We have random access to the array after all, so the non-reverse order
is OK as well, and it's more readable.

Change-Id: I966a56ae2e161d95f56927be1b2a9f9162d0f7bb
Reviewed-on: https://gerrit.libreoffice.org/28204Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 6fdfa13a
......@@ -1333,9 +1333,11 @@ OUString SfxUndoManager::GetRedoActionsInfo() const
{
boost::property_tree::ptree aActions;
const SfxUndoArray* pUndoArray = m_xData->pActUndoArray;
for (size_t i = GetRedoActionCount(); i > 0; --i)
size_t nCount = GetRedoActionCount();
for (size_t i = 0; i < nCount; ++i)
{
boost::property_tree::ptree aAction = lcl_ActionToJson(i - 1, pUndoArray->aUndoActions[pUndoArray->nCurUndoAction - 1 + i].pAction);
size_t nIndex = nCount - i - 1;
boost::property_tree::ptree aAction = lcl_ActionToJson(nIndex, pUndoArray->aUndoActions[pUndoArray->nCurUndoAction + nIndex].pAction);
aActions.push_back(std::make_pair("", aAction));
}
......
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