svl/source/undo/undo.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 19eab7b79c13edc657f4e3f380889ed0206357bd
Author: Miklos Vajna <vmik...@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 <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@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));
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to