summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-13 17:30:18 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-14 09:43:51 +0100
commitc4b91ae3178011c66c76c711c1a6469ba658872e (patch)
treee9d2dd98a395cb1cff67fe53fe77a18694010ca2 /sw/qa
parent8030ea8a94405751ed47d2adf8ab239ba284a323 (diff)
fdo#55525 import RTF_TRLEFT
Additionally: 1) Make sure cell margins are zero when they are not defined. 2) Handle cellx values in case of a negative left margin. Change-Id: I9b8fb700b6459e622396c98e4344aba79f62c96e
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo55525.rtf12
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx15
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo55525.rtf b/sw/qa/extras/rtfimport/data/fdo55525.rtf
new file mode 100644
index 000000000000..0b966c1c747b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo55525.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+\marglsxn1418\margrsxn1418
+\trowd\trql\trleft-1064\cellx-250\cellx-106\cellx8006
+\pard\plain \intbl
+A1
+\cell\pard\plain\intbl
+A2
+\cell\pard\plain\intbl
+A3
+\cell\row\pard
+\pard\plain \par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5d2c183ea89d..c24c87aad9cb 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/SizeType.hpp>
+#include <com/sun/star/text/TableColumnSeparator.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
@@ -124,6 +125,7 @@ public:
void testFdo56512();
void testFdo52989();
void testFdo48442();
+ void testFdo55525();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -199,6 +201,7 @@ void Test::run()
{"fdo56512.rtf", &Test::testFdo56512},
{"fdo52989.rtf", &Test::testFdo52989},
{"fdo48442.rtf", &Test::testFdo48442},
+ {"fdo55525.rtf", &Test::testFdo55525},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -917,6 +920,18 @@ void Test::testFdo48442()
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, getProperty<sal_Int16>(xShape, "VertOrientRelation")); // was FRAME
}
+void Test::testFdo55525()
+{
+ 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);
+ // Negative left margin was ~missing, -191
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1877), getProperty<sal_Int32>(xTable, "LeftMargin"));
+ // Cell width of A1 was 3332 (e.g. not set, 30% percent of total width)
+ uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(1016), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();