summaryrefslogtreecommitdiffstats
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-01-29 22:01:54 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-01-30 09:06:25 +0100
commit7655001a65a250ea7cd70f2efcc78037b5a9813f (patch)
tree7c2ff4a2b68625b4400ce454bae747fe70313c61 /sw/qa/extras/rtfimport
parentiOS: linker changes for on device (diff)
downloadcore-7655001a65a250ea7cd70f2efcc78037b5a9813f.tar.gz
core-7655001a65a250ea7cd70f2efcc78037b5a9813f.zip
tdf#115155 RTF import: fix left indent handling inside list definition
This used to work in the past only because the left indent was also imported as a direct paragraph formatting, but that is not the case since left margin of lists is deduplicated during import after commit c9dee880d88305312094b311abdae155e452bf14 (tdf#104016 RTF import: deduplicate before text indent from numbering, 2017-12-05). Change-Id: I1c9be30700c51ef97fb274e8781d6008db3121d8 Reviewed-on: https://gerrit.libreoffice.org/48855 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf115155.rtf30
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx10
2 files changed, 40 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf115155.rtf b/sw/qa/extras/rtfimport/data/tdf115155.rtf
new file mode 100644
index 000000000000..199a6df68485
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf115155.rtf
@@ -0,0 +1,30 @@
+{\rtf1
+{\stylesheet
+{Normal;}
+}
+{\*\listtable
+{\list\listtemplateid-1421309416\listhybrid
+{\listlevel\levelnfc0\levelnfcn0\leveljc0
+\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\leveltemplateid646248826\'02\'00.;}
+{\levelnumbers\'01;}
+\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720 }
+{\listname ;}
+\listid2098404966}
+{\list\listtemplateid1569465126\listhybrid
+{\listlevel\levelnfc0\levelnfcn0\leveljc0
+\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\leveltemplateid-597686520\'02\'00.;}
+{\levelnumbers\'01;}
+\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1440 }
+\listid298658175}
+}
+{\*\listoverridetable
+{\listoverride\listid2098404966\listoverridecount0\ls1}
+{\listoverride\listid298658175\listoverridecount0\ls2}
+}
+\pard \fi-360\li720\ri0\ls1
+outer\par
+\pard \fi-360\li1440\ri0\ls2
+inner\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 103c6726abe4..6621626e662a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -175,6 +175,16 @@ DECLARE_RTFIMPORT_TEST(testFdo46662, "fdo46662.rtf")
}
}
+DECLARE_RTFIMPORT_TEST(testTdf115155, "tdf115155.rtf")
+{
+ auto xLevels
+ = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(2), "NumberingRules");
+ // 1st level
+ comphelper::SequenceAsHashMap aMap(xLevels->getByIndex(0));
+ // This was 1270: the left margin in the numbering rule was too small.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2540), aMap["IndentAt"].get<sal_Int32>());
+}
+
DECLARE_RTFIMPORT_TEST(testTdf108951, "tdf108951.rtf")
{
// This test is import-only, as we assert the list ID, which is OK to