[Libreoffice-commits] core.git: svl/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Aug 18 06:56:55 UTC 2016
svl/source/undo/undo.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 19eab7b79c13edc657f4e3f380889ed0206357bd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Aug 18 08:19:20 2016 +0200
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/28204
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index f2f6bd8..ae55539 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -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));
}
More information about the Libreoffice-commits
mailing list