summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-07-28 17:57:53 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-07-29 12:29:08 +0000
commit5dcf8fd9634c4d446bec3471b1fe0b43b61ed061 (patch)
tree5f361d2ea142846b5bcbac129de8bb8fa041fbee /sw
parentdcc4c1a7d4968fa0dc2331e218861f4450ad5225 (diff)
fdo#81033: writerfilter: RTF import: fix tab stop inheritance from style
For RTF, the tab stops that are set directly on the paragraph are the tab stops the paragraph has effectively; there is no equivalent of OOXML <w:tab w:val="clear" w:pos="4536"/> that would override a tab stop of the applied style; that is done by simply omitting the tab stop. It would perhaps be possible to implement something to synthesize a NS_ooxml::LN_Value_ST_TabJc_clear in the RTF tokenizer for this case, but it's simpler to just generally disable domain mapper's InitTabStopFromStyle() for RTF. Change-Id: I7b0581be8db19ffda81c8d1da290abf0a0f69529 (cherry picked from commit 7f6e26917d4aa682ed9c422c83b1df20d78177d2) Reviewed-on: https://gerrit.libreoffice.org/10596 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo81033.rtf12
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx14
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo81033.rtf b/sw/qa/extras/rtfimport/data/fdo81033.rtf
new file mode 100644
index 000000000000..500aeb7b799a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo81033.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+{\stylesheet
+{\s15\ql \tqc\tx4536\tqr\tx9072 header;}
+}
+
+\deftab709
+\pard\plain \s15\ql \tx3293\tlul\tx9072
+\tab
+\tab
+
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 7e5bd67e6a50..5a47fb7537bf 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1325,6 +1325,20 @@ DECLARE_RTFIMPORT_TEST(testGroupshape_notext, "groupshape-notext.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xGroupshape->getCount());
}
+DECLARE_RTFIMPORT_TEST(testFdo81033, "fdo81033.rtf")
+{
+ // Number of tabstops in the paragraph should be 2, was 3.
+ uno::Sequence<style::TabStop> tabs(
+ getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), tabs.getLength());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5808), tabs[0].Position);
+ CPPUNIT_ASSERT_EQUAL(style::TabAlign_LEFT, tabs[0].Alignment);
+ CPPUNIT_ASSERT_EQUAL(sal_Unicode(0), tabs[0].FillChar);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(16002), tabs[1].Position);
+ CPPUNIT_ASSERT_EQUAL(style::TabAlign_LEFT, tabs[1].Alignment);
+ CPPUNIT_ASSERT_EQUAL(sal_Unicode('_'), tabs[1].FillChar);
+}
+
DECLARE_RTFIMPORT_TEST(testFdo66565, "fdo66565.rtf")
{
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);