Kaydet (Commit) 61dc0d2c authored tarafından Michael Meeks's avatar Michael Meeks

fdo#62336 - fix horribly coupled table rendering code to not crash.

Change-Id: I7a6ee4dce338b7529fa7500bb0c8341a4f2ebc22
üst a1f3824e
...@@ -396,6 +396,10 @@ sal_Bool SwWriteTable::ShouldExpandSub(const SwTableBox *pBox, sal_Bool /*bExpan ...@@ -396,6 +396,10 @@ sal_Bool SwWriteTable::ShouldExpandSub(const SwTableBox *pBox, sal_Bool /*bExpan
return !pBox->GetSttNd() && nDepth > 0; return !pBox->GetSttNd() && nDepth > 0;
} }
// FIXME: the degree of coupling between this method and
// FillTableRowsCols which is called immediately afterwards
// is -extremely- unpleasant and potentially problematic.
void SwWriteTable::CollectTableRowsCols( long nStartRPos, void SwWriteTable::CollectTableRowsCols( long nStartRPos,
sal_uInt32 nStartCPos, sal_uInt32 nStartCPos,
long nParentLineHeight, long nParentLineHeight,
...@@ -740,8 +744,14 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth, ...@@ -740,8 +744,14 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth,
// case the end of a column // case the end of a column
SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth ); SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth );
aCols.insert( pCol ); aCols.insert( pCol );
bUseLayoutHeights = true;
CollectTableRowsCols( 0, 0, 0, nParentWidth, rLines, nMaxDepth - 1 ); CollectTableRowsCols( 0, 0, 0, nParentWidth, rLines, nMaxDepth - 1 );
// FIXME: awfully GetLineHeight writes to this in its first call
// and proceeds to return a rather odd number fdo#62336, we have to
// behave identically since the code in FillTableRowsCols duplicates
// and is highly coupled to CollectTableRowsCols - sadly.
bUseLayoutHeights = true;
// And now fill with life // And now fill with life
FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, 0, nMaxDepth - 1, static_cast< sal_uInt16 >(nNumOfRowsToRepeat) ); FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, 0, nMaxDepth - 1, static_cast< sal_uInt16 >(nNumOfRowsToRepeat) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment