summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-09-11 15:18:26 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-11 16:14:16 +0200
commit4e653d15eff26aa5283d8ba20611893f4c573f57 (patch)
treeedb4a54114aed8579e73c347ecadb2e22df98fa0 /sw/qa
parent066e0fe1a230eac2531a53e1ec5fa58347e9e31e (diff)
DOCX import: fix default section break type inside multiple columns
Change-Id: I7c44a2bdb69563953d3257b435aeed5bae50f7b2
Diffstat (limited to 'sw/qa')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/default-sect-break-cols.docxbin0 -> 9993 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/default-sect-break-cols.docx b/sw/qa/extras/ooxmlimport/data/default-sect-break-cols.docx
new file mode 100755
index 000000000000..b66b844f16ee
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/default-sect-break-cols.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 06a3ae242739..6076d77e619a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XFormField.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
+#include <com/sun/star/text/XTextColumns.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
@@ -134,6 +135,7 @@ public:
void testFdo68607();
void testVmlTextVerticalAdjust();
void testGroupshapeSdt();
+ void testDefaultSectBreakCols();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -233,6 +235,7 @@ void Test::run()
{"fdo68607.docx", &Test::testFdo68607},
{"vml-text-vertical-adjust.docx", &Test::testVmlTextVerticalAdjust},
{"groupshape-sdt.docx", &Test::testGroupshapeSdt},
+ {"default-sect-break-cols.docx", &Test::testDefaultSectBreakCols},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1614,6 +1617,20 @@ void Test::testGroupshapeSdt()
CPPUNIT_ASSERT_EQUAL(sal_Int32(20), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xShape->getText()), 1), "CharKerning"));
}
+void Test::testDefaultSectBreakCols()
+{
+ // First problem: the first two paragraphs did not have their own text section, so the whole document had two columns.
+ uno::Reference<beans::XPropertySet> xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(1, "First."), "TextSection");
+ CPPUNIT_ASSERT(xTextSection.is());
+ uno::Reference<text::XTextColumns> xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns");
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xTextColumns->getColumnCount());
+
+ // Second problem: the page style had two columns, while it shouldn't have any.
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+ xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xPageStyle, "TextColumns");
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();