Make all nsBidiPresUtils methods static. Bug 624798, r=roc
This commit is contained in:
@@ -2804,19 +2804,15 @@ nsLayoutUtils::DrawString(const nsIFrame* aFrame,
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
if (presContext->BidiEnabled()) {
|
||||
nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
|
||||
|
||||
if (bidiUtils) {
|
||||
if (aDirection == NS_STYLE_DIRECTION_INHERIT) {
|
||||
aDirection = aFrame->GetStyleVisibility()->mDirection;
|
||||
}
|
||||
nsBidiDirection direction =
|
||||
(NS_STYLE_DIRECTION_RTL == aDirection) ?
|
||||
NSBIDI_RTL : NSBIDI_LTR;
|
||||
rv = bidiUtils->RenderText(aString, aLength, direction,
|
||||
presContext, *aContext, *aContext,
|
||||
aPoint.x, aPoint.y);
|
||||
if (aDirection == NS_STYLE_DIRECTION_INHERIT) {
|
||||
aDirection = aFrame->GetStyleVisibility()->mDirection;
|
||||
}
|
||||
nsBidiDirection direction =
|
||||
(NS_STYLE_DIRECTION_RTL == aDirection) ?
|
||||
NSBIDI_RTL : NSBIDI_LTR;
|
||||
rv = nsBidiPresUtils::RenderText(aString, aLength, direction,
|
||||
presContext, *aContext, *aContext,
|
||||
aPoint.x, aPoint.y);
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
#endif // IBMBIDI
|
||||
@@ -2835,16 +2831,12 @@ nsLayoutUtils::GetStringWidth(const nsIFrame* aFrame,
|
||||
#ifdef IBMBIDI
|
||||
nsPresContext* presContext = aFrame->PresContext();
|
||||
if (presContext->BidiEnabled()) {
|
||||
nsBidiPresUtils* bidiUtils = presContext->GetBidiUtils();
|
||||
|
||||
if (bidiUtils) {
|
||||
const nsStyleVisibility* vis = aFrame->GetStyleVisibility();
|
||||
nsBidiDirection direction =
|
||||
(NS_STYLE_DIRECTION_RTL == vis->mDirection) ?
|
||||
NSBIDI_RTL : NSBIDI_LTR;
|
||||
return bidiUtils->MeasureTextWidth(aString, aLength,
|
||||
direction, presContext, *aContext);
|
||||
}
|
||||
const nsStyleVisibility* vis = aFrame->GetStyleVisibility();
|
||||
nsBidiDirection direction =
|
||||
(NS_STYLE_DIRECTION_RTL == vis->mDirection) ?
|
||||
NSBIDI_RTL : NSBIDI_LTR;
|
||||
return nsBidiPresUtils::MeasureTextWidth(aString, aLength,
|
||||
direction, presContext, *aContext);
|
||||
}
|
||||
#endif // IBMBIDI
|
||||
aContext->SetTextRunRTL(PR_FALSE);
|
||||
|
||||
Reference in New Issue
Block a user