Bug 222436. Simplify nsPresContext::BidiEnabled. r=roc
☠☠ backed out by df3a1a39837f ☠ ☠
authorTimothy Nikkel <tnikkel@gmail.com>
Sat, 10 Apr 2010 13:03:40 -0500
changeset 40648 3a27158cbdd697fe5528658c4676cea537e50b6a
parent 40647 fccdd48b82ae554dff95bb7db25227148ed8f28c
child 40649 02e8391669c3975821e20d9a5485eaa27cf0a39d
child 40674 df3a1a39837f15a5a51507b6af84deb81a1e9ce6
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs222436
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 222436. Simplify nsPresContext::BidiEnabled. r=roc
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1349,37 +1349,16 @@ nsPresContext::GetContainerInternal() co
 
 already_AddRefed<nsISupports>
 nsPresContext::GetContainerExternal() const
 {
   return GetContainerInternal();
 }
 
 #ifdef IBMBIDI
-PRBool
-nsPresContext::BidiEnabledInternal() const
-{
-  PRBool bidiEnabled = PR_FALSE;
-  NS_ASSERTION(mShell, "PresShell must be set on PresContext before calling nsPresContext::GetBidiEnabled");
-  if (mShell) {
-    nsIDocument *doc = mShell->GetDocument();
-    NS_ASSERTION(doc, "PresShell has no document in nsPresContext::GetBidiEnabled");
-    if (doc) {
-      bidiEnabled = doc->GetBidiEnabled();
-    }
-  }
-  return bidiEnabled;
-}
-
-PRBool
-nsPresContext::BidiEnabledExternal() const
-{
-  return BidiEnabledInternal();
-}
-
 void
 nsPresContext::SetBidiEnabled() const
 {
   if (mShell) {
     nsIDocument *doc = mShell->GetDocument();
     if (doc) {
       doc->SetBidiEnabled();
     }
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -680,18 +680,18 @@ public:
 #ifdef IBMBIDI
   /**
    *  Check if bidi enabled (set depending on the presence of RTL
    *  characters or when default directionality is RTL).
    *  If enabled, we should apply the Unicode Bidi Algorithm
    *
    *  @lina 07/12/2000
    */
-  virtual NS_HIDDEN_(PRBool) BidiEnabledExternal() const;
-  NS_HIDDEN_(PRBool) BidiEnabledInternal() const;
+  virtual PRBool BidiEnabledExternal() const { return BidiEnabledInternal(); }
+  PRBool BidiEnabledInternal() const { return Document()->GetBidiEnabled(); }
 #ifdef _IMPL_NS_LAYOUT
   PRBool BidiEnabled() const { return BidiEnabledInternal(); }
 #else
   PRBool BidiEnabled() const { return BidiEnabledExternal(); }
 #endif
 
   /**
    *  Set bidi enabled. This means we should apply the Unicode Bidi Algorithm