[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [PATCH] 2nd attempt: Krazy KHTML inappropriate pass-by-value function
From:       Jeff Anderson <jander99.dev () gmail ! com>
Date:       2007-08-19 17:25:01
Message-ID: 46C87CED.4020209 () gmail ! com
[Download RAW message or body]

This time it compiles. :)

Changes to section 18 of the Krazy checker.
http://www.englishbreakfastnetwork.org/krazy/reports/kde-4.0/kdelibs/khtml/index.html


["krazy-khtml-pass-by-reference.patch" (text/x-patch)]

Index: khtml/khtmlview.cpp
===================================================================
--- khtml/khtmlview.cpp	(revision 701768)
+++ khtml/khtmlview.cpp	(working copy)
@@ -1139,7 +1139,7 @@
     d->clickCount = 0;
 }
 
-static bool targetOpensNewWindow(KHTMLPart *part, QString target)
+static bool targetOpensNewWindow(KHTMLPart *part, const QString& target)
 {
     if (!target.isEmpty() && (target.toLower() != "_top") &&
        (target.toLower() != "_self") && (target.toLower() != "_parent")) {
Index: khtml/misc/paintbuffer.cpp
===================================================================
--- khtml/misc/paintbuffer.cpp	(revision 701768)
+++ khtml/misc/paintbuffer.cpp	(working copy)
@@ -45,7 +45,7 @@
     delete m_inst;
 }
 
-QPixmap *PaintBuffer::grab( QSize s ) 
+QPixmap *PaintBuffer::grab( const QSize& s ) 
 {
     if (!m_inst)
         m_inst = new PaintBuffer;
@@ -68,7 +68,7 @@
     m_timer = 0;
 }
 
-QPixmap *PaintBuffer::getBuf( QSize s )
+QPixmap *PaintBuffer::getBuf( const QSize& s )
 {
     assert( !m_grabbed );
     if (s.isEmpty())
Index: khtml/misc/paintbuffer.h
===================================================================
--- khtml/misc/paintbuffer.h	(revision 701768)
+++ khtml/misc/paintbuffer.h	(working copy)
@@ -43,7 +43,7 @@
     static const int maxPixelBuffering;
     static const int leaseTime;
     
-    static QPixmap* grab( QSize s = QSize() );
+    static QPixmap* grab( const QSize& s = QSize() );
     static void release();
     
     static void cleanup();
@@ -52,7 +52,7 @@
     virtual void timerEvent(QTimerEvent* e);
     
 private:
-    QPixmap* getBuf( QSize S );
+    QPixmap* getBuf( const QSize& S );
 
     static PaintBuffer* m_inst;
     QPixmap m_buf;
Index: khtml/test_regression_fontoverload.cpp
===================================================================
--- khtml/test_regression_fontoverload.cpp	(revision 701768)
+++ khtml/test_regression_fontoverload.cpp	(working copy)
@@ -160,7 +160,7 @@
     {0, 0, 0, 0}
 };
 
-static MetricsInfo* grabMetrics(QString name)
+static MetricsInfo* grabMetrics(const QString& name)
 {
     for (int pos = 0; compatMetrics[pos].name; ++pos)
         if (name == QLatin1String(compatMetrics[pos].name))
Index: khtml/ecma/debugger/debugwindow.cpp
===================================================================
--- khtml/ecma/debugger/debugwindow.cpp	(revision 701768)
+++ khtml/ecma/debugger/debugwindow.cpp	(working copy)
@@ -103,7 +103,7 @@
 
 // ----------------------------------------------
 
-void DebugWindow::setNextSourceInfo(QString url, int baseLine)
+void DebugWindow::setNextSourceInfo(const QString& url, int baseLine)
 {
     m_nextUrl = url;
     m_nextBaseLine = baseLine;
Index: khtml/ecma/debugger/debugwindow.h
===================================================================
--- khtml/ecma/debugger/debugwindow.h	(revision 701768)
+++ khtml/ecma/debugger/debugwindow.h	(working copy)
@@ -87,7 +87,7 @@
     static void destroyInstance();
     static DebugWindow *window();
 
-    void setNextSourceInfo(QString url, int baseLine);
+    void setNextSourceInfo(const QString& url, int baseLine);
 
 public:
     bool sourceParsed(ExecState *exec, int sourceId, const UString &sourceURL,
Index: khtml/ecma/kjs_debugwin.h
===================================================================
--- khtml/ecma/kjs_debugwin.h	(revision 701768)
+++ khtml/ecma/kjs_debugwin.h	(working copy)
@@ -180,8 +180,8 @@
     };
 
     void setSourceLine(int sourceId, int lineno);
-    void setNextSourceInfo(QString url, int baseLine);
-    void sourceChanged(Interpreter *interpreter, QString url);
+    void setNextSourceInfo(const QString& url, int baseLine);
+    void sourceChanged(Interpreter *interpreter, const QString& url);
     bool inSession() const { return !m_execStates.isEmpty(); }
     void setMode(Mode m) { m_mode = m; }
     void clearInterpreter(Interpreter *interpreter);
@@ -216,9 +216,9 @@
 
   private:
 
-    SourceFile *getSourceFile(Interpreter *interpreter, QString url);
-    void setSourceFile(Interpreter *interpreter, QString url, SourceFile \
                *sourceFile);
-    void removeSourceFile(Interpreter *interpreter, QString url);
+    SourceFile *getSourceFile(Interpreter *interpreter, const QString& url);
+    void setSourceFile(Interpreter *interpreter, const QString& url, SourceFile \
*sourceFile); +    void removeSourceFile(Interpreter *interpreter, const QString& \
url);  
     void checkBreak(ExecState *exec);
     void enterSession(ExecState *exec);
Index: khtml/ecma/kjs_window.h
===================================================================
--- khtml/ecma/kjs_window.h	(revision 701768)
+++ khtml/ecma/kjs_window.h	(working copy)
@@ -243,7 +243,7 @@
   class ScheduledAction {
   public:
     ScheduledAction(ObjectImp* _func, List _args, DateTimeMS _nextTime, int \
                _interval, bool _singleShot, int _timerId);
-    ScheduledAction(QString _code, DateTimeMS _nextTime, int _interval, bool \
_singleShot, int _timerId); +    ScheduledAction(const QString& _code, DateTimeMS \
_nextTime, int _interval, bool _singleShot, int _timerId);  ~ScheduledAction();
     bool execute(Window *window);
     void mark();
Index: khtml/ecma/kjs_proxy.h
===================================================================
--- khtml/ecma/kjs_proxy.h	(revision 701768)
+++ khtml/ecma/kjs_proxy.h	(working copy)
@@ -55,10 +55,10 @@
 public:
   KJSProxy() { m_handlerLineno = 0; }
   virtual ~KJSProxy() { }
-  virtual QVariant evaluate(QString filename, int baseLine, const QString &, const \
DOM::Node &n, +  virtual QVariant evaluate(QString filename, int baseLine, const \
QString& str, const DOM::Node &n,  KJS::Completion *completion = 0) = 0;
   virtual void clear() = 0;
-  virtual DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString \
name, QString code, DOM::NodeImpl* node) = 0; +  virtual DOM::EventListener \
*createHTMLEventHandler(const QString& sourceUrl, const QString& name, const QString& \
code, DOM::NodeImpl* node) = 0;  virtual void finishedWithEvent(const DOM::Event \
&event) = 0;  virtual KJS::Interpreter *interpreter() = 0;
 
Index: khtml/ecma/kjs_debugwin.cpp
===================================================================
--- khtml/ecma/kjs_debugwin.cpp	(revision 701768)
+++ khtml/ecma/kjs_debugwin.cpp	(working copy)
@@ -966,13 +966,13 @@
   m_sourceDisplay->setCurrentLine(source->baseLine+lineno-2);
 }
 
-void KJSDebugWin::setNextSourceInfo(QString url, int baseLine)
+void KJSDebugWin::setNextSourceInfo(const QString& url, int baseLine)
 {
   m_nextSourceUrl = url;
   m_nextSourceBaseLine = baseLine;
 }
 
-void KJSDebugWin::sourceChanged(Interpreter *interpreter, QString url)
+void KJSDebugWin::sourceChanged(Interpreter *interpreter, const QString& url)
 {
   SourceFile *sourceFile = getSourceFile(interpreter,url);
   if (sourceFile && m_curSourceFile == sourceFile)
@@ -988,13 +988,13 @@
       it.value()->sourceFile->interpreter = 0;
 }
 
-SourceFile *KJSDebugWin::getSourceFile(Interpreter *interpreter, QString url)
+SourceFile *KJSDebugWin::getSourceFile(Interpreter *interpreter, const QString &url)
 {
   QString key = QString("%1|%2").arg((long)interpreter).arg(url);
   return m_sourceFiles[key];
 }
 
-void KJSDebugWin::setSourceFile(Interpreter *interpreter, QString url, SourceFile \
*sourceFile) +void KJSDebugWin::setSourceFile(Interpreter *interpreter, const \
QString& url, SourceFile *sourceFile)  {
   QString key = QString("%1|%2").arg((long)interpreter).arg(url);
   sourceFile->ref();
@@ -1003,7 +1003,7 @@
   m_sourceFiles[key] = sourceFile;
 }
 
-void KJSDebugWin::removeSourceFile(Interpreter *interpreter, QString url)
+void KJSDebugWin::removeSourceFile(Interpreter *interpreter, const QString& url)
 {
   QString key = QString("%1|%2").arg((long)interpreter).arg(url);
   if (SourceFile* oldFile = m_sourceFiles[key])
Index: khtml/ecma/kjs_window.cpp
===================================================================
--- khtml/ecma/kjs_window.cpp	(revision 701768)
+++ khtml/ecma/kjs_window.cpp	(working copy)
@@ -2101,7 +2101,7 @@
 }
 
 // KDE 4: Make it const QString &
-ScheduledAction::ScheduledAction(QString _code, DateTimeMS _nextTime, int _interval, \
bool _singleShot, int _timerId) +ScheduledAction::ScheduledAction(const QString& \
_code, DateTimeMS _nextTime, int _interval, bool _singleShot, int _timerId)  {
   //kDebug(6070) << "ScheduledAction::ScheduledAction(!isFunction) " << this;
   //func = 0;
Index: khtml/ecma/kjs_proxy.cpp
===================================================================
--- khtml/ecma/kjs_proxy.cpp	(revision 701768)
+++ khtml/ecma/kjs_proxy.cpp	(working copy)
@@ -54,7 +54,7 @@
   virtual QVariant evaluate(QString filename, int baseLine, const QString &, const \
DOM::Node &n,  Completion *completion = 0);
   virtual void clear();
-  virtual DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString \
name, QString code, DOM::NodeImpl *node); +  virtual DOM::EventListener \
*createHTMLEventHandler(const QString& sourceUrl, const QString& name, const QString& \
code, DOM::NodeImpl *node);  virtual void finishedWithEvent(const DOM::Event &event);
   virtual KJS::Interpreter *interpreter();
 
@@ -125,7 +125,7 @@
 }
 
 QVariant KJSProxyImpl::evaluate(QString filename, int baseLine,
-                                const QString&str, const DOM::Node &n, Completion \
*completion) { +                                const QString& str, const DOM::Node \
&n, Completion *completion) {  // evaluate code. Returns the JS return value or an \
invalid QVariant  // if there was none, an error occurred or the type couldn't be \
converted.  
@@ -240,7 +240,7 @@
   }
 }
 
-DOM::EventListener *KJSProxyImpl::createHTMLEventHandler(QString sourceUrl, QString \
name, QString code, DOM::NodeImpl *node) +DOM::EventListener \
*KJSProxyImpl::createHTMLEventHandler(const QString& sourceUrl, const QString& name, \
const QString& code, DOM::NodeImpl *node)  {
   initScript();
 
Index: khtml/rendering/font.h
===================================================================
--- khtml/rendering/font.h	(revision 701768)
+++ khtml/rendering/font.h	(working copy)
@@ -109,7 +109,7 @@
      * @param deco combined text decoration (see Decoration)
      */
     void drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int \
                len, int width,
-                   Qt::LayoutDirection d, int from=-1, int to=-1, QColor \
bg=QColor(), +                   Qt::LayoutDirection d, int from=-1, int to=-1, const \
QColor& bg=QColor(),  int uy=-1, int h=-1, int deco=0 ) const;
 
     /** returns the width of the given string chunk in pixels.
Index: khtml/rendering/render_replaced.h
===================================================================
--- khtml/rendering/render_replaced.h	(revision 701768)
+++ khtml/rendering/render_replaced.h	(working copy)
@@ -119,7 +119,7 @@
 
 protected:
     virtual void paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty);
-    virtual void paintBackground(QPainter *p, const QColor& c, const \
BackgroundLayer* bgLayer, QRect clipr, int _tx, int _ty, int w, int height); +    \
virtual void paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* \
bgLayer, const QRect& clipr, int _tx, int _ty, int w, int height);  
     virtual bool canHaveBorder() const { return false; }
     bool shouldPaintBorder() const { 
Index: khtml/rendering/render_line.cpp
===================================================================
--- khtml/rendering/render_line.cpp	(revision 701768)
+++ khtml/rendering/render_line.cpp	(working copy)
@@ -687,7 +687,7 @@
 
 
 void InlineFlowBox::paintBackgrounds(QPainter* p, const QColor& c, const \
                BackgroundLayer* bgLayer,
-                                     QRect clipr, int _tx, int _ty, int w, int h)
+                                     const QRect& clipr, int _tx, int _ty, int w, \
int h)  {
     if (!bgLayer)
         return;
@@ -696,7 +696,7 @@
 }
 
 void InlineFlowBox::paintBackground(QPainter* p, const QColor& c, const \
                BackgroundLayer* bgLayer,
-                                    QRect clipr, int _tx, int _ty, int w, int h)
+                                    const QRect& clipr, int _tx, int _ty, int w, int \
h)  {
     CachedImage* bg = bgLayer->backgroundImage();
     bool hasBackgroundImage = bg && bg->isComplete() && 
Index: khtml/rendering/render_box.h
===================================================================
--- khtml/rendering/render_box.h	(revision 701768)
+++ khtml/rendering/render_box.h	(working copy)
@@ -145,10 +145,10 @@
     virtual void paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty);
     void paintRootBoxDecorations( PaintInfo& paintInfo, int _tx, int _ty);
 
-    void paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* \
                bgLayer, QRect clipr, int _tx, int _ty, int w, int h);
-    virtual void paintBackground(QPainter *p, const QColor& c, const \
BackgroundLayer* bgLayer, QRect clipr, int _tx, int _ty, int w, int h); +    void \
paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, const \
QRect& clipr, int _tx, int _ty, int w, int h); +    virtual void \
paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, const \
                QRect& clipr, int _tx, int _ty, int w, int h);
     virtual void paintBackgroundExtended(QPainter* /*p*/, const QColor& /*c*/, const \
                BackgroundLayer* /*bgLayer*/,
-                                         QRect clipr, int /*_tx*/, int /*_ty*/,
+                                         const QRect& clipr, int /*_tx*/, int \
                /*_ty*/,
                                          int /*w*/, int /*height*/, int /*bleft*/, \
                int /*bright*/, int /*pleft*/, int /*pright*/,
                                          int /*btop*/, int /*bbottom*/, int \
                /*ptop*/, int /*pbottom*/ );
     void outlineBox(QPainter *p, int _tx, int _ty, const char *color = "red");
