Commit e4ccb1c3 authored by Thomas Zander's avatar Thomas Zander
Browse files

Alter API to pass by reference instead of deep-copy

svn path=/trunk/koffice/; revision=545145
parent d1728b39
......@@ -23,8 +23,6 @@
#include <QPointF>
#include <QRectF>
#include <koffice_export.h>
/**
* The interface for view conversions.
* All KoShape based objects are using a postscript-point (pt) based measurement system
......@@ -32,7 +30,7 @@
* we are painting, and a conversion to the normalized coordinate system if we
* receive mouse events so we can figure out which KoShape object was touched.
*/
class FLAKE_EXPORT KoViewConverter {
class KoViewConverter {
public:
KoViewConverter() {};
virtual ~KoViewConverter() {};
......@@ -41,25 +39,25 @@ public:
* Convert a coordinate in pt to pixels.
* @param normalPoint the point in the normal coordinate system of a KoShape.
*/
virtual QPointF normalToView( const QPointF normalPoint ) = 0;
virtual QPointF normalToView( const QPointF &normalPoint ) = 0;
/**
* Convert a coordinate in pixels to pt.
* @param viewPoint the point in the coordinate system of the widget, or window.
*/
virtual QPointF viewToNormal( const QPointF viewPoint ) = 0;
virtual QPointF viewToNormal( const QPointF &viewPoint ) = 0;
/**
* Convert a rectangle in pt to pixels.
* @param normalRect the rect in the normal coordinate system of a KoShape.
*/
virtual QRectF normalToView( const QRectF normalRect ) = 0;
virtual QRectF normalToView( const QRectF &normalRect ) = 0;
/**
* Convert a rectangle in pixels to pt.
* @param viewRect the rect in the coordinate system of the widget, or window.
*/
virtual QRectF viewToNormal( const QRectF viewRect ) = 0;
virtual QRectF viewToNormal( const QRectF &viewRect ) = 0;
/**
* set the zoom levels of the individual x and y axis to the pointer paramets.
......
......@@ -72,22 +72,22 @@ void KoZoomHandler::setZoom( int zoom )
}
}
QPointF KoZoomHandler::normalToView( const QPointF normalPoint ) {
QPointF KoZoomHandler::normalToView( const QPointF &normalPoint ) {
return QPointF( zoomItX( normalPoint.x() ), zoomItY( normalPoint.y() ) );
}
QPointF KoZoomHandler::viewToNormal( const QPointF viewPoint ) {
QPointF KoZoomHandler::viewToNormal( const QPointF &viewPoint ) {
return QPointF( unzoomItX( viewPoint.x() ), unzoomItY( viewPoint.y() ) );
}
QRectF KoZoomHandler::normalToView( const QRectF normalRect ) {
QRectF KoZoomHandler::normalToView( const QRectF &normalRect ) {
QRectF r;
r.setCoords( zoomItX( normalRect.left() ), zoomItY( normalRect.top() ),
zoomItX( normalRect.right() ), zoomItY( normalRect.bottom() ) );
return r;
}
QRectF KoZoomHandler::viewToNormal( const QRectF viewRect ) {
QRectF KoZoomHandler::viewToNormal( const QRectF &viewRect ) {
QRectF r;
r.setCoords( unzoomItX( viewRect.left() ), unzoomItY( viewRect.top() ),
unzoomItX( viewRect.right() ), unzoomItY( viewRect.bottom() ) );
......
......@@ -168,25 +168,25 @@ public:
* Convert a coordinate in pt to pixels.
* @param normalPoint the point in the normal coordinate system of a KoShape.
*/
QPointF normalToView( const QPointF normalPoint );
QPointF normalToView( const QPointF &normalPoint );
/**
* Convert a coordinate in pixels to pt.
* @param viewPoint the point in the coordinate system of the widget, or window.
*/
QPointF viewToNormal( const QPointF viewPoint );
QPointF viewToNormal( const QPointF &viewPoint );
/**
* Convert a rectangle in pt to pixels.
* @param normalRect the rect in the normal coordinate system of a KoShape.
*/
QRectF normalToView( const QRectF normalRect );
QRectF normalToView( const QRectF &normalRect );
/**
* Convert a rectangle in pixels to pt.
* @param viewRect the rect in the coordinate system of the widget, or window.
*/
QRectF viewToNormal( const QRectF viewRect );
QRectF viewToNormal( const QRectF &viewRect );
/**
* set the zoom levels of the individual x and y axis to the pointer paramets.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment