--===============1053947167== Content-Type: multipart/signed; boundary="nextPart1783861.pd8fBGkYIr"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1783861.pd8fBGkYIr Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday, 31. May 2008 14:26:41 Thomas Zander wrote: > On Saturday 31. May 2008 12:00:15 Stefan Nikolaus wrote: > > Okay, one more thing: the painter saving/restoring looks odd. I do not > > understand that behavior. Attached my proposal how it should work. > > The odd thing is that we have hooks and thus have to save / restore in > different methods. > Taking into account stopping and restarting. Restarting? I can only see stopping. > Your patch would break saving/restoring around the preparePage call. So > this 'weirdness' has to be kept I'm afraid. I've modified the patch a bit and commited some time ago. Is that patch oka= y?=20 After one page was prepared and printed it returns to the same painter stat= e.=20 This was not done before. SVN commit 814840 by nikolaus: Paint the shapes after KoPrintDialog::printPage(int, QPainter&) has been=20 called. Save the painter states before and after page preparation and restore them= =20 appropriately. M +8 -10 KoPrintingDialog.cpp =20 =2D-- trunk/koffice/libs/guiutils/KoPrintingDialog.cpp #814839:814840 @@ -67,19 +67,16 @@ void preparePage(const QVariant &page) { const int pageNumber =3D page.toInt(); KoUpdater updater =3D updaters.at(index-1); =2D const bool doSave =3D painter =3D=3D 0; =2D if (painter) =2D painter->save(); + if (!painter) + painter =3D new QPainter(printer); + painter->save(); // state before page preparation if(! stop) parent->preparePage(pageNumber); updater.setProgress(45); if (index > 1) printer->newPage(); updater.setProgress(55); =2D if (painter =3D=3D 0) =2D painter =3D new QPainter(printer); =2D if (doSave) =2D painter->save(); // make sure we saved to match the restore = later=20 on. + painter->save(); // state after page preparation =20 QList shapes =3D parent->shapesOnPage(pageNumber); if (shapes.isEmpty()) { @@ -107,12 +104,13 @@ } =20 void printPage(const QVariant &page) { =2D if(! stop) =2D shapeManager->paint( *painter, zoomer, true ); =2D painter->restore(); // matching the one in preparePage above + painter->restore(); // state after page preparation painter->save(); parent->printPage(page.toInt(), *painter); painter->restore(); + if (!stop) + shapeManager->paint(*painter, zoomer, true); + painter->restore(); // state before page preparation =20 if(!stop && index < pages.count()) { pageNumber->setText(i18n("Printing page %1",=20 QString::number(pages[index]))); =2D-=20 Regards, Stefan --nextPart1783861.pd8fBGkYIr Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQBIQUm2pfDn2DABIpcRAogFAJ0RcB/tdkgZOsoEZ5sIQExiuw2rMACcDOoB 9CX+n3uGbH33sZgVsakCfz8= =9Exj -----END PGP SIGNATURE----- --nextPart1783861.pd8fBGkYIr-- --===============1053947167== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel --===============1053947167==--