Index: khtml/rendering/font.cpp
===================================================================
--- khtml/rendering/font.cpp	(revision 701768)
+++ khtml/rendering/font.cpp	(working copy)
@@ -109,7 +109,7 @@
 }
 
 void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int \
                len,
-        int toAdd, Qt::LayoutDirection d, int from, int to, QColor bg, int uy, int \
h, int deco ) const +        int toAdd, Qt::LayoutDirection d, int from, int to, \
const QColor& bg, int uy, int h, int deco ) const  {
     if (!str) return;
     QString qstr = QString::fromRawData(str, slen);
Index: khtml/rendering/render_replaced.cpp
===================================================================
--- khtml/rendering/render_replaced.cpp	(revision 701768)
+++ khtml/rendering/render_replaced.cpp	(working copy)
@@ -416,7 +416,7 @@
     RenderReplaced::updateFromElement();
 }
 
-void RenderWidget::paintBackground(QPainter *p, const QColor& c, const \
BackgroundLayer* bgLayer, QRect clipr, int _tx, int _ty, int w, int height) +void \
RenderWidget::paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* \
bgLayer, const QRect& clipr, int _tx, int _ty, int w, int height)  {
     bool fudge = !shouldPaintBorder();
     paintBackgroundExtended(p, c, bgLayer, clipr, _tx, _ty, w, height,
Index: khtml/rendering/render_box.cpp
===================================================================
--- khtml/rendering/render_box.cpp	(revision 701768)
+++ khtml/rendering/render_box.cpp	(working copy)
@@ -408,14 +408,14 @@
     }
 }
 
