[Libreoffice-commits] core.git: sw/qa sw/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 4 06:13:32 UTC 2019


 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 5ac21d46f25023e4c8440aa45c6d923eaa4a925b
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Tue Dec 3 11:45:27 2019 +0100
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed Dec 4 07:12:51 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 <nemeth at numbertext.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 f02a69ae042e..8524a4e0e033 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3543,6 +3543,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105481)
     CPPUNIT_ASSERT_LESSEQUAL(nTxtBottom, nFormula2Bottom);
 }
 
+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 4f589ca683d9..3eb0558791b4
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1945,6 +1945,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


More information about the Libreoffice-commits mailing list