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

List:       kde-commits
Subject:    [kate] part/render: const correctness, use fontHeight() & lineHeight()
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2012-07-01 9:14:06
Message-ID: 20120701091406.B43E4A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit dad98368d74117b2c43a769d5a6cec30600737a1 by Dominik Haumann.
Committed on 01/07/2012 at 11:08.
Pushed by dhaumann into branch 'master'.

const correctness, use fontHeight() & lineHeight()

M  +9    -9    part/render/katerenderer.cpp
M  +3    -3    part/render/katerenderer.h

http://commits.kde.org/kate/dad98368d74117b2c43a769d5a6cec30600737a1

diff --git a/part/render/katerenderer.cpp b/part/render/katerenderer.cpp
index 134ff6f..77b2b16 100644
--- a/part/render/katerenderer.cpp
+++ b/part/render/katerenderer.cpp
@@ -211,7 +211,7 @@ void KateRenderer::paintTextLineBackground(QPainter& paint, \
KateLineLayoutPtr la  }
 
   // Draw line background
-  paint.fillRect(0, 0, xEnd - xStart, config()->fontMetrics().height() * \
layout->viewLineCount(), backgroundColor); +  paint.fillRect(0, 0, xEnd - xStart, \
lineHeight() * layout->viewLineCount(), backgroundColor);  
   // paint the current line background if we're on the current line
   if (currentViewLine != -1) {
@@ -226,7 +226,7 @@ void KateRenderer::paintTextLineBackground(QPainter& paint, \
KateLineLayoutPtr la  );
     }
 
-    paint.fillRect(0, config()->fontMetrics().height() * currentViewLine, xEnd - \
xStart, config()->fontMetrics().height(), currentLineColor); +    paint.fillRect(0, \
lineHeight() * currentViewLine, xEnd - xStart, lineHeight(), currentLineColor);  }
 }
 
@@ -274,7 +274,7 @@ void KateRenderer::paintNonBreakSpace(QPainter &paint, qreal x, \
qreal y)  paint.setPen( pen );
   paint.setRenderHint(QPainter::Antialiasing, false);
 
-  const int height = config()->fontMetrics().height();
+  const int height = fontHeight();
   const int width = spaceWidth();
 
   QPoint points[6];
@@ -293,7 +293,7 @@ void KateRenderer::paintIndentMarker(QPainter &paint, uint x, \
uint row)  QPen penBackup( paint.pen() );
   paint.setPen( config()->indentationLineColor() );
 
-  const int height = config()->fontMetrics().height();
+  const int height = fontHeight();
   const int top = 0;
   const int bottom = height-1;
 
@@ -776,19 +776,19 @@ const QFontMetrics& KateRenderer::currentFontMetrics() const
   return config()->fontMetrics();
 }
 
-uint KateRenderer::fontHeight()
+uint KateRenderer::fontHeight() const
 {
   return config()->fontMetrics().height();
 }
 
-uint KateRenderer::documentHeight()
+uint KateRenderer::documentHeight() const
 {
   return m_doc->lines() * lineHeight();
 }
 
-int KateRenderer::lineHeight()
+int KateRenderer::lineHeight() const
 {
-  return fontHeight(); // for now
+  return fontHeight();
 }
 
 bool KateRenderer::getSelectionBounds(int line, int lineLength, int &start, int \
&end) const @@ -936,7 +936,7 @@ void KateRenderer::layoutLine(KateLineLayoutPtr \
lineLayout, int maxwidth, bool c  lineLayout->setShiftX(shiftX);
     }
 
-    height += config()->fontMetrics().height();
+    height += lineHeight();
   }
 
   l->endLayout();
diff --git a/part/render/katerenderer.h b/part/render/katerenderer.h
index 88dae0a..6f36aae 100644
--- a/part/render/katerenderer.h
+++ b/part/render/katerenderer.h
@@ -260,13 +260,13 @@ public:
     KTextEditor::Cursor xToCursor(const KateTextLayout& range, int x, bool \
returnPastLine = false) const;  
     // Font height
-    uint fontHeight();
+    uint fontHeight() const;
 
     // Line height
-    int lineHeight();
+    int lineHeight() const;
 
     // Document height
-    uint documentHeight();
+    uint documentHeight() const;
 
     // Selection boundaries
     bool getSelectionBounds(int line, int lineLength, int &start, int &end) const;


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

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