summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-11-28 09:08:12 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-11-28 14:19:21 +0100
commitb5e871deb8ce390b9fa694e21b0272c7462da703 (patch)
tree074cb288a16cef919a2c1c3dc1245d95d039930d /sw/qa
parent9f4491477b4bc221527633467c17c2529f1f0714 (diff)
tdf#104035 RTF export: fix handling of absolute tab positions
RtfAttributeOutput::ParaTabStop() assumed that they are always absolute, but WW8AttributeOutput::ParaTabStop() points out what compat setting decides if they are absolute or relative. Change-Id: Iafe8f6bb8733cae38a89f6c407763b0327e894e8
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf104035.rtf14
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx8
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf104035.rtf b/sw/qa/extras/rtfexport/data/tdf104035.rtf
new file mode 100644
index 000000000000..730238eb0c63
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf104035.rtf
@@ -0,0 +1,14 @@
+{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033
+{\fonttbl
+{\f5\fswiss\fcharset0\fprq2 Helvetica;}
+}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+\margl1440\margr1440
+\facingp\widowctrl\ftnbj\aenddoc\lytprtmet\hyphcaps0\formshade\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot \fet0\sectd \psz1\sbkodd\pgnrestart\linex0\headery1440\footery1080\endnhere\titlepg\sectdefaultcl
+\pard\plain \fi-2880\li2880\widctlpar\tx450\tx2880\tx3427\tx3787\tx4147\adjustright
+{\b\f5 1.0\tab FACILITY}
+{\f0\fs26 \tab Navy Golf operation physical/service environment is clean, safe and friendly for employees and customers, and creates a
+\par }
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 9c174450c95f..0c63f23972e0 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -60,6 +60,14 @@ DECLARE_RTFEXPORT_TEST(testTdf108949_footnote, "tdf108949_footnote.rtf")
getProperty<sal_Int32>(xFootnote->getAnchor(), "CharColor"));
}
+DECLARE_RTFEXPORT_TEST(testTdf104035, "tdf104035.rtf")
+{
+ auto aTabStops = getProperty<uno::Sequence<style::TabStop>>(getParagraph(1), "ParaTabStops");
+ CPPUNIT_ASSERT(aTabStops.hasElements());
+ // This was 3330 twips instead, as tabs were assumed to be relative.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(450)), aTabStops[0].Position);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */