summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-04-29 18:01:25 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-04-29 18:04:10 +0100
commit61dc0d2c9d79fd9ce32cd9591fad4daead0ebade (patch)
tree7601712aaea09d6cf364f2c6036a2efe691ccf8f
parenta1f3824e94694433466d492ee16cf497783a3455 (diff)
fdo#62336 - fix horribly coupled table rendering code to not crash.
Change-Id: I7a6ee4dce338b7529fa7500bb0c8341a4f2ebc22
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 7a1123d169d3..12c35398fcb1 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -396,6 +396,10 @@ sal_Bool SwWriteTable::ShouldExpandSub(const SwTableBox *pBox, sal_Bool /*bExpan
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,
sal_uInt32 nStartCPos,
long nParentLineHeight,
@@ -740,8 +744,14 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth,
// case the end of a column
SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth );
aCols.insert( pCol );
+ bUseLayoutHeights = true;
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
FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, 0, nMaxDepth - 1, static_cast< sal_uInt16 >(nNumOfRowsToRepeat) );