summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorAttila Szűcs <szucs.attila3@nisz.hu>2021-04-30 10:31:58 +0200
committerLászló Németh <nemeth@numbertext.org>2021-05-06 14:06:43 +0200
commitf05c57b96293c80825be66162ca7bf3e4dbc8ea2 (patch)
treebfccdef09eae564030cd82ac54fdc180369268ae /sw/qa
parent0664228c1648a6f88ccf251ccc0bdda57b2717a9 (diff)
tdf#121659 DOCX import: fix lost column break at shapes
The column break was moved into the neighboring shape during the first import, and eliminated during the second import, losing the 2-column text layout. As a workaround, split the paragraph moving the column break into a new paragraph. Based on the patch written by Justin Luth. Co-authored-by: Justin Luth and Tibor Nagy (NISZ) Change-Id: Id4042a92b09aa55952bc0ea02319d5e588f77d3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114904 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf121659_loseColumnBrNextToShape.docxbin0 -> 23557 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121659_loseColumnBrNextToShape.docx b/sw/qa/extras/ooxmlexport/data/tdf121659_loseColumnBrNextToShape.docx
new file mode 100644
index 000000000000..1fda1422e361
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf121659_loseColumnBrNextToShape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index c50a75c6daa1..f0450f7b6cbb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -10,6 +10,7 @@
#include <swmodeltestbase.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/style/BreakType.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
@@ -107,6 +108,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf140182_extraPagebreak, "tdf140182_extraPagebreak
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121659_loseColumnBrNextToShape, "tdf121659_loseColumnBrNextToShape.docx")
+{
+ // The third paragraph contains a manual column break and a shape.
+ // The column break was moved into the shape during the first import
+ // (messing also the shape position), and eliminated during the second import,
+ // losing the 2-column text layout. As a workaround, split the paragraph
+ // moving the column break into the fourth paragraph instead of losing it.
+ reload("Office Open XML Text", "tdf121659_loseColumnBrNextToShape.docx");
+ bool bBreakOnPara3 = getProperty<style::BreakType>(getParagraph(3), "BreakType") == style::BreakType_COLUMN_BEFORE;
+ bool bBreakOnPara4 = getProperty<style::BreakType>(getParagraph(4), "BreakType") == style::BreakType_COLUMN_BEFORE;
+ CPPUNIT_ASSERT(bBreakOnPara3 || bBreakOnPara4);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf95848, "tdf95848.docx")
{
OUString listId;