-rw-r--r-- | korganizer/koagenda.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index e8b7c94..8c2996b 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1995,25 +1995,25 @@ void KOAgenda::printSelection() | |||
1995 | y = mGridSpacingY*mStartCellY; | 1995 | y = mGridSpacingY*mStartCellY; |
1996 | h = mGridSpacingY*(mCurrentCellY+1)-y+2; | 1996 | h = mGridSpacingY*(mCurrentCellY+1)-y+2; |
1997 | 1997 | ||
1998 | //return; | 1998 | //return; |
1999 | QPrinter* printer = new QPrinter(); | 1999 | QPrinter* printer = new QPrinter(); |
2000 | if ( !printer->setup()) { | 2000 | if ( !printer->setup()) { |
2001 | delete printer; | 2001 | delete printer; |
2002 | return; | 2002 | return; |
2003 | } | 2003 | } |
2004 | QPainter p( printer ); | 2004 | QPainter p( printer ); |
2005 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); | 2005 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); |
2006 | QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); | 2006 | QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); |
2007 | date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); | 2007 | //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); |
2008 | int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); | 2008 | int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); |
2009 | // p.drawText( 0, 0, date ); | 2009 | // p.drawText( 0, 0, date ); |
2010 | int offset = m.width()/8; | 2010 | int offset = m.width()/8; |
2011 | // compute the scale | 2011 | // compute the scale |
2012 | dx = ((float) m.width()-offset) / (float)w; | 2012 | dx = ((float) m.width()-offset) / (float)w; |
2013 | dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h; | 2013 | dy = (float)(m.height() - ( 2 * hei )-offset ) / (float)h; |
2014 | float scale; | 2014 | float scale; |
2015 | // scale to fit the width or height of the paper | 2015 | // scale to fit the width or height of the paper |
2016 | if ( dx < dy ) | 2016 | if ( dx < dy ) |
2017 | scale = dx; | 2017 | scale = dx; |
2018 | else | 2018 | else |
2019 | scale = dy; | 2019 | scale = dy; |