Bug 938850 - Build layout/mathml in unified mode; r=roc

This commit is contained in:
Ehsan Akhgari 2013-11-14 21:45:38 -05:00
parent def7bdd96e
commit 599e71b0f9
4 changed files with 16 additions and 16 deletions

View File

@ -6,7 +6,7 @@
MODULE = 'layout'
SOURCES += [
UNIFIED_SOURCES += [
'nsMathMLChar.cpp',
'nsMathMLContainerFrame.cpp',
'nsMathMLFrame.cpp',

View File

@ -390,7 +390,7 @@ NS_IMPL_ISUPPORTS1(nsGlyphTableList, nsIObserver)
// Here is the global list of applicable glyph tables that we will be using
static nsGlyphTableList* gGlyphTableList = nullptr;
static bool gInitialized = false;
static bool gGlyphTableInitialized = false;
// XPCOM shutdown observer
NS_IMETHODIMP
@ -428,7 +428,7 @@ nsGlyphTableList::Finalize()
else
rv = NS_ERROR_FAILURE;
gInitialized = false;
gGlyphTableInitialized = false;
// our oneself will be destroyed when our |Release| is called by the observer
return rv;
}
@ -554,8 +554,8 @@ MathFontEnumCallback(const nsString& aFamily, bool aGeneric, void *aData)
static nsresult
InitGlobals(nsPresContext* aPresContext)
{
NS_ASSERTION(!gInitialized, "Error -- already initialized");
gInitialized = true;
NS_ASSERTION(!gGlyphTableInitialized, "Error -- already initialized");
gGlyphTableInitialized = true;
// Allocate the placeholders for the preferred parts and variants
nsresult rv = NS_ERROR_OUT_OF_MEMORY;
@ -637,7 +637,7 @@ void
nsMathMLChar::SetData(nsPresContext* aPresContext,
nsString& aData)
{
if (!gInitialized) {
if (!gGlyphTableInitialized) {
InitGlobals(aPresContext);
}
mData = aData;

View File

@ -32,10 +32,9 @@ static int32_t gTableRefCount = 0;
static uint32_t gOperatorCount = 0;
static OperatorData* gOperatorArray = nullptr;
static nsHashtable* gOperatorTable = nullptr;
static bool gInitialized = false;
static bool gGlobalsInitialized = false;
static nsTArray<nsString>* gInvariantCharArray = nullptr;
static const PRUnichar kNullCh = PRUnichar('\0');
static const PRUnichar kDashCh = PRUnichar('#');
static const PRUnichar kColonCh = PRUnichar(':');
@ -129,6 +128,8 @@ SetOperator(OperatorData* aOperatorData,
nsString& aAttributes)
{
static const PRUnichar kNullCh = PRUnichar('\0');
// aOperator is in the expanded format \uNNNN\uNNNN ...
// First compress these Unicode points to the internal nsString format
int32_t i = 0;
@ -315,7 +316,7 @@ InitOperators(void)
static nsresult
InitGlobals()
{
gInitialized = true;
gGlobalsInitialized = true;
nsresult rv = NS_ERROR_OUT_OF_MEMORY;
gInvariantCharArray = new nsTArray<nsString>();
if (gInvariantCharArray) {
@ -376,7 +377,7 @@ nsMathMLOperators::LookupOperator(const nsString& aOperator,
float* aLeadingSpace,
float* aTrailingSpace)
{
if (!gInitialized) {
if (!gGlobalsInitialized) {
InitGlobals();
}
if (gOperatorTable) {
@ -421,7 +422,7 @@ nsMathMLOperators::LookupOperators(const nsString& aOperator,
float* aLeadingSpace,
float* aTrailingSpace)
{
if (!gInitialized) {
if (!gGlobalsInitialized) {
InitGlobals();
}
@ -463,7 +464,7 @@ nsMathMLOperators::LookupOperators(const nsString& aOperator,
bool
nsMathMLOperators::IsMutableOperator(const nsString& aOperator)
{
if (!gInitialized) {
if (!gGlobalsInitialized) {
InitGlobals();
}
// lookup all the variants of the operator and return true if there
@ -517,7 +518,7 @@ nsMathMLOperators::GetStretchyDirection(const nsString& aOperator)
/* static */ eMATHVARIANT
nsMathMLOperators::LookupInvariantChar(const nsAString& aChar)
{
if (!gInitialized) {
if (!gGlobalsInitialized) {
InitGlobals();
}
if (gInvariantCharArray) {
@ -540,7 +541,7 @@ nsMathMLOperators::LookupInvariantChar(const nsAString& aChar)
nsMathMLOperators::TransformVariantChar(const PRUnichar& aChar,
eMATHVARIANT aVariant)
{
if (!gInitialized) {
if (!gGlobalsInitialized) {
InitGlobals();
}
if (gInvariantCharArray) {

View File

@ -33,7 +33,6 @@ nsMathMLmoFrame::~nsMathMLmoFrame()
static const PRUnichar kInvisibleComma = PRUnichar(0x200B); // a.k.a. ZERO WIDTH SPACE
static const PRUnichar kApplyFunction = PRUnichar(0x2061);
static const PRUnichar kInvisibleTimes = PRUnichar(0x2062);
static const PRUnichar kNullCh = PRUnichar('\0');
eMathMLFrameType
nsMathMLmoFrame::GetMathMLFrameType()
@ -119,7 +118,7 @@ nsMathMLmoFrame::ProcessTextData()
nsContentUtils::GetNodeTextContent(mContent, false, data);
data.CompressWhitespace();
int32_t length = data.Length();
PRUnichar ch = (length == 0) ? kNullCh : data[0];
PRUnichar ch = (length == 0) ? PRUnichar('\0') : data[0];
if ((length == 1) &&
(ch == kInvisibleComma ||