summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 49ad9b8..7a685d8 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -643,33 +643,51 @@ void KOAgendaItem::resizeEvent ( QResizeEvent *ev )
repaint( false );
}
/*
Return height of item in units of agenda cells
*/
int KOAgendaItem::cellHeight()
{
int ret = mCellYBottom - mCellYTop + 1;
if ( ret <= 0 ) {
ret = 1;
mCellYBottom = 0;
mCellYTop = 0;
}
return ret;
}
-
+// it may be that allday agenda items have a needed width > 32000
+// this code is to fix this problem
+int KOAgendaItem::resizeMe( int grid, int wid, int hei )
+{
+ int diff = 0;
+ if ( mCellX < -3 && mAllDay ) {
+ diff = (mCellX + 3) * -grid;
+ //qDebug("%s: cellX %d diff %d wid %d grid %d ", mDisplayedText.latin1(), mCellX, diff, wid, grid);
+ if ( diff >= wid ) {
+ // qDebug("KOAgendaItem::resizeMe: diff >= wid: diff %d wid %d ", diff, wid);
+ //diff = 0;
+ }
+ }
+ if ( wid == width() || diff >= wid )
+ resize( wid, hei );
+ else
+ resize( wid - diff, hei );
+ return diff;
+}
/*
Return height of item in units of agenda cells
*/
int KOAgendaItem::cellWidth()
{
return mCellXWidth - mCellX + 1;
}
void KOAgendaItem::setItemDate(QDate qd)
{
mDate = qd;
}
void KOAgendaItem::setCellXY(int X, int YTop, int YBottom)
{
mCellX = X;