sw/qa/extras/layout/data/tdf150642.odt |binary
 sw/qa/extras/layout/layout2.cxx        |    9 +++++++++
 sw/source/core/layout/calcmove.cxx     |    2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 5e3abdf6ecded4f69bc7e1bdfb9dc8300f30685d
Author:     Mark Hung <mark...@gmail.com>
AuthorDate: Fri Sep 9 16:09:47 2022 +0800
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Wed Sep 21 12:54:07 2022 +0200

    tdf#150642 fix table layout with vertical writing.
    
    Revert part of 1bf82b26ae3.
    
    N | V | WAS         | 1bf82b26aea3 | WAS                  | 1bf82b26aea3 |
    
-------------------------------------------------------------------------------
    F | F | fnRectHori  | fnRectHori   | fnAddRight/fnSubLeft |              |
    F | T | fnRectVert  | fnRectVert   | fnAddRight/fnSubLeft |              |
    T | F | fnRectVert  | fnRectHori   | fnAddRight/fnSubLeft | fnAddBottom  |
    T | T | fnRectHori  | fnRectVert   | fnAddRight/fnSubLeft | fnAddBottom  | *
    
    *: the case fixed in this patch.
    
    Ref:
    
    commit 1bf82b26aea3a403920a64cdfcb4671c947c7a01
    Author: Mark Hung <mark...@gmail.com>
    Date:   Sun Aug 14 15:23:14 2022 +0800
    
        tdf#135991 fix unexpected hidden RTL sections.
    
    Change-Id: I1e30c277dd03369bef0a6930b3d3534b7d57a640
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139777
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <mark...@gmail.com>
    (cherry picked from commit 11ec622b8405dcaabc359e3d6e38c8a9142dad6b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140172
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/qa/extras/layout/data/tdf150642.odt 
b/sw/qa/extras/layout/data/tdf150642.odt
new file mode 100644
index 000000000000..5e316424a289
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf150642.odt differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 00d7a8e65a48..6bbda55706a4 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -2173,6 +2173,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf135991)
     assertXPath(pDump, "//bounds[@top<0]", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf150642)
+{
+    createSwDoc(DATA_DIRECTORY, "tdf150642.odt");
+    auto pDump = parseLayoutDump();
+    // There used to be negative values that made the cell frame invisible.
+    assertXPath(pDump, "//bounds[@left<0]", 0);
+    assertXPath(pDump, "//bounds[@right<0]", 0);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 1869794300f6..e40e1dab6ef3 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -977,7 +977,7 @@ void SwLayoutFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
                     setFramePrintAreaValid(false);
                     SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
 
-                    if (IsNeighbourFrame())
+                    if (IsNeighbourFrame() && !bVert)
                     {
                         SwTwips nPrtHeight = 
(GetUpper()->getFramePrintArea().*fnRect->fnGetHeight)();
                         const tools::Long nDiff = nPrtHeight - 
(getFrameArea().*fnRect->fnGetHeight)();

Reply via email to