-void RenderBox::paintBackgrounds(QPainter *p, const QColor& c, const \
BackgroundLayer* bgLayer, QRect clipr, int _tx, int _ty, int w, int height) +void \
RenderBox::paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* \
bgLayer, const QRect& clipr, int _tx, int _ty, int w, int height)  {
     if (!bgLayer) return;
     paintBackgrounds(p, c, bgLayer->next(), clipr, _tx, _ty, w, height);
     paintBackground(p, c, bgLayer, clipr, _tx, _ty, w, height);
 }
 
-void RenderBox::paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* \
bgLayer, QRect clipr, int _tx, int _ty, int w, int height) +void \
RenderBox::paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* \
bgLayer, const QRect& clipr, int _tx, int _ty, int w, int height)  {
     paintBackgroundExtended(p, c, bgLayer, clipr, _tx, _ty, w, height,
                             borderLeft(), borderRight(), paddingLeft(), \
paddingRight(),  @@ -468,7 +468,7 @@
     }
 }
 
-void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const \
BackgroundLayer* bgLayer, QRect clipr, +void \
RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const \
BackgroundLayer* bgLayer, const QRect& clipr,  int _tx, int _ty, int w, int h,
                                         int bleft, int bright, int pleft, int \
pright, int btop, int bbottom, int ptop, int pbottom)  {
Index: khtml/rendering/render_line.h
===================================================================
--- khtml/rendering/render_line.h	(revision 701768)
+++ khtml/rendering/render_line.h	(working copy)
@@ -209,9 +209,9 @@
     void removeFromLine(InlineBox* child);
     virtual void paintBackgroundAndBorder(RenderObject::PaintInfo&, int _tx, int \
                _ty);
     void paintBackgrounds(QPainter* p, const QColor& c, const BackgroundLayer* \
                bgLayer,
-                          QRect clipr, int _tx, int _ty, int w, int h);
+                          const QRect& clipr, int _tx, int _ty, int w, int h);
     void paintBackground(QPainter* p, const QColor& c, const BackgroundLayer* \
                bgLayer,
-                         QRect clipr, int _tx, int _ty, int w, int h);
+                         const QRect& clipr, int _tx, int _ty, int w, int h);
     virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty);
     virtual void paintDecorations(RenderObject::PaintInfo&, int _tx, int _ty, bool \
                paintedChildren = false);
     virtual bool nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, int \
                ty);
