sw/qa/extras/layout/data/tdf117982.docx |binary sw/qa/extras/layout/layout.cxx | 12 ++++++++++++ sw/source/core/text/frmform.cxx | 15 +++++++++++++++ 3 files changed, 27 insertions(+)
New commits: commit c0e80a015ba4bd18c64496020f596dc491014b0b Author: László Németh <nem...@numbertext.org> AuthorDate: Tue Dec 3 11:45:27 2019 +0100 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Mon Dec 16 16:29:57 2019 +0100 tdf#117982 Writer: fix invisible cell content due to spacing If the cell content with its bottom paragraph spacing is greater than the fix cell height, the content was invisible. Change-Id: I5922941dc0941950912a7ea2cec0aedf1079544c Reviewed-on: https://gerrit.libreoffice.org/84010 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> Reviewed-on: https://gerrit.libreoffice.org/84385 Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/layout/data/tdf117982.docx b/sw/qa/extras/layout/data/tdf117982.docx new file mode 100644 index 000000000000..f5886215b93b Binary files /dev/null and b/sw/qa/extras/layout/data/tdf117982.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index b98cb3e8cc50..d96fe192a252 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3571,6 +3571,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf121658) assertXPath(pXmlDoc, "//Special[@nType='PortionType::Hyphen']", 2); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117982) +{ + SwDoc* pDocument = createDoc("tdf117982.docx"); + SwDocShell* pShell = pDocument->GetDocShell(); + std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + assertXPathContent(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/textarray[1]/text", "FOO AAA"); + //The first cell must be "FOO AAA". If not, this means the first cell content not visible in + //the source document. +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx old mode 100644 new mode 100755 index 752e82cb1663..6afbdc0db9ec --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1948,6 +1948,21 @@ void SwTextFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderAttr CalcBaseOfstForFly(); CalcHeightOfLastLine(); // i#11860 - Adjust spacing implementation for // object positioning - Compatibility to MS Word + // tdf#117982 -- Fix cell spacing hides content + // Check if the cell's content has greater size than the row height + if (IsInTab() && GetUpper() && ((GetUpper()->getFramePrintArea().Height() < getFramePrintArea().Height()) + || (getFramePrintArea().Height() <= 0))) + { + SAL_INFO("sw.core", "Warn: Cell content has greater size than cell height!"); + //get font size... + SwTwips aTmpHeight = getFrameArea().Height(); + //...and push it into the text frame + SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); + //if only bottom margin what we have: + if (GetTopMargin() == 0) + //set the frame to its original location + aPrt.SetTopAndHeight(0, aTmpHeight); + } } // bForceQuickFormat is set if GetFormatted() has been called during the _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits