[Uml-devel] [Patch] printer border problem

Ralf Habacker ralf.habacker at freenet.de
Mon Nov 28 14:14:35 UTC 2011


in UMLView::print(QPrinter *pPrinter, QPainter & pPainter) there is a 
wrong border calculation, which is fixed by the appended patch.

Some details:  In the above mentioned method calculates border from 
QPrinters settings

 >    uint left, right, top, bottom;
     QRect paper = pPrinter->paperRect();
     QRect page  = pPrinter->pageRect();
 >    top = paper.top() - page.top();
 >    left = paper.left() - page.left();
     bottom = paper.bottom() - page.bottom();
     right = paper.right() - page.right();

      QPrinters doc says about

      "QRect <http://doc.qt.nokia.com/4.7-snapshot/qrect.html>
      QPrinter::paperRect () const

Returns the paper's rectangle; this is usually larger than the pageRect 

this means that in the above mentioned line

     top = paper.top() - page.top();

top will be a very high positive value (tested on windows with msvc) if 
paper.top() is smaller than page.top() which is usual the default.

If there are no objectives, i would commit this patch.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20111128/c013baf9/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: printer-borders.patch
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20111128/c013baf9/attachment.ksh>

More information about the umbrello-devel mailing list