javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlabel.cpp
branchRCL_3
changeset 59 e5618cc85d74
parent 24 0fd27995241b
child 60 6c158198356e
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlabel.cpp	Mon Jun 21 15:32:50 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlabel.cpp	Thu Jul 15 18:31:06 2010 +0300
@@ -483,8 +483,7 @@
     const CFont* font = iEikLabel->Font();
 
     // Estimate how many text rows within given rectangle
-    // Use HeightInPixels same as MinimumHeight
-    TInt textPaneHeight = font->HeightInPixels();
+    TInt textPaneHeight = GetFontHeight(font);
     const TInt gap = iEikLabel->PixelGapBetweenLines();
 
     // The last row in label does not add a gap after it. So...
@@ -620,7 +619,7 @@
     // This is to fix some fonts getting clipped from above.
     // Do not change this ever, as wrapping will surely brake.
     return aLineCount * iEikLabel->PixelGapBetweenLines()
-           + aLineCount * iEikLabel->Font()->HeightInPixels();
+           + aLineCount * GetFontHeight(iEikLabel->Font());
 }
 
 // ---------------------------------------------------------------------------
@@ -649,6 +648,24 @@
 }
 
 // ---------------------------------------------------------------------------
+// CSwtLabel::GetFontHeight
+// ---------------------------------------------------------------------------
+//
+TInt CSwtLabel::GetFontHeight(const CFont* aFont) const
+{
+    if (!aFont)
+    {
+        return 0;
+    }
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+    return aFont->FontMaxHeight();
+#else
+    return aFont->HeightInPixels();
+#endif
+}
+
+// ---------------------------------------------------------------------------
 // CSwtLabel::Draw
 // From CCoeControl
 // ---------------------------------------------------------------------------