r=rods, sr=watersin
Patch from simon montagu - cleanup combobox code in Bidi case
This commit is contained in:
mkaply%us.ibm.com 2001-10-31 14:49:15 +00:00
parent bbd9ace80f
commit 9c301478f8
2 changed files with 20 additions and 36 deletions

View File

@ -1083,27 +1083,19 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
const nsStyleVisibility* vis;
GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
if (vis->mDirection == NS_STYLE_DIRECTION_RTL)
{
if (vis->mDirection == NS_STYLE_DIRECTION_RTL) {
nscoord bidiScrolledAreaWidth = scrolledAreaDesiredSize.maxElementSize->width;
firstPassState.reason = eReflowReason_StyleChange;
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
if (aReflowState.mComputedWidth == NS_UNCONSTRAINEDSIZE)
{
if (needsVerticalScrollbar) {
bidiScrolledAreaWidth -= scrollbarWidth;
} else {
bidiScrolledAreaWidth = aReflowState.mComputedWidth - scrollbarWidth + (6 * p2t);
if (needsVerticalScrollbar) bidiScrolledAreaWidth -= scrollbarWidth;
}
bidiScrolledAreaWidth -= (aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right);
firstPassState.mComputedWidth = bidiScrolledAreaWidth;
firstPassState.availableWidth = bidiScrolledAreaWidth;
nsScrollFrame::Reflow(aPresContext, aDesiredSize, firstPassState, aStatus);
if (aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE) {
bidiScrolledAreaWidth = aReflowState.mComputedWidth;
}
if (needsVerticalScrollbar) {
bidiScrolledAreaWidth -= scrollbarWidth;
}
firstPassState.mComputedWidth = bidiScrolledAreaWidth;
firstPassState.availableWidth = bidiScrolledAreaWidth;
nsScrollFrame::Reflow(aPresContext, aDesiredSize, firstPassState, aStatus);
}
#endif // IBMBIDI

View File

@ -1083,27 +1083,19 @@ nsListControlFrame::Reflow(nsIPresContext* aPresContext,
const nsStyleVisibility* vis;
GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&)vis);
if (vis->mDirection == NS_STYLE_DIRECTION_RTL)
{
if (vis->mDirection == NS_STYLE_DIRECTION_RTL) {
nscoord bidiScrolledAreaWidth = scrolledAreaDesiredSize.maxElementSize->width;
firstPassState.reason = eReflowReason_StyleChange;
float p2t;
aPresContext->GetScaledPixelsToTwips(&p2t);
if (aReflowState.mComputedWidth == NS_UNCONSTRAINEDSIZE)
{
if (needsVerticalScrollbar) {
bidiScrolledAreaWidth -= scrollbarWidth;
} else {
bidiScrolledAreaWidth = aReflowState.mComputedWidth - scrollbarWidth + (6 * p2t);
if (needsVerticalScrollbar) bidiScrolledAreaWidth -= scrollbarWidth;
}
bidiScrolledAreaWidth -= (aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right);
firstPassState.mComputedWidth = bidiScrolledAreaWidth;
firstPassState.availableWidth = bidiScrolledAreaWidth;
nsScrollFrame::Reflow(aPresContext, aDesiredSize, firstPassState, aStatus);
if (aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE) {
bidiScrolledAreaWidth = aReflowState.mComputedWidth;
}
if (needsVerticalScrollbar) {
bidiScrolledAreaWidth -= scrollbarWidth;
}
firstPassState.mComputedWidth = bidiScrolledAreaWidth;
firstPassState.availableWidth = bidiScrolledAreaWidth;
nsScrollFrame::Reflow(aPresContext, aDesiredSize, firstPassState, aStatus);
}
#endif // IBMBIDI