diff --git a/mozilla/content/base/public/nsIDocument.h b/mozilla/content/base/public/nsIDocument.h index 634844fb716..ca15c7c4070 100644 --- a/mozilla/content/base/public/nsIDocument.h +++ b/mozilla/content/base/public/nsIDocument.h @@ -189,7 +189,6 @@ public: */ NS_IMETHOD GetContentLanguage(nsAString& aContentLanguage) const = 0; -#ifdef IBMBIDI // The state BidiEnabled should persist across multiple views (screen, print) // of the same document. @@ -206,7 +205,6 @@ public: * the document no longer contains bidi data. */ NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled) = 0; -#endif // IBMBIDI /** * Return the Line Breaker for the document diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index cbc378efcab..f20845ab9ee 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -131,9 +131,7 @@ #include "nsIRadioVisitor.h" #include "nsIFormControl.h" -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID); @@ -518,9 +516,7 @@ nsDocument::nsDocument() : mSubDocuments(nsnull), mNextContentID = NS_CONTENT_ID_COUNTER_BASE; mBoxObjectTable = nsnull; mNumCapturers = 0; -#ifdef IBMBIDI mBidiEnabled = PR_FALSE; -#endif // IBMBIDI // Force initialization. mBindingManager = do_CreateInstance("@mozilla.org/xbl/binding-manager;1"); @@ -2903,7 +2899,6 @@ nsDocument::SetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject* aBoxObject) return NS_OK; } -#ifdef IBMBIDI struct DirTable { const char* mName; PRUint8 mValue; @@ -2913,7 +2908,6 @@ static const DirTable dirAttributes[] = { {"rtl", IBMBIDI_TEXTDIRECTION_RTL}, {0} }; -#endif // IBMBIDI /** * Retrieve the "direction" property of the document. @@ -2923,7 +2917,6 @@ static const DirTable dirAttributes[] = { NS_IMETHODIMP nsDocument::GetDir(nsAString& aDirection) { -#ifdef IBMBIDI nsCOMPtr shell = (nsIPresShell*)mPresShells.SafeElementAt(0); if (shell) { nsCOMPtr context; @@ -2939,9 +2932,7 @@ nsDocument::GetDir(nsAString& aDirection) } } } -#else - aDirection.Assign(NS_LITERAL_STRING("ltr")); -#endif // IBMBIDI + return NS_OK; } @@ -2953,7 +2944,6 @@ nsDocument::GetDir(nsAString& aDirection) NS_IMETHODIMP nsDocument::SetDir(const nsAString& aDirection) { -#ifdef IBMBIDI if (mPresShells.Count() != 0) { nsCOMPtr shell = (nsIPresShell*)mPresShells.ElementAt(0); if (shell) { @@ -2974,7 +2964,6 @@ nsDocument::SetDir(const nsAString& aDirection) } } } -#endif // IBMBIDI return NS_OK; } @@ -3926,7 +3915,6 @@ nsDocument::WalkRadioGroup(const nsAString& aName, return rv; } -#ifdef IBMBIDI /** * Check if bidi enabled (set depending on the presence of RTL * characters). If enabled, we should apply the Unicode Bidi Algorithm @@ -3952,4 +3940,3 @@ nsDocument::SetBidiEnabled(PRBool aBidiEnabled) mBidiEnabled = aBidiEnabled; return NS_OK; } -#endif // IBMBIDI diff --git a/mozilla/content/base/src/nsDocument.h b/mozilla/content/base/src/nsDocument.h index d4a7327a8e6..6b5f9055d2d 100644 --- a/mozilla/content/base/src/nsDocument.h +++ b/mozilla/content/base/src/nsDocument.h @@ -364,7 +364,6 @@ public: */ NS_IMETHOD RemoveCharSetObserver(nsIObserver* aObserver); -#ifdef IBMBIDI /** * Check if the document contains bidi data. * If so, we have to apply the Unicode Bidi Algorithm. @@ -374,7 +373,6 @@ public: * Indicate the document contains RTL characters. */ NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled); -#endif // IBMBIDI /** * Return the Line Breaker for the document @@ -664,9 +662,7 @@ protected: nsHashtable mRadioGroups; -#ifdef IBMBIDI PRBool mBidiEnabled; -#endif // IBMBIDI nsCOMPtr mBindingManager; nsCOMPtr mNodeInfoManager; diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index 22326c925a1..2e7a0120415 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -191,9 +191,7 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printset #include "nsIDOMFocusListener.h" #include "nsISelectionController.h" -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif static NS_DEFINE_CID(kPresShellCID, NS_PRESSHELL_CID); static NS_DEFINE_CID(kGalleyContextCID, NS_GALLEYCONTEXT_CID); @@ -2499,193 +2497,161 @@ NS_IMETHODIMP DocumentViewerImpl::SetHintCharacterSet(const PRUnichar* aHintChar return CallChildren(SetChildHintCharacterSet, (void*) aHintCharacterSet); } -#ifdef IBMBIDI static void SetChildBidiOptions(nsIMarkupDocumentViewer* aChild, void* aClosure) { aChild->SetBidiOptions(NS_PTR_TO_INT32(aClosure)); } -#endif // IBMBIDI - NS_IMETHODIMP DocumentViewerImpl::SetBidiTextDirection(PRUint8 aTextDirection) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_DIRECTION(bidiOptions, aTextDirection); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiTextDirection(PRUint8* aTextDirection) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aTextDirection) { GetBidiOptions(&bidiOptions); *aTextDirection = GET_BIDI_OPTION_DIRECTION(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiTextType(PRUint8 aTextType) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_TEXTTYPE(bidiOptions, aTextType); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiTextType(PRUint8* aTextType) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aTextType) { GetBidiOptions(&bidiOptions); *aTextType = GET_BIDI_OPTION_TEXTTYPE(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiControlsTextMode(PRUint8 aControlsTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions, aControlsTextMode); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiControlsTextMode(PRUint8* aControlsTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aControlsTextMode) { GetBidiOptions(&bidiOptions); *aControlsTextMode = GET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiClipboardTextMode(PRUint8 aClipboardTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions, aClipboardTextMode); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiClipboardTextMode(PRUint8* aClipboardTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aClipboardTextMode) { GetBidiOptions(&bidiOptions); *aClipboardTextMode = GET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiNumeral(PRUint8 aNumeral) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_NUMERAL(bidiOptions, aNumeral); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiNumeral(PRUint8* aNumeral) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aNumeral) { GetBidiOptions(&bidiOptions); *aNumeral = GET_BIDI_OPTION_NUMERAL(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiSupport(PRUint8 aSupport) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_SUPPORT(bidiOptions, aSupport); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiSupport(PRUint8* aSupport) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aSupport) { GetBidiOptions(&bidiOptions); *aSupport = GET_BIDI_OPTION_SUPPORT(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiCharacterSet(PRUint8 aCharacterSet) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_CHARACTERSET(bidiOptions, aCharacterSet); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiCharacterSet(PRUint8* aCharacterSet) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aCharacterSet) { GetBidiOptions(&bidiOptions); *aCharacterSet = GET_BIDI_OPTION_CHARACTERSET(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions) { -#ifdef IBMBIDI if (mPresContext) { #if 1 // forcing reflow will cause bug 80352. Temp turn off force reflow and @@ -2697,13 +2663,11 @@ NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions) } // now set bidi on all children of mContainer CallChildren(SetChildBidiOptions, (void*) aBidiOptions); -#endif // IBMBIDI return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions) { -#ifdef IBMBIDI if (aBidiOptions) { if (mPresContext) { mPresContext->GetBidi(aBidiOptions); @@ -2711,7 +2675,6 @@ NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions) else *aBidiOptions = IBMBIDI_DEFAULT_BIDI_OPTIONS; } -#endif // IBMBIDI return NS_OK; } diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.cpp b/mozilla/content/base/src/nsGenericDOMDataNode.cpp index 096df4c4d74..0be886a465a 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.cpp +++ b/mozilla/content/base/src/nsGenericDOMDataNode.cpp @@ -652,11 +652,9 @@ nsGenericDOMDataNode::SetDocument(nsIDocument* aDocument, PRBool aDeep, { mDocument = aDocument; -#ifdef IBMBIDI if (mDocument && mText.IsBidi()) { mDocument->SetBidiEnabled(PR_TRUE); } -#endif return NS_OK; } @@ -1206,9 +1204,7 @@ nsGenericDOMDataNode::SetText(const PRUnichar* aBuffer, mText.SetTo(aBuffer, aLength); -#ifdef IBMBIDI SetBidiStatus(); -#endif // IBMBIDI if (mDocument && nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED)) { nsCOMPtr node(do_QueryInterface(this)); @@ -1287,9 +1283,7 @@ nsGenericDOMDataNode::SetText(const nsAString& aStr, mText = aStr; -#ifdef IBMBIDI SetBidiStatus(); -#endif // IBMBIDI if (mDocument && nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED)) { nsCOMPtr node(do_QueryInterface(this)); @@ -1404,7 +1398,6 @@ nsGenericDOMDataNode::LookupRangeList() const return nsnull; } -#ifdef IBMBIDI void nsGenericDOMDataNode::SetBidiStatus() { if (mDocument) { @@ -1425,4 +1418,3 @@ void nsGenericDOMDataNode::SetBidiStatus() mDocument->SetBidiEnabled(PR_TRUE); } } -#endif // IBMBIDI diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.h b/mozilla/content/base/src/nsGenericDOMDataNode.h index dd82b7596e5..1557f76724c 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.h +++ b/mozilla/content/base/src/nsGenericDOMDataNode.h @@ -267,9 +267,7 @@ private: void LookupListenerManager(nsIEventListenerManager **aListenerManager) const; nsVoidArray *LookupRangeList() const; -#ifdef IBMBIDI void SetBidiStatus(); -#endif typedef long PtrBits; diff --git a/mozilla/content/base/src/nsRuleNode.cpp b/mozilla/content/base/src/nsRuleNode.cpp index daa48117cd7..84ca6fa8a74 100644 --- a/mozilla/content/base/src/nsRuleNode.cpp +++ b/mozilla/content/base/src/nsRuleNode.cpp @@ -2506,7 +2506,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, text->mTextDecoration = parentText->mTextDecoration; } -#ifdef IBMBIDI // unicode-bidi: enum, normal, inherit if (eCSSUnit_Normal == textData.mUnicodeBidi.GetUnit() ) { text->mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL; @@ -2518,7 +2517,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, inherited = PR_TRUE; text->mUnicodeBidi = parentText->mUnicodeBidi; } -#endif // IBMBIDI if (inherited) // We inherited, and therefore can't be cached in the rule node. We have to be put right on the @@ -3058,10 +3056,8 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, // direction: enum, inherit if (eCSSUnit_Enumerated == displayData.mDirection.GetUnit()) { visibility->mDirection = displayData.mDirection.GetIntValue(); -#ifdef IBMBIDI if (NS_STYLE_DIRECTION_RTL == visibility->mDirection) mPresContext->SetBidiEnabled(PR_TRUE); -#endif // IBMBIDI } else if (eCSSUnit_Inherit == displayData.mDirection.GetUnit()) { inherited = PR_TRUE; diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index df15ac78f02..ac72cbcdd4b 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -253,10 +253,8 @@ public: nsDirection GetDirection(){return mDirection;} void SetDirection(nsDirection aDir){mDirection = aDir;} -#ifdef IBMBIDI PRBool GetTrueDirection() {return mTrueDirection;} void SetTrueDirection(PRBool aBool){mTrueDirection = aBool;} -#endif NS_IMETHOD CopyRangeToAnchorFocus(nsIDOMRange *aRange); @@ -310,9 +308,7 @@ private: SelectionType mType;//type of this nsTypedSelection; nsAutoScrollTimer *mAutoScrollTimer; // timer for autoscrolling. nsCOMArray mSelectionListeners; -#ifdef IBMBIDI PRBool mTrueDirection; -#endif nsCOMPtr mEventQueue; PRBool mScrollEventPosted; }; @@ -389,7 +385,6 @@ public: NS_IMETHOD GetLimiter(nsIContent **aLimiterContent); NS_IMETHOD SetMouseDoubleDown(PRBool aDoubleDown); NS_IMETHOD GetMouseDoubleDown(PRBool *aDoubleDown); -#ifdef IBMBIDI NS_IMETHOD GetPrevNextBidiLevels(nsIPresContext *aPresContext, nsIContent *aNode, PRUint32 aContentOffset, @@ -403,7 +398,6 @@ public: PRUint8 aBidiLevel, nsIFrame **aFrameOut); -#endif // IBMBIDI /*END nsIFrameSelection interfacse*/ @@ -421,7 +415,6 @@ private: NS_IMETHOD TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, PRUint32 aContentEndOffset, PRBool aContinueSelection, PRBool aMultipleSelection); -#ifdef IBMBIDI void BidiLevelFromMove(nsIPresContext* aContext, nsIPresShell* aPresShell, nsIContent *aNode, @@ -452,7 +445,6 @@ private: PRInt32 aCurrentOffset, nsPeekOffsetStruct aPos); #endif // VISUALSELECTION -#endif // IBMBIDI //post and pop reasons for notifications. we may stack these later void PostReason(short aReason){mReason = aReason;} @@ -1560,7 +1552,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA // SetDesiredX(desiredX); } -#ifdef IBMBIDI nsCOMPtr caret; nsCOMPtr shell; result = context->GetShell(getter_AddRefs(shell)); @@ -1569,7 +1560,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA result = shell->GetCaret(getter_AddRefs(caret)); if (NS_FAILED(result) || !caret) return 0; -#endif offsetused = mDomSelections[index]->FetchFocusOffset(); weakNodeUsed = mDomSelections[index]->FetchFocusNode(); @@ -1645,7 +1635,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA if (NS_SUCCEEDED(result) && NS_SUCCEEDED(result = frame->PeekOffset(context, &pos)) && pos.mResultContent) { tHint = (HINT)pos.mPreferLeft; -#ifdef IBMBIDI PRBool bidiEnabled = PR_FALSE; context->GetBidiEnabled(&bidiEnabled); if (bidiEnabled) @@ -1715,7 +1704,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA #else } #endif // VISUALSELECTION -#endif // IBMBIDI result = TakeFocus(pos.mResultContent, pos.mContentOffset, pos.mContentOffset, aContinue, PR_FALSE); } if (NS_SUCCEEDED(result)) @@ -1846,7 +1834,6 @@ nsTypedSelection::GetInterlinePosition(PRBool *aHintRight) return rv; } -#ifdef IBMBIDI nsDirection ReverseDirection(nsDirection aDirection) { return (eDirNext == aDirection) ? eDirPrevious : eDirNext; @@ -2580,7 +2567,6 @@ void nsSelection::BidiLevelFromClick(nsIContent *aNode, PRUint32 aContentOffset) (void**)&frameLevel, sizeof(frameLevel) ); shell->SetCaretBidiLevel(frameLevel); } -#endif //IBMBIDI NS_IMETHODIMP nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset, @@ -2595,9 +2581,7 @@ nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset, // Don't take focus when dragging off of a table if (!mDragSelectingCells) { -#ifdef IBMBIDI BidiLevelFromClick(aNewFocus, aContentOffset); -#endif PostReason(nsISelectionListener::MOUSEDOWN_REASON + nsISelectionListener::DRAG_REASON); return TakeFocus(aNewFocus, aContentOffset, aContentEndOffset, aContinueSelection, aMultipleSelection); } @@ -2709,7 +2693,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint& if (NS_SUCCEEDED(result)) { -#ifdef IBMBIDI #ifdef VISUALSELECTION PRBool bidiEnabled = PR_FALSE; aPresContext->GetBidiEnabled(&bidiEnabled); @@ -2736,7 +2719,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint& } else #endif // VISUALSELECTION -#endif // IBMBIDI result = HandleClick(newContent, startPos, contentOffsetEnd, PR_TRUE, PR_FALSE, beginOfContent); } @@ -2816,12 +2798,8 @@ nsSelection::TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, mBatching = batching; mChangesDuringBatching = changes; } -#ifdef IBMBIDI if (aContentEndOffset != aContentOffset) -#else - if (aContentEndOffset > aContentOffset) -#endif // IBMBIDI - mDomSelections[index]->Extend(domNode,aContentEndOffset); + mDomSelections[index]->Extend(domNode,aContentEndOffset); //find out if we are inside a table. if so, find out which one and which cell //once we do that, the next time we get a takefocus, check the parent tree. @@ -7855,7 +7833,6 @@ nsTypedSelection::DeleteFromDocument() NS_IMETHODIMP nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL) { -#ifdef IBMBIDI nsresult result; nsCOMPtr focusNode; nsCOMPtr focusContent; @@ -7927,6 +7904,5 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL) else shell->SetCaretBidiLevel(levelAfter); } -#endif // IBMBIDI return NS_OK; } diff --git a/mozilla/content/base/src/nsTextFragment.h b/mozilla/content/base/src/nsTextFragment.h index 7471a427338..ee081113d04 100644 --- a/mozilla/content/base/src/nsTextFragment.h +++ b/mozilla/content/base/src/nsTextFragment.h @@ -139,7 +139,6 @@ public: return mState.mIs2b; } -#ifdef IBMBIDI /** * Return PR_TRUE if this fragment contains Bidi text * For performance reasons this flag is not set automatically, but @@ -149,8 +148,6 @@ public: { return mState.mIsBidi; } -#endif - /** * Get a pointer to constant PRUnichar data. @@ -240,13 +237,11 @@ public: return mState.mIs2b ? m2b[aIndex] : PRUnichar(m1b[aIndex]); } -#ifdef IBMBIDI /** * Scan the contents of the fragment and turn on mState.mIsBidi if it * includes any Bidi characters. */ void SetBidiFlag(); -#endif struct FragmentBits { PRBool mInHeap : 1; diff --git a/mozilla/content/html/content/src/nsFormSubmission.cpp b/mozilla/content/html/content/src/nsFormSubmission.cpp index 9365a9b2305..d0ddf360a97 100644 --- a/mozilla/content/html/content/src/nsFormSubmission.cpp +++ b/mozilla/content/html/content/src/nsFormSubmission.cpp @@ -65,15 +65,7 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, #include "nsIStringBundle.h" //BIDI -#ifdef IBMBIDI #include "nsBidiUtils.h" -#else -// -// Make BIDI stuff work when BIDI is off -// -#define GET_BIDI_OPTION_CONTROLSTEXTMODE(x) 0 -#define GET_BIDI_OPTION_DIRECTION(x) 0 -#endif //end @@ -1154,10 +1146,8 @@ GetSubmissionFromForm(nsIHTMLContent* aForm, // Get BIDI options PRUint32 bidiOptions = 0; PRUint8 ctrlsModAtSubmit = 0; -#ifdef IBMBIDI aPresContext->GetBidi(&bidiOptions); ctrlsModAtSubmit = GET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions); -#endif // Get encoding type (default: urlencoded) PRInt32 enctype = NS_FORM_ENCTYPE_URLENCODED; @@ -1293,7 +1283,6 @@ nsFormSubmission::GetSubmitCharset(nsIHTMLContent* aForm, rv = doc->GetDocumentCharacterSet(oCharset); } -#ifdef IBMBIDI if (aCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL && oCharset.Equals(NS_LITERAL_STRING("windows-1256"), nsCaseInsensitiveStringComparator())) { @@ -1316,7 +1305,6 @@ nsFormSubmission::GetSubmitCharset(nsIHTMLContent* aForm, oCharset = NS_LITERAL_STRING("IBM864"); } -#endif } // JBK moved from nsFormFrame - bug 34297 @@ -1355,7 +1343,6 @@ nsFormSubmission::UnicodeToNewBytes(const PRUnichar* aStr, PRUint32 aLen, { nsresult rv = NS_OK; -#ifdef IBMBIDI PRUint8 ctrlsModAtSubmit = GET_BIDI_OPTION_CONTROLSTEXTMODE(mBidiOptions); PRUint8 textDirAtSubmit = GET_BIDI_OPTION_DIRECTION(mBidiOptions); //ahmed 15-1 @@ -1409,7 +1396,6 @@ nsFormSubmission::UnicodeToNewBytes(const PRUnichar* aStr, PRUint32 aLen, } aStr = (PRUnichar*)temp.get(); } -#endif char* res = nsnull; diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index fe18187f713..4abbc282e2a 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -2568,7 +2568,6 @@ nsGenericHTMLElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, return NS_OK; } -#ifdef IBMBIDI /** * Handle attributes on the BDO element */ @@ -2582,17 +2581,14 @@ MapBdoAttributesInto(const nsIHTMLMappedAttributes* aAttributes, } nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } -#endif // IBMBIDI NS_IMETHODIMP nsGenericHTMLElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const { -#ifdef IBMBIDI if (mNodeInfo->Equals(nsHTMLAtoms::bdo)) aMapRuleFunc = &MapBdoAttributesInto; else -#endif // IBMBIDI - aMapRuleFunc = &MapCommonAttributesInto; + aMapRuleFunc = &MapCommonAttributesInto; return NS_OK; } diff --git a/mozilla/content/html/content/src/nsHTMLAtomList.h b/mozilla/content/html/content/src/nsHTMLAtomList.h index 5ccc26cff1d..216b133bec9 100644 --- a/mozilla/content/html/content/src/nsHTMLAtomList.h +++ b/mozilla/content/html/content/src/nsHTMLAtomList.h @@ -72,9 +72,7 @@ HTML_ATOM(axis, "axis") HTML_ATOM(background, "background") HTML_ATOM(base, "base") HTML_ATOM(below, "below") -#ifdef IBMBIDI HTML_ATOM(bdo, "bdo") -#endif HTML_ATOM(bgcolor, "bgcolor") HTML_ATOM(big, "big") HTML_ATOM(blockquote, "blockquote") diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 48b4e978799..b232927cbf8 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -131,9 +131,7 @@ #include "nsIPrompt.h" //AHMED 12-2 -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif #include "nsIEditingSession.h" @@ -307,9 +305,7 @@ nsHTMLDocument::nsHTMLDocument() mWriteLevel = 0; mWyciwygSessionCnt = 0; -#ifdef IBMBIDI mTexttype = IBMBIDI_TEXTTYPE_LOGICAL; -#endif if (gRefCntRDFService++ == 0) { @@ -875,7 +871,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, nsCOMPtr dcInfo; docShell->GetDocumentCharsetInfo(getter_AddRefs(dcInfo)); -#ifdef IBMBIDI nsCOMPtr cx; docShell->GetPresContext(getter_AddRefs(cx)); if(cx){ @@ -883,7 +878,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, cx->GetBidi(&mBidiOption); mTexttype = GET_BIDI_OPTION_TEXTTYPE(mBidiOption); } -#endif // IBMBIDI // // The following logic is mirrored in nsWebShell::Embed! // @@ -975,11 +969,9 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, #endif //ahmed -#ifdef IBMBIDI // Check if 864 but in Implicit mode ! if( (mTexttype == IBMBIDI_TEXTTYPE_LOGICAL)&&(charset.EqualsIgnoreCase("ibm864")) ) charset.Assign(NS_LITERAL_STRING("IBM864i")); -#endif // IBMBIDI SetDocumentCharacterSet(charset); SetDocumentCharacterSetSource(charsetSource); diff --git a/mozilla/content/html/document/src/nsHTMLDocument.h b/mozilla/content/html/document/src/nsHTMLDocument.h index d7113d30906..a43c988fae1 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.h +++ b/mozilla/content/html/document/src/nsHTMLDocument.h @@ -274,9 +274,7 @@ protected: PRInt32 mNumForms; //ahmed 12-2 -#ifdef IBMBIDI PRInt32 mTexttype; -#endif static nsrefcnt gRefCntRDFService; static nsIRDFService* gRDF; diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index 21dfe693487..88d21e667f1 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -2264,10 +2264,8 @@ MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRul if (aText.mDecoration.GetUnit() == eCSSUnit_Null && ourText->mDecoration.GetUnit() != eCSSUnit_Null) aText.mDecoration = ourText->mDecoration; -#ifdef IBMBIDI if (aText.mUnicodeBidi.GetUnit() == eCSSUnit_Null && ourText->mUnicodeBidi.GetUnit() != eCSSUnit_Null) aText.mUnicodeBidi = ourText->mUnicodeBidi; -#endif } return NS_OK; diff --git a/mozilla/content/html/style/src/nsComputedDOMStyle.cpp b/mozilla/content/html/style/src/nsComputedDOMStyle.cpp index da99794db63..9c5cf771a27 100644 --- a/mozilla/content/html/style/src/nsComputedDOMStyle.cpp +++ b/mozilla/content/html/style/src/nsComputedDOMStyle.cpp @@ -1757,7 +1757,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame, nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue(); NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY); -#ifdef IBMBIDI const nsStyleTextReset *text = nsnull; GetStyleData(eStyleStruct_TextReset, (const nsStyleStruct*&)text, aFrame); @@ -1769,9 +1768,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame, } else { val->SetIdent(NS_LITERAL_STRING("normal")); } -#else // IBMBIDI - val->SetIdent(NS_LITERAL_STRING("normal")); -#endif // IBMBIDI return CallQueryInterface(val, aValue); } diff --git a/mozilla/content/shared/public/Makefile.in b/mozilla/content/shared/public/Makefile.in index d2e078b13a5..c9c8dc45f23 100644 --- a/mozilla/content/shared/public/Makefile.in +++ b/mozilla/content/shared/public/Makefile.in @@ -29,6 +29,7 @@ include $(DEPTH)/config/autoconf.mk MODULE = content EXPORTS = \ +nsBidiUtils.h \ nsChangeHint.h \ nsCSSAnonBoxList.h \ nsCSSAnonBoxes.h \ @@ -63,8 +64,4 @@ ifdef MOZ_SVG EXPORTS += nsSVGAtomList.h nsSVGAtoms.h endif -ifdef IBMBIDI -EXPORTS += nsBidiUtils.h -endif - include $(topsrcdir)/config/rules.mk diff --git a/mozilla/content/shared/public/nsHTMLAtomList.h b/mozilla/content/shared/public/nsHTMLAtomList.h index 5ccc26cff1d..216b133bec9 100644 --- a/mozilla/content/shared/public/nsHTMLAtomList.h +++ b/mozilla/content/shared/public/nsHTMLAtomList.h @@ -72,9 +72,7 @@ HTML_ATOM(axis, "axis") HTML_ATOM(background, "background") HTML_ATOM(base, "base") HTML_ATOM(below, "below") -#ifdef IBMBIDI HTML_ATOM(bdo, "bdo") -#endif HTML_ATOM(bgcolor, "bgcolor") HTML_ATOM(big, "big") HTML_ATOM(blockquote, "blockquote") diff --git a/mozilla/content/shared/public/nsLayoutAtomList.h b/mozilla/content/shared/public/nsLayoutAtomList.h index 08bdfce3bb7..57a076e801f 100644 --- a/mozilla/content/shared/public/nsLayoutAtomList.h +++ b/mozilla/content/shared/public/nsLayoutAtomList.h @@ -206,14 +206,12 @@ LAYOUT_ATOM(mozdirty, "_moz_dirty") LAYOUT_ATOM(stylesheet, "stylesheet") LAYOUT_ATOM(transform, "transform") -#ifdef IBMBIDI LAYOUT_ATOM(directionalFrame, "DirectionalFrame") LAYOUT_ATOM(baseLevel, "BaseLevel") // PRUint8 LAYOUT_ATOM(embeddingLevel, "EmbeddingLevel") // PRUint8 LAYOUT_ATOM(endsInDiacritic, "EndsInDiacritic") // PRUint32 LAYOUT_ATOM(nextBidi, "NextBidi") // nsIFrame* LAYOUT_ATOM(charType, "charType") // PRUint8 -#endif #ifdef DEBUG // Alphabetical list of atoms used by debugging code diff --git a/mozilla/content/shared/public/nsStyleStruct.h b/mozilla/content/shared/public/nsStyleStruct.h index 0fbd1df1ddf..d832286c13d 100644 --- a/mozilla/content/shared/public/nsStyleStruct.h +++ b/mozilla/content/shared/public/nsStyleStruct.h @@ -633,9 +633,7 @@ struct nsStyleTextReset : public nsStyleStruct { nsChangeHint CalcDifference(const nsStyleTextReset& aOther) const; PRUint8 mTextDecoration; // [reset] see nsStyleConsts.h -#ifdef IBMBIDI PRUint8 mUnicodeBidi; // [reset] see nsStyleConsts.h -#endif // IBMBIDI nsStyleCoord mVerticalAlign; // [reset] see nsStyleConsts.h for enums }; diff --git a/mozilla/content/shared/public/nsTextFragment.h b/mozilla/content/shared/public/nsTextFragment.h index 7471a427338..ee081113d04 100644 --- a/mozilla/content/shared/public/nsTextFragment.h +++ b/mozilla/content/shared/public/nsTextFragment.h @@ -139,7 +139,6 @@ public: return mState.mIs2b; } -#ifdef IBMBIDI /** * Return PR_TRUE if this fragment contains Bidi text * For performance reasons this flag is not set automatically, but @@ -149,8 +148,6 @@ public: { return mState.mIsBidi; } -#endif - /** * Get a pointer to constant PRUnichar data. @@ -240,13 +237,11 @@ public: return mState.mIs2b ? m2b[aIndex] : PRUnichar(m1b[aIndex]); } -#ifdef IBMBIDI /** * Scan the contents of the fragment and turn on mState.mIsBidi if it * includes any Bidi characters. */ void SetBidiFlag(); -#endif struct FragmentBits { PRBool mInHeap : 1; diff --git a/mozilla/content/shared/src/nsBidiUtils.cpp b/mozilla/content/shared/src/nsBidiUtils.cpp index 111eb81a1db..e0404768dec 100644 --- a/mozilla/content/shared/src/nsBidiUtils.cpp +++ b/mozilla/content/shared/src/nsBidiUtils.cpp @@ -23,7 +23,6 @@ * Simon Montagu * Roozbeh Pournader */ -#ifdef IBMBIDI #include "nsBidiUtils.h" #define FE_TO_06_OFFSET 0xfe70 @@ -522,4 +521,3 @@ nsresult HandleNumbers(const nsString& aSrc, nsString& aDst) return HandleNumbers((PRUnichar *)aDst.get(),aDst.Length(), IBMBIDI_NUMERAL_REGULAR); } -#endif //IBMBIDI diff --git a/mozilla/content/shared/src/nsStyleStruct.cpp b/mozilla/content/shared/src/nsStyleStruct.cpp index 8f9563f8dbd..51a4616708e 100644 --- a/mozilla/content/shared/src/nsStyleStruct.cpp +++ b/mozilla/content/shared/src/nsStyleStruct.cpp @@ -53,9 +53,7 @@ #include "nsLayoutAtoms.h" #include "prenv.h" -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif inline PRBool IsFixedUnit(nsStyleUnit aUnit, PRBool aEnumOK) { @@ -1086,16 +1084,12 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const nsStyleVisibility::nsStyleVisibility(nsIPresContext* aPresContext) { -#ifdef IBMBIDI PRUint32 bidiOptions; aPresContext->GetBidi(&bidiOptions); if (GET_BIDI_OPTION_DIRECTION(bidiOptions) == IBMBIDI_TEXTDIRECTION_RTL) mDirection = NS_STYLE_DIRECTION_RTL; else mDirection = NS_STYLE_DIRECTION_LTR; -#else - mDirection = NS_STYLE_DIRECTION_LTR; -#endif // IBMBIDI aPresContext->GetLanguage(getter_AddRefs(mLanguage)); mVisible = NS_STYLE_VISIBILITY_VISIBLE; @@ -1280,9 +1274,7 @@ nsStyleTextReset::nsStyleTextReset(void) { mVerticalAlign.SetIntValue(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated); mTextDecoration = NS_STYLE_TEXT_DECORATION_NONE; -#ifdef IBMBIDI mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL; -#endif // IBMBIDI } nsStyleTextReset::nsStyleTextReset(const nsStyleTextReset& aSource) @@ -1295,10 +1287,7 @@ nsStyleTextReset::~nsStyleTextReset(void) { } nsChangeHint nsStyleTextReset::CalcDifference(const nsStyleTextReset& aOther) const { if (mVerticalAlign == aOther.mVerticalAlign -#ifdef IBMBIDI - && mUnicodeBidi == aOther.mUnicodeBidi -#endif // IBMBIDI - ) { + && mUnicodeBidi == aOther.mUnicodeBidi) { if (mTextDecoration != aOther.mTextDecoration) return NS_STYLE_HINT_VISUAL; return NS_STYLE_HINT_NONE; diff --git a/mozilla/content/shared/src/nsTextFragment.cpp b/mozilla/content/shared/src/nsTextFragment.cpp index 8236601013e..b93621494aa 100644 --- a/mozilla/content/shared/src/nsTextFragment.cpp +++ b/mozilla/content/shared/src/nsTextFragment.cpp @@ -40,9 +40,7 @@ #include "nsCRT.h" #include "nsReadableUtils.h" #include "nsMemory.h" -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif // Static buffer used for newline fragments static unsigned char sNewLineCharacter = '\n'; @@ -344,7 +342,6 @@ nsTextFragment::CopyTo(char *aDest, PRInt32 aOffset, PRInt32 aCount) } } -#ifdef IBMBIDI // To save time we only do this when we really want to know, not during // every allocation void @@ -362,4 +359,3 @@ nsTextFragment::SetBidiFlag() } } } -#endif diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 1675a57c0c0..dc673b389f4 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -429,9 +429,7 @@ nsXULDocument::nsXULDocument(void) nsCOMPtr observer(do_QueryInterface(mBindingManager)); if (observer) // We must always be the first observer of the document. mObservers.InsertElementAt(observer, 0); -#ifdef IBMBIDI mBidiEnabled = PR_FALSE; -#endif // IBMBIDI mSubDocuments = nsnull; } @@ -6995,7 +6993,6 @@ nsXULDocument::GetFocusController(nsIFocusController** aFocusController) *aFocusController = nsnull; } -#ifdef IBMBIDI /** * Retrieve and get bidi state of the document * set depending on presence of bidi data. @@ -7019,7 +7016,6 @@ nsXULDocument::SetBidiEnabled(PRBool aBidiEnabled) } return NS_OK; } -#endif // IBMBIDI //---------------------------------------------------------------------- diff --git a/mozilla/content/xul/document/src/nsXULDocument.h b/mozilla/content/xul/document/src/nsXULDocument.h index a040017d831..84a4f8c6d37 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.h +++ b/mozilla/content/xul/document/src/nsXULDocument.h @@ -194,14 +194,12 @@ public: NS_IMETHOD GetContentLanguage(nsAString& aContentLanguage) const; -#ifdef IBMBIDI /** * Retrieve and get bidi state of the document * (set depending on presence of bidi data). */ NS_IMETHOD GetBidiEnabled(PRBool* aBidiEnabled) const; NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled); -#endif // IBMBIDI NS_IMETHOD AddCharSetObserver(nsIObserver* aObserver); NS_IMETHOD RemoveCharSetObserver(nsIObserver* aObserver); @@ -592,9 +590,7 @@ protected: PRInt32 mNextContentID; PRInt32 mNumCapturers; //Number of capturing event handlers in doc. Used to optimize event delivery. -#ifdef IBMBIDI PRBool mBidiEnabled; -#endif // IBMBIDI /* * XXX dr diff --git a/mozilla/layout/base/nsBidiUtils.cpp b/mozilla/layout/base/nsBidiUtils.cpp index 111eb81a1db..e0404768dec 100644 --- a/mozilla/layout/base/nsBidiUtils.cpp +++ b/mozilla/layout/base/nsBidiUtils.cpp @@ -23,7 +23,6 @@ * Simon Montagu * Roozbeh Pournader */ -#ifdef IBMBIDI #include "nsBidiUtils.h" #define FE_TO_06_OFFSET 0xfe70 @@ -522,4 +521,3 @@ nsresult HandleNumbers(const nsString& aSrc, nsString& aDst) return HandleNumbers((PRUnichar *)aDst.get(),aDst.Length(), IBMBIDI_NUMERAL_REGULAR); } -#endif //IBMBIDI diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index 22326c925a1..2e7a0120415 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -191,9 +191,7 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printset #include "nsIDOMFocusListener.h" #include "nsISelectionController.h" -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif static NS_DEFINE_CID(kPresShellCID, NS_PRESSHELL_CID); static NS_DEFINE_CID(kGalleyContextCID, NS_GALLEYCONTEXT_CID); @@ -2499,193 +2497,161 @@ NS_IMETHODIMP DocumentViewerImpl::SetHintCharacterSet(const PRUnichar* aHintChar return CallChildren(SetChildHintCharacterSet, (void*) aHintCharacterSet); } -#ifdef IBMBIDI static void SetChildBidiOptions(nsIMarkupDocumentViewer* aChild, void* aClosure) { aChild->SetBidiOptions(NS_PTR_TO_INT32(aClosure)); } -#endif // IBMBIDI - NS_IMETHODIMP DocumentViewerImpl::SetBidiTextDirection(PRUint8 aTextDirection) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_DIRECTION(bidiOptions, aTextDirection); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiTextDirection(PRUint8* aTextDirection) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aTextDirection) { GetBidiOptions(&bidiOptions); *aTextDirection = GET_BIDI_OPTION_DIRECTION(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiTextType(PRUint8 aTextType) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_TEXTTYPE(bidiOptions, aTextType); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiTextType(PRUint8* aTextType) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aTextType) { GetBidiOptions(&bidiOptions); *aTextType = GET_BIDI_OPTION_TEXTTYPE(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiControlsTextMode(PRUint8 aControlsTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions, aControlsTextMode); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiControlsTextMode(PRUint8* aControlsTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aControlsTextMode) { GetBidiOptions(&bidiOptions); *aControlsTextMode = GET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiClipboardTextMode(PRUint8 aClipboardTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions, aClipboardTextMode); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiClipboardTextMode(PRUint8* aClipboardTextMode) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aClipboardTextMode) { GetBidiOptions(&bidiOptions); *aClipboardTextMode = GET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiNumeral(PRUint8 aNumeral) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_NUMERAL(bidiOptions, aNumeral); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiNumeral(PRUint8* aNumeral) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aNumeral) { GetBidiOptions(&bidiOptions); *aNumeral = GET_BIDI_OPTION_NUMERAL(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiSupport(PRUint8 aSupport) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_SUPPORT(bidiOptions, aSupport); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiSupport(PRUint8* aSupport) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aSupport) { GetBidiOptions(&bidiOptions); *aSupport = GET_BIDI_OPTION_SUPPORT(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiCharacterSet(PRUint8 aCharacterSet) { -#ifdef IBMBIDI PRUint32 bidiOptions; GetBidiOptions(&bidiOptions); SET_BIDI_OPTION_CHARACTERSET(bidiOptions, aCharacterSet); SetBidiOptions(bidiOptions); -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiCharacterSet(PRUint8* aCharacterSet) { -#ifdef IBMBIDI PRUint32 bidiOptions; if (aCharacterSet) { GetBidiOptions(&bidiOptions); *aCharacterSet = GET_BIDI_OPTION_CHARACTERSET(bidiOptions); } -#endif return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions) { -#ifdef IBMBIDI if (mPresContext) { #if 1 // forcing reflow will cause bug 80352. Temp turn off force reflow and @@ -2697,13 +2663,11 @@ NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions) } // now set bidi on all children of mContainer CallChildren(SetChildBidiOptions, (void*) aBidiOptions); -#endif // IBMBIDI return NS_OK; } NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions) { -#ifdef IBMBIDI if (aBidiOptions) { if (mPresContext) { mPresContext->GetBidi(aBidiOptions); @@ -2711,7 +2675,6 @@ NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions) else *aBidiOptions = IBMBIDI_DEFAULT_BIDI_OPTIONS; } -#endif // IBMBIDI return NS_OK; } diff --git a/mozilla/layout/base/nsLayoutAtomList.h b/mozilla/layout/base/nsLayoutAtomList.h index 08bdfce3bb7..57a076e801f 100644 --- a/mozilla/layout/base/nsLayoutAtomList.h +++ b/mozilla/layout/base/nsLayoutAtomList.h @@ -206,14 +206,12 @@ LAYOUT_ATOM(mozdirty, "_moz_dirty") LAYOUT_ATOM(stylesheet, "stylesheet") LAYOUT_ATOM(transform, "transform") -#ifdef IBMBIDI LAYOUT_ATOM(directionalFrame, "DirectionalFrame") LAYOUT_ATOM(baseLevel, "BaseLevel") // PRUint8 LAYOUT_ATOM(embeddingLevel, "EmbeddingLevel") // PRUint8 LAYOUT_ATOM(endsInDiacritic, "EndsInDiacritic") // PRUint32 LAYOUT_ATOM(nextBidi, "NextBidi") // nsIFrame* LAYOUT_ATOM(charType, "charType") // PRUint8 -#endif #ifdef DEBUG // Alphabetical list of atoms used by debugging code diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index df15ac78f02..ac72cbcdd4b 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -253,10 +253,8 @@ public: nsDirection GetDirection(){return mDirection;} void SetDirection(nsDirection aDir){mDirection = aDir;} -#ifdef IBMBIDI PRBool GetTrueDirection() {return mTrueDirection;} void SetTrueDirection(PRBool aBool){mTrueDirection = aBool;} -#endif NS_IMETHOD CopyRangeToAnchorFocus(nsIDOMRange *aRange); @@ -310,9 +308,7 @@ private: SelectionType mType;//type of this nsTypedSelection; nsAutoScrollTimer *mAutoScrollTimer; // timer for autoscrolling. nsCOMArray mSelectionListeners; -#ifdef IBMBIDI PRBool mTrueDirection; -#endif nsCOMPtr mEventQueue; PRBool mScrollEventPosted; }; @@ -389,7 +385,6 @@ public: NS_IMETHOD GetLimiter(nsIContent **aLimiterContent); NS_IMETHOD SetMouseDoubleDown(PRBool aDoubleDown); NS_IMETHOD GetMouseDoubleDown(PRBool *aDoubleDown); -#ifdef IBMBIDI NS_IMETHOD GetPrevNextBidiLevels(nsIPresContext *aPresContext, nsIContent *aNode, PRUint32 aContentOffset, @@ -403,7 +398,6 @@ public: PRUint8 aBidiLevel, nsIFrame **aFrameOut); -#endif // IBMBIDI /*END nsIFrameSelection interfacse*/ @@ -421,7 +415,6 @@ private: NS_IMETHOD TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, PRUint32 aContentEndOffset, PRBool aContinueSelection, PRBool aMultipleSelection); -#ifdef IBMBIDI void BidiLevelFromMove(nsIPresContext* aContext, nsIPresShell* aPresShell, nsIContent *aNode, @@ -452,7 +445,6 @@ private: PRInt32 aCurrentOffset, nsPeekOffsetStruct aPos); #endif // VISUALSELECTION -#endif // IBMBIDI //post and pop reasons for notifications. we may stack these later void PostReason(short aReason){mReason = aReason;} @@ -1560,7 +1552,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA // SetDesiredX(desiredX); } -#ifdef IBMBIDI nsCOMPtr caret; nsCOMPtr shell; result = context->GetShell(getter_AddRefs(shell)); @@ -1569,7 +1560,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA result = shell->GetCaret(getter_AddRefs(caret)); if (NS_FAILED(result) || !caret) return 0; -#endif offsetused = mDomSelections[index]->FetchFocusOffset(); weakNodeUsed = mDomSelections[index]->FetchFocusNode(); @@ -1645,7 +1635,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA if (NS_SUCCEEDED(result) && NS_SUCCEEDED(result = frame->PeekOffset(context, &pos)) && pos.mResultContent) { tHint = (HINT)pos.mPreferLeft; -#ifdef IBMBIDI PRBool bidiEnabled = PR_FALSE; context->GetBidiEnabled(&bidiEnabled); if (bidiEnabled) @@ -1715,7 +1704,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA #else } #endif // VISUALSELECTION -#endif // IBMBIDI result = TakeFocus(pos.mResultContent, pos.mContentOffset, pos.mContentOffset, aContinue, PR_FALSE); } if (NS_SUCCEEDED(result)) @@ -1846,7 +1834,6 @@ nsTypedSelection::GetInterlinePosition(PRBool *aHintRight) return rv; } -#ifdef IBMBIDI nsDirection ReverseDirection(nsDirection aDirection) { return (eDirNext == aDirection) ? eDirPrevious : eDirNext; @@ -2580,7 +2567,6 @@ void nsSelection::BidiLevelFromClick(nsIContent *aNode, PRUint32 aContentOffset) (void**)&frameLevel, sizeof(frameLevel) ); shell->SetCaretBidiLevel(frameLevel); } -#endif //IBMBIDI NS_IMETHODIMP nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset, @@ -2595,9 +2581,7 @@ nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset, // Don't take focus when dragging off of a table if (!mDragSelectingCells) { -#ifdef IBMBIDI BidiLevelFromClick(aNewFocus, aContentOffset); -#endif PostReason(nsISelectionListener::MOUSEDOWN_REASON + nsISelectionListener::DRAG_REASON); return TakeFocus(aNewFocus, aContentOffset, aContentEndOffset, aContinueSelection, aMultipleSelection); } @@ -2709,7 +2693,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint& if (NS_SUCCEEDED(result)) { -#ifdef IBMBIDI #ifdef VISUALSELECTION PRBool bidiEnabled = PR_FALSE; aPresContext->GetBidiEnabled(&bidiEnabled); @@ -2736,7 +2719,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint& } else #endif // VISUALSELECTION -#endif // IBMBIDI result = HandleClick(newContent, startPos, contentOffsetEnd, PR_TRUE, PR_FALSE, beginOfContent); } @@ -2816,12 +2798,8 @@ nsSelection::TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, mBatching = batching; mChangesDuringBatching = changes; } -#ifdef IBMBIDI if (aContentEndOffset != aContentOffset) -#else - if (aContentEndOffset > aContentOffset) -#endif // IBMBIDI - mDomSelections[index]->Extend(domNode,aContentEndOffset); + mDomSelections[index]->Extend(domNode,aContentEndOffset); //find out if we are inside a table. if so, find out which one and which cell //once we do that, the next time we get a takefocus, check the parent tree. @@ -7855,7 +7833,6 @@ nsTypedSelection::DeleteFromDocument() NS_IMETHODIMP nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL) { -#ifdef IBMBIDI nsresult result; nsCOMPtr focusNode; nsCOMPtr focusContent; @@ -7927,6 +7904,5 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL) else shell->SetCaretBidiLevel(levelAfter); } -#endif // IBMBIDI return NS_OK; } diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index 21dfe693487..88d21e667f1 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -2264,10 +2264,8 @@ MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRul if (aText.mDecoration.GetUnit() == eCSSUnit_Null && ourText->mDecoration.GetUnit() != eCSSUnit_Null) aText.mDecoration = ourText->mDecoration; -#ifdef IBMBIDI if (aText.mUnicodeBidi.GetUnit() == eCSSUnit_Null && ourText->mUnicodeBidi.GetUnit() != eCSSUnit_Null) aText.mUnicodeBidi = ourText->mUnicodeBidi; -#endif } return NS_OK; diff --git a/mozilla/layout/style/nsComputedDOMStyle.cpp b/mozilla/layout/style/nsComputedDOMStyle.cpp index da99794db63..9c5cf771a27 100644 --- a/mozilla/layout/style/nsComputedDOMStyle.cpp +++ b/mozilla/layout/style/nsComputedDOMStyle.cpp @@ -1757,7 +1757,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame, nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue(); NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY); -#ifdef IBMBIDI const nsStyleTextReset *text = nsnull; GetStyleData(eStyleStruct_TextReset, (const nsStyleStruct*&)text, aFrame); @@ -1769,9 +1768,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame, } else { val->SetIdent(NS_LITERAL_STRING("normal")); } -#else // IBMBIDI - val->SetIdent(NS_LITERAL_STRING("normal")); -#endif // IBMBIDI return CallQueryInterface(val, aValue); } diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index daa48117cd7..84ca6fa8a74 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -2506,7 +2506,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, text->mTextDecoration = parentText->mTextDecoration; } -#ifdef IBMBIDI // unicode-bidi: enum, normal, inherit if (eCSSUnit_Normal == textData.mUnicodeBidi.GetUnit() ) { text->mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL; @@ -2518,7 +2517,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData, inherited = PR_TRUE; text->mUnicodeBidi = parentText->mUnicodeBidi; } -#endif // IBMBIDI if (inherited) // We inherited, and therefore can't be cached in the rule node. We have to be put right on the @@ -3058,10 +3056,8 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct, // direction: enum, inherit if (eCSSUnit_Enumerated == displayData.mDirection.GetUnit()) { visibility->mDirection = displayData.mDirection.GetIntValue(); -#ifdef IBMBIDI if (NS_STYLE_DIRECTION_RTL == visibility->mDirection) mPresContext->SetBidiEnabled(PR_TRUE); -#endif // IBMBIDI } else if (eCSSUnit_Inherit == displayData.mDirection.GetUnit()) { inherited = PR_TRUE; diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index 8f9563f8dbd..51a4616708e 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -53,9 +53,7 @@ #include "nsLayoutAtoms.h" #include "prenv.h" -#ifdef IBMBIDI #include "nsBidiUtils.h" -#endif inline PRBool IsFixedUnit(nsStyleUnit aUnit, PRBool aEnumOK) { @@ -1086,16 +1084,12 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const nsStyleVisibility::nsStyleVisibility(nsIPresContext* aPresContext) { -#ifdef IBMBIDI PRUint32 bidiOptions; aPresContext->GetBidi(&bidiOptions); if (GET_BIDI_OPTION_DIRECTION(bidiOptions) == IBMBIDI_TEXTDIRECTION_RTL) mDirection = NS_STYLE_DIRECTION_RTL; else mDirection = NS_STYLE_DIRECTION_LTR; -#else - mDirection = NS_STYLE_DIRECTION_LTR; -#endif // IBMBIDI aPresContext->GetLanguage(getter_AddRefs(mLanguage)); mVisible = NS_STYLE_VISIBILITY_VISIBLE; @@ -1280,9 +1274,7 @@ nsStyleTextReset::nsStyleTextReset(void) { mVerticalAlign.SetIntValue(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated); mTextDecoration = NS_STYLE_TEXT_DECORATION_NONE; -#ifdef IBMBIDI mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL; -#endif // IBMBIDI } nsStyleTextReset::nsStyleTextReset(const nsStyleTextReset& aSource) @@ -1295,10 +1287,7 @@ nsStyleTextReset::~nsStyleTextReset(void) { } nsChangeHint nsStyleTextReset::CalcDifference(const nsStyleTextReset& aOther) const { if (mVerticalAlign == aOther.mVerticalAlign -#ifdef IBMBIDI - && mUnicodeBidi == aOther.mUnicodeBidi -#endif // IBMBIDI - ) { + && mUnicodeBidi == aOther.mUnicodeBidi) { if (mTextDecoration != aOther.mTextDecoration) return NS_STYLE_HINT_VISUAL; return NS_STYLE_HINT_NONE; diff --git a/mozilla/layout/style/nsStyleStruct.h b/mozilla/layout/style/nsStyleStruct.h index 0fbd1df1ddf..d832286c13d 100644 --- a/mozilla/layout/style/nsStyleStruct.h +++ b/mozilla/layout/style/nsStyleStruct.h @@ -633,9 +633,7 @@ struct nsStyleTextReset : public nsStyleStruct { nsChangeHint CalcDifference(const nsStyleTextReset& aOther) const; PRUint8 mTextDecoration; // [reset] see nsStyleConsts.h -#ifdef IBMBIDI PRUint8 mUnicodeBidi; // [reset] see nsStyleConsts.h -#endif // IBMBIDI nsStyleCoord mVerticalAlign; // [reset] see nsStyleConsts.h for enums };