summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2007-06-05 13:21:33 (UTC)
committer zautrix <zautrix>2007-06-05 13:21:33 (UTC)
commitd5c53970b9e12bfe774d1fecd603080aded24e09 (patch) (side-by-side diff)
treefca3c555b3e37302ebe1ee1840fa3e27502dcc50 /korganizer
parenta388f4f019ccf2b7c138a6814b44b9e8f2a5f570 (diff)
downloadkdepimpi-d5c53970b9e12bfe774d1fecd603080aded24e09.zip
kdepimpi-d5c53970b9e12bfe774d1fecd603080aded24e09.tar.gz
kdepimpi-d5c53970b9e12bfe774d1fecd603080aded24e09.tar.bz2
print fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index b378330..192f8c0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1403,12 +1403,13 @@ void KOListViewListView::printList()
QPrinter printer;
if (!printer.setup() )
return;
clearSelection ();
QPainter p;
p.begin ( &printer );
+ p.setFont(font());
QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
float dx, dy;
int wid = (m.width() * 9)/10;
dx = (float) wid/(float)contentsWidth ();
dy = (float)(m.height()) / (float)contentsHeight ();
float scale;
@@ -1429,10 +1430,29 @@ void KOListViewListView::printList()
for ( iii = 0; iii < cou; ++iii ) {
rect.setLeft ( header()->sectionPos( iii ) );
rect.setRight ( header()->sectionPos( iii ) + header()->sectionSize (iii));
header()->paintSection ( & p, header()->mapToIndex (iii), rect );
}
p.translate( 0, header()->height());
- drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () );
+ //drawContentsOffset ( &p, 0,0, 0,0, contentsWidth (), contentsHeight () );
+
+ const QColorGroup &cg = colorGroup();
+ KOListViewItem* item = (KOListViewItem* )firstChild();
+ int yOff = 0;
+ while ( item ) {
+ p.translate( 0, yOff );
+ p.save();
+ for ( iii = 0; iii < cou; ++iii ) {
+ int align = columnAlignment( iii );
+ if ( align == AlignAuto ) align = AlignLeft;
+ p.restore();
+ p.save();
+ p.translate( header()->sectionPos( iii ), 0);
+ item->paintCell( &p, cg, iii, header()->sectionSize (iii), align );
+ }
+ yOff = item->height();
+ item = (KOListViewItem* )(item->itemBelow());
+ p.restore();
+ }
p.end();
#endif
}