From 88f77c347bb2788ec41ca2e30cbf68293fcb5b79 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 9 Jun 2007 01:07:26 +0000 Subject: Fixed bug when setting a range where the start of the range was already a run start. --- src/RunStyles.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index 286734e9b..76174fea4 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -130,11 +130,13 @@ bool RunStyles::FillRange(int &position, int value, int &fillLength) { if (styles->ValueAt(runStart) == value) { // Start is in expected value so trim range. runStart++; - position = starts->PositionFromPartition(runStart); + position = starts->PositionFromPartition(runStart); fillLength = end - position; } else { - runStart = SplitRun(position); - runEnd++; + if (starts->PositionFromPartition(runStart) < position) { + runStart = SplitRun(position); + runEnd++; + } } styles->SetValueAt(runStart, value); // Remove each old run over the range -- cgit v1.2.3