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) (side-by-side diff)
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)
}
}
-void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
+bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
{
+ bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION );
mSelStart = startdate.daysTo(start);
if ( mSelStart < 0 )
mSelStart = 0;
mSelEnd = startdate.daysTo(end);
- //qDebug("SELECTION %d %d ", mSelStart ,mSelEnd );
- if ( mSelEnd < 0 )
+ if ( mSelEnd > NUMDAYS-1 )
+ mSelEnd = NUMDAYS-1;
+ if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) {
clearSelection();
+ if ( noSel )
+ return false;
+ }
+
+ return true;
}
void KODayMatrix::clearSelection()
{
@@ -699,6 +706,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
startMo = 1;
if ( endMo == 1 && mo == 12 )
endMo = 12;
+ if ( mo == 12 && startMo == 1 )
+ startMo = 13;
if ( (startMo > mo || endMo < mo) ) {
skip = true;
} else {
@@ -712,6 +721,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
}
}
}
+ //qDebug("SKIP %d ", skip);
if ( ! skip ) {
row = mSelStartT/7;
col = mSelStartT -row*7;