Index: khtml/java/kjavaapplet.cpp
===================================================================
--- khtml/java/kjavaapplet.cpp	(revision 701768)
+++ khtml/java/kjavaapplet.cpp	(working copy)
@@ -125,7 +125,7 @@
     return d->codeBase;
 }
 
-void KJavaApplet::setSize( QSize size )
+void KJavaApplet::setSize( const QSize& size )
 {
     d->size = size;
 }
Index: khtml/java/kjavaappletcontext.cpp
===================================================================
--- khtml/java/kjavaappletcontext.cpp	(revision 701768)
+++ khtml/java/kjavaappletcontext.cpp	(working copy)
@@ -128,7 +128,7 @@
     server->stopApplet( id, applet->appletId() );
 }
 
-void KJavaAppletContext::processCmd( QString cmd, QStringList args )
+void KJavaAppletContext::processCmd( const QString& cmd, const QStringList& args )
 {
     received( cmd, args );
 }
Index: khtml/java/kjavaapplet.h
===================================================================
--- khtml/java/kjavaapplet.h	(revision 701768)
+++ khtml/java/kjavaapplet.h	(working copy)
@@ -127,7 +127,7 @@
     /**
      * Set the size of the applet
      */
-    void setSize( QSize size );
+    void setSize( const QSize& size );
 
     /**
      * Get the size of the applet
Index: khtml/java/kjavaappletcontext.h
===================================================================
--- khtml/java/kjavaappletcontext.h	(revision 701768)
+++ khtml/java/kjavaappletcontext.h	(working copy)
@@ -95,7 +95,7 @@
      * use this for applet call backs, the AppletServer
      * calls this directly.
      */
