[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kpresenter/part
From:       Jean-Nicolas Artaud <jeannicolasartaud () gmail ! com>
Date:       2010-10-09 13:12:17
Message-ID: 20101009131217.29159AC892 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1184218 by artaud:


* Fix a crash when a page is moved before the first page.



 M  +4 -4      KPrViewModeSlidesSorter.cpp  


--- trunk/koffice/kpresenter/part/KPrViewModeSlidesSorter.cpp #1184217:1184218
@@ -229,11 +229,11 @@
         newIndex = m_viewModeSlidesSorter->pageCount() - 1;
     }
     if (oldIndex != newIndex) {
-        if (oldIndex < newIndex) {
+        if (oldIndex > newIndex && newIndex > 0) {
+            newIndex--;
+        }
+
             m_viewModeSlidesSorter->movePage(oldIndex, newIndex);
-        } else {
-            m_viewModeSlidesSorter->movePage(oldIndex, newIndex - 1);
-        }
         QListWidgetItem *sourceItem = takeItem(oldIndex);
         insertItem(newIndex, sourceItem);
         // This selection helps the user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic