зеркало из https://github.com/mozilla/pjs.git
Fix for bug 81032, "nsOutlinerBodyFrame.cpp need to be bidi enable". r=mkaply, sr=hyatt, a=asa
This commit is contained in:
Родитель
74b23f7c19
Коммит
b613689038
|
@ -86,6 +86,7 @@
|
|||
#include "nsChildIterator.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsITheme.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#ifdef USE_IMG2
|
||||
#include "imgIRequest.h"
|
||||
|
@ -94,6 +95,10 @@
|
|||
#include "imgILoader.h"
|
||||
#endif
|
||||
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiPresUtils.h"
|
||||
#endif
|
||||
|
||||
#define ELLIPSIS "..."
|
||||
|
||||
// The style context cache impl
|
||||
|
@ -2713,9 +2718,34 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintText(int aRowIndex,
|
|||
fontMet->GetStrikeout(offset, size);
|
||||
aRenderingContext.FillRect(textRect.x, textRect.y + baseline - offset, width, size);
|
||||
}
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_START_TIMER("Render Outline Text");
|
||||
#endif
|
||||
#ifdef IBMBIDI
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsBidiPresUtils* bidiUtils;
|
||||
aPresContext->GetBidiUtils(&bidiUtils);
|
||||
|
||||
if (bidiUtils) {
|
||||
const nsStyleVisibility* vis;
|
||||
GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&) vis);
|
||||
nsBidiDirection direction =
|
||||
(NS_STYLE_DIRECTION_RTL == vis->mDirection) ?
|
||||
NSBIDI_RTL : NSBIDI_LTR;
|
||||
PRUnichar* buffer = (PRUnichar*) text.get();
|
||||
rv = bidiUtils->RenderText(buffer, text.Length(), direction,
|
||||
aPresContext, aRenderingContext,
|
||||
textRect.x, textRect.y + baseline);
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
#endif // IBMBIDI
|
||||
aRenderingContext.DrawString(text, textRect.x, textRect.y + baseline);
|
||||
}
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_STOP_TIMER("Render Outline Text");
|
||||
NS_TIMELINE_MARK_TIMER("Render Outline Text");
|
||||
#endif
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
#include "nsChildIterator.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsITheme.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#ifdef USE_IMG2
|
||||
#include "imgIRequest.h"
|
||||
|
@ -94,6 +95,10 @@
|
|||
#include "imgILoader.h"
|
||||
#endif
|
||||
|
||||
#ifdef IBMBIDI
|
||||
#include "nsBidiPresUtils.h"
|
||||
#endif
|
||||
|
||||
#define ELLIPSIS "..."
|
||||
|
||||
// The style context cache impl
|
||||
|
@ -2713,9 +2718,34 @@ NS_IMETHODIMP nsOutlinerBodyFrame::PaintText(int aRowIndex,
|
|||
fontMet->GetStrikeout(offset, size);
|
||||
aRenderingContext.FillRect(textRect.x, textRect.y + baseline - offset, width, size);
|
||||
}
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_START_TIMER("Render Outline Text");
|
||||
#endif
|
||||
#ifdef IBMBIDI
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsBidiPresUtils* bidiUtils;
|
||||
aPresContext->GetBidiUtils(&bidiUtils);
|
||||
|
||||
if (bidiUtils) {
|
||||
const nsStyleVisibility* vis;
|
||||
GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&) vis);
|
||||
nsBidiDirection direction =
|
||||
(NS_STYLE_DIRECTION_RTL == vis->mDirection) ?
|
||||
NSBIDI_RTL : NSBIDI_LTR;
|
||||
PRUnichar* buffer = (PRUnichar*) text.get();
|
||||
rv = bidiUtils->RenderText(buffer, text.Length(), direction,
|
||||
aPresContext, aRenderingContext,
|
||||
textRect.x, textRect.y + baseline);
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
#endif // IBMBIDI
|
||||
aRenderingContext.DrawString(text, textRect.x, textRect.y + baseline);
|
||||
}
|
||||
#ifdef MOZ_TIMELINE
|
||||
NS_TIMELINE_STOP_TIMER("Render Outline Text");
|
||||
NS_TIMELINE_MARK_TIMER("Render Outline Text");
|
||||
#endif
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче