diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-04-29 18:06:27 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-04-29 17:30:13 +0000 |
commit | 0a115d48057867c60bfcd527e90433b2dca1f28a (patch) | |
tree | c318638c69dcdcb3191f576696900930fb4b0852 | |
parent | 879c36b01d3f806937cfc26b90ebac89e6df87c4 (diff) |
fdo#62336 - fix horribly coupled table rendering code to not crash.
Change-Id: Ie0c5f39f6265e38534a6d0c9743877eef79e5954
Reviewed-on: https://gerrit.libreoffice.org/3687
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r-- | sw/source/filter/writer/wrtswtbl.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index 55afa3c26f2d..46990054f440 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -404,6 +404,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, @@ -747,10 +751,16 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth, // Erstmal die Tabellen-Struktur festlegen. Hinter der Tabelle ist in // jedem Fall eine Spalte zu Ende SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth ); + bUseLayoutHeights = true; aCols.insert( pCol ); CollectTableRowsCols( 0, 0, 0, nParentWidth, rLines, nMaxDepth - 1 ); - // Und jetzt mit leben fuellen + // 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) ); // Einige Twip-Werte an Pixel-Grenzen anpassen |