Changed code that previously accessed mBorderStyle and mBorderColor with

new methods added in nsStyleSpacing


git-svn-id: svn://10.0.0.236/trunk@15929 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
1998-12-07 19:06:55 +00:00
parent 1abffa47d3
commit 9e86b8e8b4
2 changed files with 42 additions and 34 deletions

View File

@@ -446,10 +446,12 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
// XXX This should come from the default style sheet (ua.css), and
// not be hardcoded. Using solid causes the borders not to show up...
#if 1
aSpacingStyle.mBorderStyle[NS_SIDE_TOP] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.mBorderStyle[NS_SIDE_LEFT] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.mBorderStyle[NS_SIDE_BOTTOM] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.mBorderStyle[NS_SIDE_RIGHT] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_INSET);
aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_INSET);
aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_INSET);
aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_INSET);
#endif
nsTableFrame* tableFrame;
@@ -472,10 +474,12 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
if (borderColor == 0xFFFFFFFF)
borderColor = 0xFFC0C0C0;
aSpacingStyle.mBorderColor[NS_SIDE_TOP] =
aSpacingStyle.mBorderColor[NS_SIDE_LEFT] =
aSpacingStyle.mBorderColor[NS_SIDE_BOTTOM] =
aSpacingStyle.mBorderColor[NS_SIDE_RIGHT] = borderColor;
aSpacingStyle.SetBorderColor(NS_SIDE_TOP, borderColor);
aSpacingStyle.SetBorderColor(NS_SIDE_LEFT, borderColor);
aSpacingStyle.SetBorderColor(NS_SIDE_BOTTOM, borderColor);
aSpacingStyle.SetBorderColor(NS_SIDE_RIGHT, borderColor);
//adjust the border style based on the table rules attribute
const nsStyleTable* tableStyle;
@@ -484,10 +488,10 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
switch (tableStyle->mRules)
{
case NS_STYLE_TABLE_RULES_NONE:
aSpacingStyle.mBorderStyle[NS_SIDE_TOP] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_RIGHT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_BOTTOM] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_LEFT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_NONE);
break;
case NS_STYLE_TABLE_RULES_GROUPS:
// XXX: it depends on which cell this is!
@@ -499,13 +503,13 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
*/
break;
case NS_STYLE_TABLE_RULES_COLS:
aSpacingStyle.mBorderStyle[NS_SIDE_TOP] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_BOTTOM] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_NONE);
break;
case NS_STYLE_TABLE_RULES_ROWS:
aSpacingStyle.mBorderStyle[NS_SIDE_RIGHT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_LEFT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_NONE);
break;
// do nothing for "ALL" or for any illegal value
@@ -811,7 +815,7 @@ nsIFrame* nsTableCellFrame::CompareCellBorders(nsIFrame* aFrame1,
const nsStyleSpacing* border2;
aFrame1->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)border1);
aFrame2->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)border2);
if (border1->mBorderStyle[aEdge1] >= border2->mBorderStyle[aEdge2])
if (border1->GetBorderStyle(aEdge1) >= border2->GetBorderStyle(aEdge2))
result = aFrame1;
else
result = aFrame2;

View File

@@ -446,10 +446,12 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
// XXX This should come from the default style sheet (ua.css), and
// not be hardcoded. Using solid causes the borders not to show up...
#if 1
aSpacingStyle.mBorderStyle[NS_SIDE_TOP] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.mBorderStyle[NS_SIDE_LEFT] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.mBorderStyle[NS_SIDE_BOTTOM] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.mBorderStyle[NS_SIDE_RIGHT] = NS_STYLE_BORDER_STYLE_INSET;
aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_INSET);
aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_INSET);
aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_INSET);
aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_INSET);
#endif
nsTableFrame* tableFrame;
@@ -472,10 +474,12 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
if (borderColor == 0xFFFFFFFF)
borderColor = 0xFFC0C0C0;
aSpacingStyle.mBorderColor[NS_SIDE_TOP] =
aSpacingStyle.mBorderColor[NS_SIDE_LEFT] =
aSpacingStyle.mBorderColor[NS_SIDE_BOTTOM] =
aSpacingStyle.mBorderColor[NS_SIDE_RIGHT] = borderColor;
aSpacingStyle.SetBorderColor(NS_SIDE_TOP, borderColor);
aSpacingStyle.SetBorderColor(NS_SIDE_LEFT, borderColor);
aSpacingStyle.SetBorderColor(NS_SIDE_BOTTOM, borderColor);
aSpacingStyle.SetBorderColor(NS_SIDE_RIGHT, borderColor);
//adjust the border style based on the table rules attribute
const nsStyleTable* tableStyle;
@@ -484,10 +488,10 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
switch (tableStyle->mRules)
{
case NS_STYLE_TABLE_RULES_NONE:
aSpacingStyle.mBorderStyle[NS_SIDE_TOP] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_RIGHT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_BOTTOM] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_LEFT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_NONE);
break;
case NS_STYLE_TABLE_RULES_GROUPS:
// XXX: it depends on which cell this is!
@@ -499,13 +503,13 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
*/
break;
case NS_STYLE_TABLE_RULES_COLS:
aSpacingStyle.mBorderStyle[NS_SIDE_TOP] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_BOTTOM] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_NONE);
break;
case NS_STYLE_TABLE_RULES_ROWS:
aSpacingStyle.mBorderStyle[NS_SIDE_RIGHT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.mBorderStyle[NS_SIDE_LEFT] = NS_STYLE_BORDER_STYLE_NONE;
aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_NONE);
aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_NONE);
break;
// do nothing for "ALL" or for any illegal value
@@ -811,7 +815,7 @@ nsIFrame* nsTableCellFrame::CompareCellBorders(nsIFrame* aFrame1,
const nsStyleSpacing* border2;
aFrame1->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)border1);
aFrame2->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&)border2);
if (border1->mBorderStyle[aEdge1] >= border2->mBorderStyle[aEdge2])
if (border1->GetBorderStyle(aEdge1) >= border2->GetBorderStyle(aEdge2))
result = aFrame1;
else
result = aFrame2;