Bug 415686: remove FONT_LEADING_APIS_V2 ifdefs which are no longer useful for cairo builds. Also remove related functions and tests. r/sr=dbaron, r=pavlov, a=beltzner
authormozilla@weilbacher.org
Tue, 19 Feb 2008 11:41:56 -0800
changeset 11878 10a28f38a6b0903475be5a0c70181258da3c3a8e
parent 11877 3ad9dc3958348518a26dc7b8d815cebff3572409
child 11879 4ab6a246b460091f6a3c34d1df8e35230acbed99
push idunknown
push userunknown
push dateunknown
reviewerspavlov, beltzner
bugs415686
milestone1.9b4pre
Bug 415686: remove FONT_LEADING_APIS_V2 ifdefs which are no longer useful for cairo builds. Also remove related functions and tests. r/sr=dbaron, r=pavlov, a=beltzner
gfx/public/nsIFontMetrics.h
gfx/src/nsRegressionTestFontMetrics.cpp
gfx/src/nsRegressionTestFontMetrics.h
gfx/src/thebes/nsThebesFontMetrics.cpp
gfx/src/thebes/nsThebesFontMetrics.h
layout/generic/nsHTMLReflowState.cpp
--- a/gfx/public/nsIFontMetrics.h
+++ b/gfx/public/nsIFontMetrics.h
@@ -132,46 +132,28 @@ public:
    * Returns the height (in app units) of the font. This is ascent plus descent
    * plus any internal leading
    *
    * This method will be removed once the callers have been moved over to the
    * new GetEmHeight (and possibly GetMaxHeight).
    */
   NS_IMETHOD  GetHeight(nscoord &aHeight) = 0;
 
-
-#if defined(XP_WIN) || defined(XP_OS2) || defined(MOZ_CAIRO_GFX)
-#define FONT_LEADING_APIS_V2 1
-#endif 
-
-#ifdef FONT_LEADING_APIS_V2
   /**
    * Returns the amount of internal leading (in app units) for the font. This
    * is computed as the "height  - (ascent + descent)"
    */
   NS_IMETHOD  GetInternalLeading(nscoord &aLeading) = 0;
 
   /**
    * Returns the amount of external leading (in app units) as suggested by font
    * vendor. This value is suggested by font vendor to add to normal line-height 
    * beside font height.
    */
   NS_IMETHOD  GetExternalLeading(nscoord &aLeading) = 0;
