[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Sep 2 14:27:37 UTC 2006
SVN commit 580058 by okellogg:
print(): Apply SwapMarginsForLandscapePrint.diff by Achim Spangler, see
http://www.geeksoc.org/~jr/umbrello/uml-devel/9726.html
M +10 -2 umlview.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlview.cpp #580057:580058
@@ -237,6 +237,15 @@
int marginX = pPrinter->margins().width();
int marginY = pPrinter->margins().height();
+ if(pPrinter->orientation() == KPrinter::Landscape) {
+ // we are printing in LANDSCAPE --> swap marginX and marginY
+ // this is needed, as KPrinter reports width margin strictly as printer
+ // default orientation margin - and not depend on LANDSCAPE/PORTRAIT
+ int temp = marginX;
+ marginX = marginY;
+ marginY = temp;
+ }
+
// The printer will probably use a different font with different font metrics,
// force the widgets to update accordingly on paint
forceUpdateWidgetFontMetrics(&pPainter);
@@ -247,7 +256,6 @@
width = metrics.width() - marginX * 2;
height = metrics.height() - fontHeight - 4 - marginY * 3;
} else {
- marginX *= 2;
width = metrics.width() - marginX * 2;
height = metrics.height() - fontHeight - 4 - marginY * 2;
}
@@ -962,7 +970,7 @@
// for(temp=(UMLWidget *)m_SelectedList.first();temp;temp=(UMLWidget *)m_SelectedList.next())
// if(temp != w)
// temp -> mouseMoveEvent(&me);
-//
+//
// // Move any selected associations.
// AssociationWidgetListIt assoc_it( m_AssociationList );
// AssociationWidget* assocwidget = NULL;
More information about the umbrello-devel
mailing list