summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2023-01-05 18:17:12 +0300
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-01-09 07:54:51 +0000
commit788cc6ff3b186ceb8f265e53b5482f808f6536f4 (patch)
tree4d23a4ecfafc87130d45b0293bf005bb72810ec2 /sw
parent8ae84bb5566e12df64236a116b9d1889d6f5f052 (diff)
tdf#148578: Do not apply table shift for RTF
Table shift based on cell lect margin should be applied for DOCX (earlier compat options) but not actual for RTF. Maybe earlier RTF version did behave this way, but nowadays this behavior does not match MS Word 365. Change-Id: Icdc4fa6298167fe5f263c85164d7c4c4176be25f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145088 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf148578.rtf12
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx21
2 files changed, 33 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf148578.rtf b/sw/qa/extras/rtfexport/data/tdf148578.rtf
new file mode 100644
index 000000000000..256d63898770
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf148578.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+
+\trowd
+\trgaph567
+\cellx1851
+\cellx9206
+\pard\plain\intbl 1000\cell
+\pard\plain\intbl XX_XX_XXX1\cell
+\row
+
+\pard MMMM
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 55f5a0362174..a79e92814222 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -514,6 +514,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127806)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(635), aSize.Width);
}
+DECLARE_RTFEXPORT_TEST(testTdf148578, "tdf148578.rtf")
+{
+ // \trgaph567 should affect only table cell margings (~1cm),
+ // but do not shift table, since \trleft is not provided
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xTable, "LeftMargin"));
+
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1000),
+ getProperty<sal_Int32>(xCell, "LeftBorderDistance"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1000),
+ getProperty<sal_Int32>(xCell, "RightBorderDistance"));
+
+ xCell.set(xTable->getCellByName("B1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1000),
+ getProperty<sal_Int32>(xCell, "LeftBorderDistance"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1000),
+ getProperty<sal_Int32>(xCell, "RightBorderDistance"));
+}
+
DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf")
{
// Given test has character style #30, but referred as paragraph style #30