зеркало из https://github.com/mozilla/pjs.git
Table editing (bug 20973): return reported and actual rowspan and colspan values from GetCellDataAt(), r=karnaze
This commit is contained in:
Родитель
dfec66a0ef
Коммит
268ecb5b80
|
@ -58,8 +58,10 @@ public:
|
|||
* for searching through the table when a cell isn't found
|
||||
* because of "holes" in the cellmap
|
||||
* when ROWSPAN and/or COLSPAN > 1
|
||||
* @param aRowSpan [OUT] the number of rows aCell spans
|
||||
* @param aColSpan [OUT] the number of cols aCell spans
|
||||
* @param aRowSpan [OUT] the value of the ROWSPAN attribute (may be 0 or actual number)
|
||||
* @param aColSpan [OUT] the value of the COLSPAN attribute (may be 0 or actual number)
|
||||
* @param aActualRowSpan [OUT] the actual number of rows aCell spans
|
||||
* @param aActualColSpan [OUT] the acutal number of cols aCell spans
|
||||
* @param aIsSelected [OUT] PR_TRUE if the frame that maps aCell is selected
|
||||
* in the presentation shell that owns this.
|
||||
*/
|
||||
|
@ -67,6 +69,7 @@ public:
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected)=0;
|
||||
|
||||
/** Get the number of rows and column for a table from the frame's cellmap
|
||||
|
|
|
@ -4490,6 +4490,8 @@ nsTableFrame::GetCellDataAt(PRInt32 aRowIndex,
|
|||
PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan,
|
||||
PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan,
|
||||
PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected)
|
||||
{
|
||||
nsresult result;
|
||||
|
@ -4530,6 +4532,8 @@ nsTableFrame::GetCellDataAt(PRInt32 aRowIndex,
|
|||
cellFrame = cellMap->GetCellFrameOriginatingAt(row, col);
|
||||
if (cellFrame)
|
||||
{
|
||||
//The nsTableFrame version returns actual value
|
||||
// when nsTableCellFrame's return values are "HTML" (i.e., may = 0)
|
||||
rowSpan = GetRowSpan(*cellFrame);
|
||||
colSpan = GetColSpan(*cellFrame);
|
||||
|
||||
|
@ -4540,8 +4544,10 @@ nsTableFrame::GetCellDataAt(PRInt32 aRowIndex,
|
|||
CELL_FOUND:
|
||||
aStartRowIndex = row;
|
||||
aStartColIndex = col;
|
||||
aRowSpan = rowSpan;
|
||||
aColSpan = colSpan;
|
||||
aActualRowSpan = rowSpan;
|
||||
aActualColSpan = colSpan;
|
||||
aRowSpan = cellFrame->GetRowSpan();
|
||||
aColSpan = cellFrame->GetColSpan();
|
||||
// I know jumps aren't cool, but it's efficient!
|
||||
goto TEST_IF_SELECTED;
|
||||
} else {
|
||||
|
@ -4574,8 +4580,11 @@ CELL_FOUND:
|
|||
if (NS_FAILED(result)) return result;
|
||||
result = cellFrame->GetColIndex(aStartColIndex);
|
||||
if (NS_FAILED(result)) return result;
|
||||
aRowSpan = GetRowSpan(*cellFrame);
|
||||
aColSpan = GetColSpan(*cellFrame);
|
||||
//This returns HTML value, which may be 0
|
||||
aRowSpan = cellFrame->GetRowSpan();
|
||||
aColSpan = cellFrame->GetColSpan();
|
||||
aActualRowSpan = GetRowSpan(*cellFrame);
|
||||
aActualColSpan = GetColSpan(*cellFrame);
|
||||
result = cellFrame->GetSelected(&aIsSelected);
|
||||
if (NS_FAILED(result)) return result;
|
||||
|
||||
|
|
|
@ -811,6 +811,7 @@ public: /* ----- Cell Map public methods ----- */
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected);
|
||||
|
||||
/** Get the number of rows and column for a table from the frame's cellmap
|
||||
|
|
|
@ -1062,6 +1062,7 @@ nsTableOuterFrame::GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected)
|
||||
{
|
||||
if (!mInnerTableFrame) { return NS_ERROR_NOT_INITIALIZED; }
|
||||
|
@ -1071,7 +1072,8 @@ nsTableOuterFrame::GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
|
|||
{
|
||||
return (inner->GetCellDataAt(aRowIndex, aColIndex, aCell,
|
||||
aStartRowIndex, aStartColIndex,
|
||||
aRowSpan, aColSpan, aIsSelected));
|
||||
aRowSpan, aColSpan, aActualRowSpan, aActualColSpan,
|
||||
aIsSelected));
|
||||
}
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
|
|
@ -117,6 +117,7 @@ public:
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected);
|
||||
|
||||
/** @see nsITableFrame::GetTableSize */
|
||||
|
|
|
@ -58,8 +58,10 @@ public:
|
|||
* for searching through the table when a cell isn't found
|
||||
* because of "holes" in the cellmap
|
||||
* when ROWSPAN and/or COLSPAN > 1
|
||||
* @param aRowSpan [OUT] the number of rows aCell spans
|
||||
* @param aColSpan [OUT] the number of cols aCell spans
|
||||
* @param aRowSpan [OUT] the value of the ROWSPAN attribute (may be 0 or actual number)
|
||||
* @param aColSpan [OUT] the value of the COLSPAN attribute (may be 0 or actual number)
|
||||
* @param aActualRowSpan [OUT] the actual number of rows aCell spans
|
||||
* @param aActualColSpan [OUT] the acutal number of cols aCell spans
|
||||
* @param aIsSelected [OUT] PR_TRUE if the frame that maps aCell is selected
|
||||
* in the presentation shell that owns this.
|
||||
*/
|
||||
|
@ -67,6 +69,7 @@ public:
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected)=0;
|
||||
|
||||
/** Get the number of rows and column for a table from the frame's cellmap
|
||||
|
|
|
@ -4490,6 +4490,8 @@ nsTableFrame::GetCellDataAt(PRInt32 aRowIndex,
|
|||
PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan,
|
||||
PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan,
|
||||
PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected)
|
||||
{
|
||||
nsresult result;
|
||||
|
@ -4530,6 +4532,8 @@ nsTableFrame::GetCellDataAt(PRInt32 aRowIndex,
|
|||
cellFrame = cellMap->GetCellFrameOriginatingAt(row, col);
|
||||
if (cellFrame)
|
||||
{
|
||||
//The nsTableFrame version returns actual value
|
||||
// when nsTableCellFrame's return values are "HTML" (i.e., may = 0)
|
||||
rowSpan = GetRowSpan(*cellFrame);
|
||||
colSpan = GetColSpan(*cellFrame);
|
||||
|
||||
|
@ -4540,8 +4544,10 @@ nsTableFrame::GetCellDataAt(PRInt32 aRowIndex,
|
|||
CELL_FOUND:
|
||||
aStartRowIndex = row;
|
||||
aStartColIndex = col;
|
||||
aRowSpan = rowSpan;
|
||||
aColSpan = colSpan;
|
||||
aActualRowSpan = rowSpan;
|
||||
aActualColSpan = colSpan;
|
||||
aRowSpan = cellFrame->GetRowSpan();
|
||||
aColSpan = cellFrame->GetColSpan();
|
||||
// I know jumps aren't cool, but it's efficient!
|
||||
goto TEST_IF_SELECTED;
|
||||
} else {
|
||||
|
@ -4574,8 +4580,11 @@ CELL_FOUND:
|
|||
if (NS_FAILED(result)) return result;
|
||||
result = cellFrame->GetColIndex(aStartColIndex);
|
||||
if (NS_FAILED(result)) return result;
|
||||
aRowSpan = GetRowSpan(*cellFrame);
|
||||
aColSpan = GetColSpan(*cellFrame);
|
||||
//This returns HTML value, which may be 0
|
||||
aRowSpan = cellFrame->GetRowSpan();
|
||||
aColSpan = cellFrame->GetColSpan();
|
||||
aActualRowSpan = GetRowSpan(*cellFrame);
|
||||
aActualColSpan = GetColSpan(*cellFrame);
|
||||
result = cellFrame->GetSelected(&aIsSelected);
|
||||
if (NS_FAILED(result)) return result;
|
||||
|
||||
|
|
|
@ -811,6 +811,7 @@ public: /* ----- Cell Map public methods ----- */
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected);
|
||||
|
||||
/** Get the number of rows and column for a table from the frame's cellmap
|
||||
|
|
|
@ -1062,6 +1062,7 @@ nsTableOuterFrame::GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected)
|
||||
{
|
||||
if (!mInnerTableFrame) { return NS_ERROR_NOT_INITIALIZED; }
|
||||
|
@ -1071,7 +1072,8 @@ nsTableOuterFrame::GetCellDataAt(PRInt32 aRowIndex, PRInt32 aColIndex,
|
|||
{
|
||||
return (inner->GetCellDataAt(aRowIndex, aColIndex, aCell,
|
||||
aStartRowIndex, aStartColIndex,
|
||||
aRowSpan, aColSpan, aIsSelected));
|
||||
aRowSpan, aColSpan, aActualRowSpan, aActualColSpan,
|
||||
aIsSelected));
|
||||
}
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
|
|
@ -117,6 +117,7 @@ public:
|
|||
nsIDOMElement* &aCell, //out params
|
||||
PRInt32& aStartRowIndex, PRInt32& aStartColIndex,
|
||||
PRInt32& aRowSpan, PRInt32& aColSpan,
|
||||
PRInt32& aActualRowSpan, PRInt32& aActualColSpan,
|
||||
PRBool& aIsSelected);
|
||||
|
||||
/** @see nsITableFrame::GetTableSize */
|
||||
|
|
Загрузка…
Ссылка в новой задаче