summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-22 17:08:39 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-22 17:48:58 +0100
commit0208ead70a9412ccd554fcef3e9308f8ca17037b (patch)
tree6f324f0afd493c4790d80671ffd903805c0bbddb /sw
parent5dff2d0822bb299c134a05a64747ce1bb42ad7cd (diff)
DOCX import: improve btLr table cell support
The problem was that in case the contents didn't fit into a single line, multiple lines were created, which is not what btLr wants. Set the size type to fixed in this case. Change-Id: Ibab1313f95dc16dd0366d21a00109a6f38fa3526
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/tblr-height.docxbin0 -> 10466 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx13
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tblr-height.docx b/sw/qa/extras/ooxmlimport/data/tblr-height.docx
new file mode 100755
index 000000000000..6a16c81dd5e0
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tblr-height.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index eec5e708cfa7..f6eb0ef311bf 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/TableBorder2.hpp>
+#include <com/sun/star/text/SizeType.hpp>
#include <vcl/svapp.hxx>
@@ -115,6 +116,7 @@ public:
void testN793998();
void testGroupshapeLine();
void testN779642();
+ void testTbLrHeight();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -182,6 +184,7 @@ void Test::run()
{"n793998.docx", &Test::testN793998},
{"groupshape-line.docx", &Test::testGroupshapeLine},
{"n779642.docx", &Test::testN779642},
+ {"tblr-height.docx", &Test::testTbLrHeight},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1183,6 +1186,16 @@ void Test::testN779642()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation relation", nValue, text::RelOrientation::PAGE_PRINT_AREA);
}
+void Test::testTbLrHeight()
+{
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY);
+ // btLr text direction was imported as MIN, it should be FIX to avoid incorrectly large height in case of too much content.
+ CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty<sal_Int16>(xTableRows->getByIndex(0), "SizeType"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();