-    void processCmd( QString cmd, QStringList args );
+    void processCmd( const QString& cmd, const QStringList& args );
 
     /**
      * LiveConnect functions
Index: khtml/css/cssstyleselector.h
===================================================================
--- khtml/css/cssstyleselector.h	(revision 701768)
+++ khtml/css/cssstyleselector.h	(working copy)
@@ -113,7 +113,7 @@
 	 * Also takes into account special cases for HTML documents,
 	 * including the defaultStyle (which is html only)
 	 */
-	CSSStyleSelector( DOM::DocumentImpl* doc, QString userStyleSheet, \
DOM::StyleSheetListImpl *styleSheets, const KUrl &url, +	CSSStyleSelector( \
DOM::DocumentImpl* doc, const QString& userStyleSheet, DOM::StyleSheetListImpl \
*styleSheets, const KUrl &url,  bool _strictParsing );
 	/**
 	 * same as above but for a single stylesheet.
Index: khtml/css/css_renderstyledeclarationimpl.cpp
===================================================================
--- khtml/css/css_renderstyledeclarationimpl.cpp	(revision 701768)
+++ khtml/css/css_renderstyledeclarationimpl.cpp	(working copy)
@@ -267,7 +267,7 @@
     return "";
 }
 
-static CSSPrimitiveValueImpl* valueForColor(QColor color)
+static CSSPrimitiveValueImpl* valueForColor(const QColor& color)
 {
     if (color.isValid())
         return new CSSPrimitiveValueImpl(color.rgb());//### KDE4: use rgba!
Index: khtml/css/cssstyleselector.cpp
===================================================================
--- khtml/css/cssstyleselector.cpp	(revision 701768)
+++ khtml/css/cssstyleselector.cpp	(working copy)
@@ -209,7 +209,7 @@
 static PseudoState pseudoState;
 
 
-CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, \
StyleSheetListImpl *styleSheets, +CSSStyleSelector::CSSStyleSelector( DocumentImpl* \
                doc, const QString& userStyleSheet, StyleSheetListImpl *styleSheets,
                                     const KUrl &url, bool _strictParsing )
 {
     KHTMLView* view = doc->view();
Index: khtml/test_regression.cpp
===================================================================
--- khtml/test_regression.cpp	(revision 701768)
+++ khtml/test_regression.cpp	(working copy)
@@ -1294,7 +1294,7 @@
     return rel;
 }
 
-static QString getDiff(QString cmdLine)
+static QString getDiff(const QString& cmdLine)
 {
     QProcess p;
     p.start(cmdLine, QIODevice::ReadOnly);
Index: khtml/imload/imagepainter.cpp
===================================================================
--- khtml/imload/imagepainter.cpp	(revision 701768)
+++ khtml/imload/imagepainter.cpp	(working copy)
@@ -33,7 +33,7 @@
     size = image->size();
 }
 
-ImagePainter::ImagePainter(Image* _image, QSize _size):image(_image), size(_size)
+ImagePainter::ImagePainter(Image* _image, const QSize& _size):image(_image), \
size(_size)  {
     image->refSize(_size);
 }
@@ -59,7 +59,7 @@
     return *this;
 }
 
-void ImagePainter::setSize(QSize _size)
+void ImagePainter::setSize(const QSize& _size)
 {
     image->refSize(_size);
     image->derefSize(size);
Index: khtml/imload/image.h
===================================================================
--- khtml/imload/image.h	(revision 701768)
+++ khtml/imload/image.h	(working copy)
@@ -121,9 +121,9 @@
 
 private: //Interface to the painter
     friend class ImagePainter;
-    void derefSize(QSize size);
-    void refSize  (QSize size);
-    PixmapPlane* getSize(QSize size);
+    void derefSize(const QSize& size);
+    void refSize  (const QSize& size);
+    PixmapPlane* getSize(const QSize& size);
 
 private:
     ImageOwner * owner;
Index: khtml/imload/decoders/gifloader.cpp
===================================================================
--- khtml/imload/decoders/gifloader.cpp	(revision 701768)
+++ khtml/imload/decoders/gifloader.cpp	(working copy)
@@ -89,7 +89,7 @@
     bool                  firstTime;
     QColor                bgColor;
 public:
-    GIFAnimProvider(PixmapPlane* plane, QVector<GIFFrameInfo> _frames, QColor bg):
+    GIFAnimProvider(PixmapPlane* plane, QVector<GIFFrameInfo> _frames, const QColor& \
bg):  AnimProvider(plane), bgColor(bg)
     {
         frameInfo = _frames;
Index: khtml/imload/imagepainter.h
===================================================================
--- khtml/imload/imagepainter.h	(revision 701768)
+++ khtml/imload/imagepainter.h	(working copy)
@@ -48,7 +48,7 @@
      Creates an image painter for the given image,
      of given size
     */
-    ImagePainter(Image* image, QSize size);
+    ImagePainter(Image* image, const QSize& size);
 
     ImagePainter(const ImagePainter& src);
     ImagePainter& operator=(const ImagePainter& src);
@@ -57,7 +57,7 @@
     /**
      Sets the size of the image.
     */
-    void setSize(QSize size);
+    void setSize(const QSize& size);
 
     /**
      Sets the image to the default size
Index: khtml/imload/image.cpp
===================================================================
--- khtml/imload/image.cpp	(revision 701768)
+++ khtml/imload/image.cpp	(working copy)
@@ -321,12 +321,12 @@
     return fullyDecoded;
 }
 
-static QPair<int, int> trSize(QSize size)
+static QPair<int, int> trSize(const QSize& size)
 {
     return qMakePair(size.width(), size.height());
 }
 
-PixmapPlane* Image::getSize(QSize size)
+PixmapPlane* Image::getSize(const QSize& size)
 {
     if (size == this->size())
         return original;
@@ -334,7 +334,7 @@
     return scaled[trSize(size)];
 }
 
-void Image::derefSize(QSize size)
+void Image::derefSize(const QSize& size)
 {
     if (size == this->size()) return;
 
@@ -348,7 +348,7 @@
     }
 }
 
-void Image::refSize(QSize size)
+void Image::refSize(const QSize& size)
 {
     if (size == this->size()) return;
 



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic