Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



 Hello,

 is there anybody knowledgeable enough of the Writer layout code who'd know 
what the purpose of the code in the attached patch is? I intend the remove it 
based on the fact that the purpose seems to be broken (assuming that I got it 
right in the commit message) and that I have a testcase which is rather 
broken by it:

- create new empty writer document
- modify the 'Default' style (F11->Default->->RMB->Modify->Text flow->Keep 
with next paragraph) to enable keeping paragraphs together (don't ask, people 
apparently can do that)
- insert an empty line
- write short text (one line)
- insert a a table
- hold Enter so that new pages are inserted after the table
- save as .doc, load again (msword loaders set the 
IDocumentSettingAccess::TABLE_ROW_KEEP flag for the document, which I'm not 
sure what it actually exactly does, as nobody seemed bothered enough to write 
that down somewhere)
- now delete and insert again the empty line at the beginning of the document 
and see the table do really weird things

 I'm not sure I get all the parts of the function right (actually I'm rather 
sure I don't), but it looks broken to me to unconditionally move a table 
forward just depending on whether there is something before it. Git blame 
shows a CWS merge, so it is unhelpful.

-- 
 Lubos Lunak
 l.lunak@suse.cz
From 63e7d5a92a9580b1e04026657eb99bfef3480fde Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak@suse.cz>
Date: Mon, 16 Jan 2012 17:42:39 +0100
Subject: [PATCH] remove pointless forward moving of a table (bnc#706138)

This appears to be broken. Why should a table where all rows want to be kept
together be moved one page forward just because there is something
before it on the page where it is? It either fits its curent page, in which
case it's wrong, or it does not fit, in which case it may not fit the following
page either and something else needs to take care of it anyway.
---
 sw/source/core/layout/tabfrm.cxx |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 1571b71..ec32c68 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2404,11 +2404,6 @@ void SwTabFrm::MakeAll()
                         ++nMinNumOfLines;
                         pTmpRow = static_cast<const SwRowFrm*>(pTmpRow->GetNext());
                     }
-                    // Check if all lines want to keep together and we
-                    // have a pIndPrev. In this case we set nDeadLine
-                    // to 0, forcing the table to move forward.
-                    if ( !pTmpRow && pIndPrev )
-                        nDeadLine = 0;
                 }
 
                 if ( !bTryToSplit )
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.