Diff of /branches/repeats_and_segment_links/src/gui/editors/notation/NotationHLayout.cpp [r12144] .. [r12145] Maximize Restore

  Switch to side-by-side view

--- a/branches/repeats_and_segment_links/src/gui/editors/notation/NotationHLayout.cpp
+++ b/branches/repeats_and_segment_links/src/gui/editors/notation/NotationHLayout.cpp
@@ -1226,7 +1226,11 @@
             }
         }
 
-        m_timePerProgressIncrement = timeCovered / (100 / m_barData.size());
+        // Don't crash if more than 100 segments
+        int k = 100 / m_barData.size();
+        if (k < 1) k = 1;
+        
+        m_timePerProgressIncrement = timeCovered / k;
 
         layout(i, startTime, endTime, full);
         ++staffNo;