summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfimport/odfimport.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-14 16:31:13 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-14 16:38:57 +0200
commit2d35baed5e87ffe7ca371986391cdb3983cdd2b1 (patch)
tree15c1741eda1b6728bf7e1f3bfba62fb286d7ff50 /sw/qa/extras/odfimport/odfimport.cxx
parent72cb37b6858a2636ff1e7bc8228efdc52eebf922 (diff)
bnc#800714 SwTxtFrm::FormatAdjust: still call SplitFrm if we have columns
Regression from c5a8a2c3cbcee0175127a0662e3d820ea4deea22 (sw34bf05: i#84870 - method <SwTxtFrm::FormatAdjust(..)> - do not split text frame which only contains on as-character anchored object, 2011-03-11), the i#84870 fix was for a document which didn't have columns, and didn't consider that this causes a layout loop in case: 1) There are two paragraphs in a section, having multiple columns. 2) The second paragraph has fo:keep-together="always". In this case originally we tried to call SplitFrm(), realized that it didn't help, and then gave up. But after the change, we kept trying to satisfy the two conflicting requirements (balance content in the 3 columns vs keep the second paragraph with the first one). Fix the problem by not calling SplitFrm() only in case we're not inside columns. Change-Id: I64e969ef5e8f519314f5613f8e6fae626ae085ce
Diffstat (limited to 'sw/qa/extras/odfimport/odfimport.cxx')
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 18de66814496..6174dc56c4f2 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/text/XTextSection.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <wrtsh.hxx>
@@ -521,6 +522,16 @@ DECLARE_ODFIMPORT_TEST(fdo81223, "fdo81223.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfeffffff), nValue);
}
+DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
+{
+ // Document's second paragraph wants to be together with the third one, but:
+ // - it's in a section with multiple columns
+ // - contains a single as-char anchored frame
+ // This was a layout loop.
+ CPPUNIT_ASSERT(getProperty< uno::Reference<text::XTextSection> >(getParagraph(2), "TextSection").is());
+ CPPUNIT_ASSERT(getProperty<bool>(getParagraph(2), "ParaKeepTogether"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();