sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 10 ++++++++++ sw/source/core/text/frmform.cxx | 9 --------- 3 files changed, 10 insertions(+), 9 deletions(-)
New commits: commit cd7f8d895abae28533ec43ed43b2d90947e92b42 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Fri Dec 23 15:49:59 2022 -0500 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jan 2 13:31:09 2023 +0000 tdf#151704 sw: don't give random height to text frame This was introduced forever ago with commit 6c3ae34e32539f8493a940666dbe16b23a8ba7b0 Author: Frank Meies on Tue Nov 20 15:24:54 2001 +0000 Chg: Vertical Formatting - Growing frames But why? Assuming that anything that NEEDED to set a proper height has done so by now. The commit suggests it was added to handle vertical layouts. If this exploratory patch causes problems (and it very well might since this is a really generic spot) then perhaps it can be limited to verical layout situations? Change-Id: Ib6e4a45379e670fd343a2e2d87879e6bb52afebf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144787 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx b/sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx new file mode 100644 index 000000000000..7e7cd57e1395 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf151704_thinColumnHeight.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 27c62342d849..ffb48ecad109 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -129,6 +129,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135595_HFtableWrap_c12, "tdf135595_HFtableWrap_c CPPUNIT_ASSERT_MESSAGE("Text must not wrap around header image", nRowHeight < 800); } +DECLARE_OOXMLEXPORT_TEST(testTdf151704_thinColumnHeight, "tdf151704_thinColumnHeight.docx") +{ + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + sal_Int32 nRowHeightT1 = getXPath( + pXmlDoc, "//page[1]/body/tab[1]/row/cell/tab[1]/row[1]/infos/bounds", "height").toInt32(); + sal_Int32 nRowHeightT2 = getXPath( + pXmlDoc, "//page[2]/body/tab/row[1]/infos/bounds", "height").toInt32(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Same row height in both tables", nRowHeightT1, nRowHeightT2); +} + DECLARE_OOXMLEXPORT_TEST(testTdf123622, "tdf123622.docx") { uno::Reference<beans::XPropertySet> XPropsRight(getShape(1),uno::UNO_QUERY); diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 19dcb6e3ed5f..46d2613021cb 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1799,7 +1799,6 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( aRectFnSet.GetWidth(getFramePrintArea()) <= 0 ) { // If MustFit is set, we shrink to the Upper's bottom edge if needed. - // Else we just take a standard size of 12 Pt. (240 twip). SwTextLineAccess aAccess( this ); tools::Long nFrameHeight = aRectFnSet.GetHeight(getFrameArea()); @@ -1810,14 +1809,6 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr if( nDiff > 0 ) Shrink( nDiff ); } - else if( 240 < nFrameHeight ) - { - Shrink( nFrameHeight - 240 ); - } - else if( 240 > nFrameHeight ) - { - Grow( 240 - nFrameHeight ); - } nFrameHeight = aRectFnSet.GetHeight(getFrameArea()); const tools::Long nTop = aRectFnSet.GetTopMargin(*this);