summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index eb3791e..7e0b216 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1611,49 +1611,49 @@ void KOAgenda::computeSizes()
mGridSpacingX = (width() - verticalScrollBar()->width()-3)/mColumns;
if (height() > mGridSpacingY * mRows + 1 ) {
KOPrefs::instance()->mHourSize = ((height())/mRows)+1;
mGridSpacingY = KOPrefs::instance()->mHourSize ;
resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
emit resizedSignal();
} else
resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
KOAgendaItem *item;
int subCellWidth;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
subCellWidth = mGridSpacingX / item->subCells();
item->resize(subCellWidth,item->height());
moveChild(item,(KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - item->cellX()) * mGridSpacingX :
item->cellX() * mGridSpacingX) +
item->subCell() * subCellWidth,childY(item));
}
}
int cw = contentsWidth();
int ch = contentsHeight();
if ( mAllDayMode ) {
QPixmap* paintPixAll = KOAgendaItem::paintPixAllday();
- if ( paintPixAll->width() < cw || paintPixAll->height() < ch )
+ if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 )
paintPixAll->resize( cw, ch );
} else {
QPixmap* paintPix = KOAgendaItem::paintPix();
if ( paintPix->width() < cw || paintPix->height() < ch )
KOAgendaItem::resizePixmap( cw , ch );
}
checkScrollBoundaries();
marcus_bains();
drawContentsToPainter();
viewport()->repaint(false);
}
void KOAgenda::scrollUp()
{
scrollBy(0,-mScrollOffset);
}
void KOAgenda::scrollDown()
{
scrollBy(0,mScrollOffset);
}