summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
authorzautrix <zautrix>2005-03-22 12:05:42 (UTC)
committer zautrix <zautrix>2005-03-22 12:05:42 (UTC)
commit345c70e057e730850493689185b5c358607566f9 (patch) (unidiff)
tree5081ceed28a61012c1c4d2c7200205fdbedc6435 /korganizer/kodaymatrix.cpp
parentdfd7d8d53c7ab916dee820c2371195a5dce134a4 (diff)
downloadkdepimpi-345c70e057e730850493689185b5c358607566f9.zip
kdepimpi-345c70e057e730850493689185b5c358607566f9.tar.gz
kdepimpi-345c70e057e730850493689185b5c358607566f9.tar.bz2
more layout fixes
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp16
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
@@ -284,15 +284,22 @@ void KODayMatrix::addSelectedDaysTo(DateList& selDays)
284 } 284 }
285} 285}
286 286
287void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) 287bool 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}
297void KODayMatrix::clearSelection() 304void KODayMatrix::clearSelection()
298{ 305{
@@ -699,6 +706,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
699 startMo = 1; 706 startMo = 1;
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;
704 } else { 713 } else {
@@ -712,6 +721,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
712 } 721 }
713 } 722 }
714 } 723 }
724 //qDebug("SKIP %d ", skip);
715 if ( ! skip ) { 725 if ( ! skip ) {
716 row = mSelStartT/7; 726 row = mSelStartT/7;
717 col = mSelStartT -row*7; 727 col = mSelStartT -row*7;