-#else
-  /**
-   * Returns the amount of internal leading (in app units) for the font. This
-   * is computed as the "height  - (ascent + descent)"
-   */
-  NS_IMETHOD  GetLeading(nscoord &aLeading) = 0;
-
-  /**
-   * Returns the normal line height (em height + leading).
-   */
-  NS_IMETHOD  GetNormalLineHeight(nscoord &aHeight) = 0;
-#endif /* FONT_LEADING_APIS_V2 */
 
   /**
    * Returns the height (in app units) of the Western font's em square. This is
    * em ascent plus em descent.
    */
   NS_IMETHOD  GetEmHeight(nscoord &aHeight) = 0;
 
   /**
deleted file mode 100644
--- a/gfx/src/nsRegressionTestFontMetrics.cpp
+++ /dev/null
@@ -1,343 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsRegressionTestFontMetrics.h"
-
-#define MAPPING_FACTOR_FOR_SPACE 0.02f
-#define MAPPING_FACTOR_FOR_LOWER_CASE  0.50f
-#define MAPPING_FACTOR_FOR_OTHERS  0.70f
-
-
-nsresult
-NS_NewRegressionTestFontMetrics(nsIFontMetrics** aMetrics)
-{
-  if (aMetrics == nsnull) {
-    return NS_ERROR_NULL_POINTER;
-  }
-
-  nsRegressionTestFontMetrics  *fm = new nsRegressionTestFontMetrics();
-
-  if (nsnull == fm) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  return CallQueryInterface(fm, aMetrics);
-}
-
-nsRegressionTestFontMetrics:: nsRegressionTestFontMetrics()
-{
-  mDeviceContext = nsnull;
-  
-  mHeight = 0; 
-  mAscent = 0; 
-  mDescent = 0; 
-  mLeading = 0; 
-  mMaxAscent = 0; 
-  mMaxDescent = 0; 
-  mMaxAdvance = 0; 
-  mXHeight = 0; 
-  mSuperscriptOffset = 0; 
-  mSubscriptOffset = 0; 
-  mStrikeoutSize = 0; 
-  mStrikeoutOffset = 0; 
-  mUnderlineSize = 0; 
-  mUnderlineOffset = 0; 
-}
-  
-NS_IMPL_ISUPPORTS1(nsRegressionTestFontMetrics, nsIFontMetrics)
-
-nsRegressionTestFontMetrics::~nsRegressionTestFontMetrics()
-{
-  mDeviceContext = nsnull;
-}
-
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::Init(const nsFont& aFont, nsIDeviceContext *aContext)
-{
-  mFont = aFont;
-  mDeviceContext = aContext;
-  RealizeFont();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::Destroy()
-{
-  mDeviceContext = nsnull;
-  return NS_OK;
-}
-
-void
-nsRegressionTestFontMetrics::RealizeFont()
-{
-  float dev2app;
-  dev2app = mDeviceContext->DevUnitsToAppUnits();
-  nscoord onepixel = NSToCoordRound(1 * dev2app);
-  PRUint32 fontsize = mFont.size;
- 
-  // Most of the numbers are just made up....
-  // feel free to play around.
-
-  mHeight = fontsize;
-  mXHeight = NSToCoordRound((float)mHeight * 0.50f);
-  mSuperscriptOffset = mXHeight;
-  mSubscriptOffset = mXHeight;
-  mStrikeoutSize = onepixel;
-  mStrikeoutOffset = NSToCoordRound(mXHeight / 3.5f);
-
-  
-  mAscent = NSToCoordRound((float)fontsize * 0.60f);
-  mDescent = NSToCoordRound((float)fontsize * 0.20f);
-
-  mLeading = NSToCoordRound((float)fontsize * 0.10f);
-  mMaxAscent = mAscent;
-  mMaxDescent = mDescent;
-  mMaxAdvance = NSToCoordRound((float)fontsize * 0.80f);
-  mUnderlineSize = onepixel;
-  mUnderlineOffset =  NSToCoordRound(fontsize / 100.0f);
-  
-}
-
-
-/**
-  * This routine determines a character width without relying on the
-  * underlying OS.
-  * 
-  * @update  harishd 02/07/1999
-  * @param   aChar  -- A valid character whose width needs to be computed
-  * @param   aWidth -- Holds the computed character width
-  */
-
-NS_METHOD
-nsRegressionTestFontMetrics::GetWidth(const char aChar, nscoord& aWidth)
-{
-  float size = (float)mFont.size;
-  aWidth = 0;
-
-  if(aChar == ' ')
-    size *= MAPPING_FACTOR_FOR_SPACE;
-  else if(aChar >= 'a' && aChar <= 'z')
-    size *= MAPPING_FACTOR_FOR_LOWER_CASE;
-  else
-    size *= MAPPING_FACTOR_FOR_OTHERS;
-    
-  aWidth = NSToCoordRound(size);
-
-  return NS_OK;
-}
-
-/**
-  * This routine determines a character width without relying on the
-  * underlying OS.
-  * 
-  * @update  harishd 02/07/1999
-  * @param   aChar  -- A valid character whose width needs to be computed
-  * @param   aWidth -- Holds the computed character width
-  */
-
-NS_METHOD
-nsRegressionTestFontMetrics::GetWidth(const PRUnichar aChar,nscoord& aWidth)
-{
-  float size = (float)mFont.size;
-  aWidth = 0;
-
-  if(aChar == ' ')
-    size *= MAPPING_FACTOR_FOR_SPACE;
-  else if(aChar >= 'a' && aChar <= 'z')
-    size *= MAPPING_FACTOR_FOR_LOWER_CASE;
-  else 
-    size *= MAPPING_FACTOR_FOR_OTHERS;
-      
-  aWidth = NSToCoordRound(size);
-
-  return NS_OK;
-}
-
-/**
-  * This routine determines width of a string without relying on the
-  * underlying OS.
-  * 
-  * @update  harishd 02/07/1999
-  * @param   aString -- A string whose width needs to be computed
-  * @param   aLength -- Length of the string
-  * @param   aWidth  -- Holds the computed string width
-  *
-  * @return  error code -- 0 if success, non-zero if error
-  */
-
-NS_METHOD
-nsRegressionTestFontMetrics::GetWidth(const PRUnichar* aString, PRUint32 aLength, nscoord& aWidth)
-{
-  aWidth = 0;
-  
-  if(aString == nsnull)
-    return NS_ERROR_NULL_POINTER;
-  
-  float size;
-  float totalsize = 0;
-  
-  for(PRUint32 index = 0; index < aLength; index++){
-    size = (float)mFont.size;
-    if(aString[index] == ' ')
-      size *= MAPPING_FACTOR_FOR_SPACE;
-    else if(aString[index] >= 'a' && aString[index] <= 'z')
-      size *= MAPPING_FACTOR_FOR_LOWER_CASE;
-    else 
-      size *= MAPPING_FACTOR_FOR_OTHERS;
-    totalsize += size;    
-  }
-  aWidth = NSToCoordRound(totalsize);
-  return NS_OK;
-}
-
-/**
-  * This routine determines width of a string without relying on the
-  * underlying OS.
-  * 
-  * @update  harishd 02/07/1999
-  * @param   aString -- A string whose width needs to be computed
-  * @param   aLength -- Length of the string
-  * @param   aWidth  -- Holds the computed string width
-  *
-  * @return  error code -- 0 if success, non-zero if error
-  */
-
-NS_METHOD
-nsRegressionTestFontMetrics::GetWidth(const char* aString, PRUint32 aLength, nscoord& aWidth)
-{
-  aWidth = 0;
-
-  if(aString == nsnull)
-    return NS_ERROR_NULL_POINTER;
-  
-  float size;
-  float totalsize = 0;
- 
-  for(PRUint32 index=0; index < aLength; index++){
-    size = (float)mFont.size;
-    if(aString[index] == ' ')
-      size *= MAPPING_FACTOR_FOR_SPACE;
-    else if(aString[index] >= 'a' && aString[index] <= 'z')
-      size *= MAPPING_FACTOR_FOR_LOWER_CASE;
-    else
-      size *= MAPPING_FACTOR_FOR_OTHERS;
-    totalsize += size;    
-  }
-  aWidth += NSToCoordRound(totalsize);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetXHeight(nscoord& aResult)
-{
-  aResult = mXHeight;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetSuperscriptOffset(nscoord& aResult)
-{
-  aResult = mSuperscriptOffset;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetSubscriptOffset(nscoord& aResult)
-{
-  aResult = mSubscriptOffset;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetStrikeout(nscoord& aOffset, nscoord& aSize)
-{
-  aOffset = mStrikeoutOffset;
-  aSize = mStrikeoutSize;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetUnderline(nscoord& aOffset, nscoord& aSize)
-{
-  aOffset = mUnderlineOffset;
-  aSize = mUnderlineSize;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetHeight(nscoord &aHeight)
-{
-  aHeight = mHeight;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetLeading(nscoord &aLeading)
-{
-  aLeading = mLeading;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetMaxAscent(nscoord &aAscent)
-{
-  aAscent = mMaxAscent;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetMaxDescent(nscoord &aDescent)
-{
-  aDescent = mMaxDescent;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsRegressionTestFontMetrics::GetMaxAdvance(nscoord &aAdvance)
-{
-  aAdvance = mMaxAdvance;
-  return NS_OK;
-}
-
-nsRegressionTestFontMetrics::GetFontHandle(nsFontHandle &aHandle)
-{
-  //We don't have a font handler
-  aHandle = NULL;
-  return NS_OK;
-}
-
deleted file mode 100644
--- a/gfx/src/nsRegressionTestFontMetrics.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef nsRegressionTestFontMetrics_h__
-#define nsRegressionTestFontMetrics_h__
-
-#include "nsIFontMetrics.h"
-#include "nsFont.h"
-#include "nsString.h"
-#include "nsIDeviceContext.h"
-
-class nsRegressionTestFontMetrics : public nsIFontMetrics
-{
-public:
-   friend nsresult NS_NewRegressionTestFontMetrics(nsIFontMetrics** aMetrics);
-   virtual ~nsRegressionTestFontMetrics();
-
-
-  NS_DECL_ISUPPORTS
-  
-  NS_IMETHOD  Init(const nsFont& aFont, nsIDeviceContext *aContext);
-  NS_IMETHOD  Destroy();
-
-  NS_IMETHOD  GetXHeight(nscoord& aResult);
-  NS_IMETHOD  GetSuperscriptOffset(nscoord& aResult);
-  NS_IMETHOD  GetSubscriptOffset(nscoord& aResult);
-  NS_IMETHOD  GetStrikeout(nscoord& aOffset, nscoord& aSize);
-  NS_IMETHOD  GetUnderline(nscoord& aOffset, nscoord& aSize);
-
-  NS_IMETHOD  GetHeight(nscoord &aHeight);
-  NS_IMETHOD  GetLeading(nscoord &aLeading);
-  NS_IMETHOD  GetMaxAscent(nscoord &aAscent);
-  NS_IMETHOD  GetMaxDescent(nscoord &aDescent);
-  NS_IMETHOD  GetMaxAdvance(nscoord &aAdvance);
-  NS_IMETHOD  GetFontHandle(nsFontHandle &aHandle);
-  
-  NS_METHOD GetWidth(const char aChar, nscoord& aWidth);
-  NS_METHOD GetWidth(const PRUnichar aChar, nscoord& aWidth);
-  NS_METHOD GetWidth(const PRUnichar *aString, PRUint32 aLength, nscoord& aWidth);
-  NS_METHOD GetWidth(const char* aString, PRUint32 aLength, nscoord& aWidth);
-
-protected:
-  nsRegressionTestFontMetrics();
-  void RealizeFont();
-
-  nsIDeviceContext    *mDeviceContext;
-  nscoord             mHeight;
-  nscoord             mAscent;
-  nscoord             mDescent;
-  nscoord             mLeading;
-  nscoord             mMaxAscent;
-  nscoord             mMaxDescent;
-  nscoord             mMaxAdvance;
-  nscoord             mXHeight;
-  nscoord             mSuperscriptOffset;
-  nscoord             mSubscriptOffset;
-  nscoord             mStrikeoutSize;
-  nscoord             mStrikeoutOffset;
-  nscoord             mUnderlineSize;
-  nscoord             mUnderlineOffset;
-};
-
-
-#endif
--- a/gfx/src/thebes/nsThebesFontMetrics.cpp
+++ b/gfx/src/thebes/nsThebesFontMetrics.cpp
@@ -240,31 +240,16 @@ nsThebesFontMetrics::GetAveCharWidth(nsc
 NS_IMETHODIMP
 nsThebesFontMetrics::GetSpaceWidth(nscoord& aSpaceCharWidth)
 {
     aSpaceCharWidth = ROUND_TO_TWIPS(GetMetrics().spaceWidth);
 
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsThebesFontMetrics::GetLeading(nscoord& aLeading)
-{
-    aLeading = ROUND_TO_TWIPS(GetMetrics().internalLeading);
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsThebesFontMetrics::GetNormalLineHeight(nscoord& aLineHeight)
-{
-    const gfxFont::Metrics& m = GetMetrics();
-    aLineHeight = ROUND_TO_TWIPS(m.emHeight + m.internalLeading);
-    return NS_OK;
-}
-
 PRInt32
 nsThebesFontMetrics::GetMaxStringLength()
 {
     const gfxFont::Metrics& m = GetMetrics();
     const double x = 32767.0 / m.maxAdvance;
     PRInt32 len = (PRInt32)floor(x);
     return PR_MAX(1, len);
 }
--- a/gfx/src/thebes/nsThebesFontMetrics.h
+++ b/gfx/src/thebes/nsThebesFontMetrics.h
@@ -73,18 +73,16 @@ public:
     NS_IMETHOD  GetMaxHeight(nscoord &aHeight);
     NS_IMETHOD  GetMaxAscent(nscoord &aAscent);
     NS_IMETHOD  GetMaxDescent(nscoord &aDescent);
     NS_IMETHOD  GetMaxAdvance(nscoord &aAdvance);
     NS_IMETHOD  GetLangGroup(nsIAtom** aLangGroup);
     NS_IMETHOD  GetFontHandle(nsFontHandle &aHandle);
     NS_IMETHOD  GetAveCharWidth(nscoord& aAveCharWidth);
     NS_IMETHOD  GetSpaceWidth(nscoord& aSpaceCharWidth);
-    NS_IMETHOD  GetLeading(nscoord& aLeading);
-    NS_IMETHOD  GetNormalLineHeight(nscoord& aLineHeight);
     virtual PRInt32 GetMaxStringLength();
 
 
     virtual nsresult GetWidth(const char* aString, PRUint32 aLength, nscoord& aWidth,
                               nsThebesRenderingContext *aContext);
     virtual nsresult GetWidth(const PRUnichar* aString, PRUint32 aLength,
                               nscoord& aWidth, PRInt32 *aFontID,
                               nsThebesRenderingContext *aContext);
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -73,19 +73,17 @@ static PRPackedBool sBlinkIsAllowed = PR
 
 enum eNormalLineHeightControl {
   eUninitialized = -1,
   eNoExternalLeading = 0,   // does not include external leading 
   eIncludeExternalLeading,  // use whatever value font vendor provides
   eCompensateLeading        // compensate leading if leading provided by font vendor is not enough
 };
 
-#ifdef FONT_LEADING_APIS_V2
 static eNormalLineHeightControl sNormalLineHeightControl = eUninitialized;
-#endif
 
 // Initialize a <b>root</b> reflow state with a rendering context to
 // use for measuring things.
 nsHTMLReflowState::nsHTMLReflowState(nsPresContext*       aPresContext,
                                      nsIFrame*            aFrame,
                                      nsIRenderingContext* aRenderingContext,
                                      const nsSize&        aAvailableSpace)
   : nsCSSOffsetState(aFrame, aRenderingContext)
@@ -1569,29 +1567,27 @@ static PRBool BlinkIsAllowed(void)
     nsContentUtils::RegisterPrefCallback("browser.blink_allowed", PrefsChanged,
                                          nsnull);
     PrefsChanged(nsnull, nsnull);
     sPrefIsLoaded = PR_TRUE;
   }
   return sBlinkIsAllowed;
 }
 
-#ifdef FONT_LEADING_APIS_V2
 static eNormalLineHeightControl GetNormalLineHeightCalcControl(void)
 {
   if (sNormalLineHeightControl == eUninitialized) {
     // browser.display.normal_lineheight_calc_control is not user
     // changeable, so no need to register callback for it.
     sNormalLineHeightControl =
       static_cast<eNormalLineHeightControl>
                  (nsContentUtils::GetIntPref("browser.display.normal_lineheight_calc_control", eNoExternalLeading));
   }
   return sNormalLineHeightControl;
 }
-#endif
 
 // XXX refactor this code to have methods for each set of properties
 // we are computing: width,height,line-height; margin; offsets
 
 void
 nsHTMLReflowState::InitConstraints(nsPresContext* aPresContext,
                                    nscoord         aContainingBlockWidth,
                                    nscoord         aContainingBlockHeight,
@@ -1982,17 +1978,16 @@ nsHTMLReflowState::CalculateBlockSideMar
 // eNoExternalLeading is the old behavior.
 static nscoord
 GetNormalLineHeight(nsIFontMetrics* aFontMetrics)
 {
   NS_PRECONDITION(nsnull != aFontMetrics, "no font metrics");
 
   nscoord normalLineHeight;
 
-#ifdef FONT_LEADING_APIS_V2
   nscoord externalLeading, internalLeading, emHeight;
   aFontMetrics->GetExternalLeading(externalLeading);
   aFontMetrics->GetInternalLeading(internalLeading);
   aFontMetrics->GetEmHeight(emHeight);
   switch (GetNormalLineHeightCalcControl()) {
   case eIncludeExternalLeading:
     normalLineHeight = emHeight+ internalLeading + externalLeading;
     break;
@@ -2001,19 +1996,16 @@ GetNormalLineHeight(nsIFontMetrics* aFon
       normalLineHeight = NSToCoordRound(emHeight * NORMAL_LINE_HEIGHT_FACTOR);
     else
       normalLineHeight = emHeight+ internalLeading + externalLeading;
     break;
   default:
     //case eNoExternalLeading:
     normalLineHeight = emHeight + internalLeading;
   }
-#else
-  aFontMetrics->GetNormalLineHeight(normalLineHeight);
-#endif // FONT_LEADING_APIS_V2
   return normalLineHeight;
 }
 
 // Need only one of aRenderingContext and aDeviceContext
 static nscoord
 ComputeLineHeight(nsIRenderingContext* aRenderingContext,
                   nsStyleContext* aStyleContext)
 {