[Kst] extragear/graphics/kst/src/libkstapp
arwalker at sumusltd.com
arwalker at sumusltd.com
Fri Feb 16 20:57:11 CET 2007
Which is a non-const argument?
On Friday 16 February 2007 11:18, George Staikos wrote:
> That's still a non-const argument ;)
>
> On 16-Feb-07, at 2:15 PM, Andrew Walker wrote:
> > SVN commit 634274 by arwalker:
> >
> > address concern raised by George
> >
> > M +10 -9 kstviewwindow.cpp
> >
> >
> > --- trunk/extragear/graphics/kst/src/libkstapp/kstviewwindow.cpp
> > #634273:634274
> > @@ -316,6 +316,7 @@
> >
> > void KstViewWindow::print(KstPainter& paint, QSize& size, int
> > pages, int lineAdjust, bool monochrome, bool enhanceReadability,
> > bool datetimeFooter, bool maintainAspectRatio, int pointStyleOrder,
> > int lineStyleOrder, int lineWidthOrder, int maxLineWidth, int
> > pointDensity) {
> > KstTopLevelViewPtr tlv = kst_cast<KstTopLevelView>(view());
> > + QSize sizeNew = size;
> >
> > if (tlv) {
> > if (lineAdjust != 0) {
> > @@ -336,27 +337,27 @@
> > if (datetimeFooter) {
> > QDateTime dateTime = QDateTime::currentDateTime();
> > QString title = i18n("Page: %1 Name: %2 Date: %3").arg
> > (pages).arg(caption()).arg(dateTime.toString(Qt::ISODate));
> > - QRect rect(0, 0, size.width(), size.height());
> > + QRect rect(0, 0, sizeNew.width(), sizeNew.height());
> > QRect rectBounding;
> > -
> > +
> > rectBounding = paint.boundingRect(rect, Qt::AlignLeft |
> > Qt::AlignVCenter, title);
> > - rect.setTop(size.height() - (2 * rectBounding.height()));
> > + rect.setTop(sizeNew.height() - (2 * rectBounding.height()));
> > paint.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, title);
> > - size.setHeight(rect.top());
> > + sizeNew.setHeight(rect.top());
> > }
> > -
> > +
> > if (maintainAspectRatio) {
> > const QRect geom(view()->geometry());
> > const double ratioWindow = double(geom.width()) / double
> > (geom.height());
> > - const double ratioPrinter = double(size.width()) / double
> > (size.height());
> > + const double ratioPrinter = double(sizeNew.width()) / double
> > (sizeNew.height());
> > if (ratioWindow > ratioPrinter) {
> > - size.setHeight(int(double(size.width()) / ratioWindow));
> > + sizeNew.setHeight(int(double(sizeNew.width()) /
> > ratioWindow));
> > } else if (ratioWindow < ratioPrinter) {
> > - size.setWidth(int(ratioWindow * double(size.height())));
> > + sizeNew.setWidth(int(ratioWindow * double(sizeNew.height
> > ())));
> > }
> > }
> >
> > - view()->resizeForPrint(size);
> > + view()->resizeForPrint(sizeNew);
> > view()->paint(paint, QRegion());
> >
> > if (lineAdjust != 0) {
> > _______________________________________________
> > Kst mailing list
> > Kst at kde.org
> > https://mail.kde.org/mailman/listinfo/kst
>
> --
> George Staikos
> KDE Developer http://www.kde.org/
> Staikos Computing Services Inc. http://www.staikos.net/
>
>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
More information about the Kst
mailing list