author | zautrix <zautrix> | 2005-03-22 12:05:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 12:05:42 (UTC) |
commit | 345c70e057e730850493689185b5c358607566f9 (patch) (unidiff) | |
tree | 5081ceed28a61012c1c4d2c7200205fdbedc6435 /korganizer/kodaymatrix.cpp | |
parent | dfd7d8d53c7ab916dee820c2371195a5dce134a4 (diff) | |
download | kdepimpi-345c70e057e730850493689185b5c358607566f9.zip kdepimpi-345c70e057e730850493689185b5c358607566f9.tar.gz kdepimpi-345c70e057e730850493689185b5c358607566f9.tar.bz2 |
more layout fixes
-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 | |||
@@ -285,13 +285,20 @@ void KODayMatrix::addSelectedDaysTo(DateList& selDays) | |||
285 | } | 285 | } |
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); |
290 | if ( mSelStart < 0 ) | 291 | if ( mSelStart < 0 ) |
291 | mSelStart = 0; | 292 | mSelStart = 0; |
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 | } |
297 | void KODayMatrix::clearSelection() | 304 | void KODayMatrix::clearSelection() |
@@ -700,4 +707,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
700 | if ( endMo == 1 && mo == 12 ) | 707 | if ( endMo == 1 && mo == 12 ) |
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) ) { |
703 | skip = true; | 712 | skip = true; |
@@ -713,4 +722,5 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
713 | } | 722 | } |
714 | } | 723 | } |
724 | //qDebug("SKIP %d ", skip); | ||
715 | if ( ! skip ) { | 725 | if ( ! skip ) { |
716 | row = mSelStartT/7; | 726 | row = mSelStartT/7; |