-rw-r--r-- | korganizer/kodaymatrix.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index a2e0ae0..3ee1fa7 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -286,4 +286,5 @@ void KODayMatrix::addSelectedDaysTo(DateList& selDays) | |||
286 | 286 | ||
287 | void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) | 287 | bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) |
288 | { | 288 | { |
289 | bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION ); | ||
289 | mSelStart = startdate.daysTo(start); | 290 | mSelStart = startdate.daysTo(start); |
@@ -292,5 +293,11 @@ void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) | |||
292 | mSelEnd = startdate.daysTo(end); | 293 | mSelEnd = startdate.daysTo(end); |
293 | //qDebug("SELECTION %d %d ", mSelStart ,mSelEnd ); | 294 | if ( mSelEnd > NUMDAYS-1 ) |
294 | if ( mSelEnd < 0 ) | 295 | mSelEnd = NUMDAYS-1; |
296 | if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) { | ||
295 | clearSelection(); | 297 | clearSelection(); |
298 | if ( noSel ) | ||
299 | return false; | ||
300 | } | ||
301 | |||
302 | return true; | ||
296 | } | 303 | } |
@@ -701,2 +708,4 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
701 | endMo = 12; | 708 | endMo = 12; |
709 | if ( mo == 12 && startMo == 1 ) | ||
710 | startMo = 13; | ||
702 | if ( (startMo > mo || endMo < mo) ) { | 711 | if ( (startMo > mo || endMo < mo) ) { |
@@ -714,2 +723,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
714 | } | 723 | } |
724 | //qDebug("SKIP %d ", skip); | ||
715 | if ( ! skip ) { | 725 | if ( ! skip ) { |