summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo38786.rtf2
-rw-r--r--sw/qa/extras/rtfimport/data/fdo39053.rtfbin0 -> 22118 bytes
-rw-r--r--sw/qa/extras/rtfimport/data/fdo42465.rtf4
-rw-r--r--sw/qa/extras/rtfimport/data/fdo43965.rtf16
-rw-r--r--sw/qa/extras/rtfimport/data/fdo44176.rtf10
-rw-r--r--sw/qa/extras/rtfimport/data/fdo44211.rtf4
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45182.rtf11
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45187.rtf32
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45190.rtf10
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45394.rtf19
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45543.rtf8
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45553.rtf2
-rw-r--r--sw/qa/extras/rtfimport/data/fdo45563.rtf5
-rw-r--r--sw/qa/extras/rtfimport/data/fdo46662.rtf46
-rw-r--r--sw/qa/extras/rtfimport/data/fdo46955.rtf1
-rw-r--r--sw/qa/extras/rtfimport/data/fdo46966.rtf10
-rw-r--r--sw/qa/extras/rtfimport/data/fdo47036.rtf73
-rw-r--r--sw/qa/extras/rtfimport/data/fdo47107.rtf21
-rw-r--r--sw/qa/extras/rtfimport/data/fdo47326.rtf5
-rw-r--r--sw/qa/extras/rtfimport/data/fdo47764.rtf4
-rw-r--r--sw/qa/extras/rtfimport/data/fdo48023.rtf8
-rw-r--r--sw/qa/extras/rtfimport/data/fdo48037.rtf13
-rw-r--r--sw/qa/extras/rtfimport/data/fdo48104.rtf6
-rw-r--r--sw/qa/extras/rtfimport/data/fdo48193.rtf10
-rw-r--r--sw/qa/extras/rtfimport/data/fdo48356.rtf3
-rw-r--r--sw/qa/extras/rtfimport/data/fdo48876.rtf5
-rw-r--r--sw/qa/extras/rtfimport/data/fdo49271.rtf3
-rw-r--r--sw/qa/extras/rtfimport/data/fdo49501.rtf5
-rw-r--r--sw/qa/extras/rtfimport/data/fdo49659.rtf19
-rw-r--r--sw/qa/extras/rtfimport/data/fdo49692.rtf17
-rw-r--r--sw/qa/extras/rtfimport/data/fdo50539.rtf4
-rw-r--r--sw/qa/extras/rtfimport/data/fdo50665.rtf16
-rw-r--r--sw/qa/extras/rtfimport/data/n192129.rtf3
-rw-r--r--sw/qa/extras/rtfimport/data/n695479.rtf14
-rw-r--r--sw/qa/extras/rtfimport/data/n750757.rtf45
-rw-r--r--sw/qa/extras/rtfimport/data/n751020.rtf8
-rw-r--r--sw/qa/extras/rtfimport/data/n757651.rtf18
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx818
38 files changed, 1298 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo38786.rtf b/sw/qa/extras/rtfimport/data/fdo38786.rtf
new file mode 100644
index 000000000000..6397cee7a670
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo38786.rtf
@@ -0,0 +1,2 @@
+{\rtf1\chpgn
+\par}
diff --git a/sw/qa/extras/rtfimport/data/fdo39053.rtf b/sw/qa/extras/rtfimport/data/fdo39053.rtf
new file mode 100644
index 000000000000..71d26916fc99
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo39053.rtf
Binary files differ
diff --git a/sw/qa/extras/rtfimport/data/fdo42465.rtf b/sw/qa/extras/rtfimport/data/fdo42465.rtf
new file mode 100644
index 000000000000..06c29d42022c
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo42465.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+{\langfe1038\dbch\af14\afs24\alang1025\rtlch \ltrch\loch\fs24\lang1038\loch\f7
+k\uc2 \u243\'c3\'b3d\uc1 }
+\par }
diff --git a/sw/qa/extras/rtfimport/data/fdo43965.rtf b/sw/qa/extras/rtfimport/data/fdo43965.rtf
new file mode 100644
index 000000000000..968fe77e2782
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo43965.rtf
@@ -0,0 +1,16 @@
+{\rtf1\ansi\ansicpg1252
+{\fonttbl \f0\froman\fcharset0 Times;\f1\fswiss\fcharset0 Helvetica;}
+{\info{\subject Test file for LibreOffice 3.5}}
+\margl1440\margr1440\margt1440\margb1440\deftab720\viewkind1\viewscale100
+\pard\pardeftab720\ql\qnatural
+\f0\fs36
+{
+{\fs22\up8 2}
+}\
+{\box\brdrs Box
+}\
+Page feeds:\
+ This is on the first page.\
+\page
+ This is on the second page.\
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo44176.rtf b/sw/qa/extras/rtfimport/data/fdo44176.rtf
new file mode 100644
index 000000000000..c1754afced77
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo44176.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+{\header foo
+\par }
+\titlepg
+First page has no header.
+\par
+\pagebb
+Second page has a header.
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo44211.rtf b/sw/qa/extras/rtfimport/data/fdo44211.rtf
new file mode 100644
index 000000000000..699ce73e280f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo44211.rtf
@@ -0,0 +1,4 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0 Helvetica;}}
+\pard\f0\fs20\'e0\'e8\'e6
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo45182.rtf b/sw/qa/extras/rtfimport/data/fdo45182.rtf
new file mode 100644
index 000000000000..b076106162b7
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45182.rtf
@@ -0,0 +1,11 @@
+{\rtf1\deff0
+{\fonttbl
+{\f0\fcharset238
+Times New Roman;}
+}
+a\chftn
+{\footnote
+\ltrpar \pard\plain\'9eivnost\'ed
+\par
+}
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo45187.rtf b/sw/qa/extras/rtfimport/data/fdo45187.rtf
new file mode 100644
index 000000000000..61b71ade8082
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45187.rtf
@@ -0,0 +1,32 @@
+{\rtf1
+{\field
+{\*\fldinst SHAPE }
+{\fldrslt
+{\shp
+{\*\shpinst\shpleft1000\shptop1000\shpright2000\shpbottom2000
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+}
+}
+}
+}
+first
+\par
+{\field
+{\*\fldinst SHAPE }
+{\fldrslt
+{\shp
+{\*\shpinst\shpleft1000\shptop3000\shpright2000\shpbottom4000
+{\sp
+{\sn shapeType}
+{\sv 3}
+}
+}
+}
+}
+}
+second
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo45190.rtf b/sw/qa/extras/rtfimport/data/fdo45190.rtf
new file mode 100644
index 000000000000..613a283150f1
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45190.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+{\stylesheet
+{\s1 \fi-100 style;}
+}
+\s1\li0 first
+\par
+\pard
+\s1\fi-100\li0 second
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo45394.rtf b/sw/qa/extras/rtfimport/data/fdo45394.rtf
new file mode 100644
index 000000000000..6d02f50602ce
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45394.rtf
@@ -0,0 +1,19 @@
+{\rtf1
+{\fonttbl
+{\f37\fswiss\fcharset204\fprq2
+Verdana;}
+}
+{\headerr
+\f37 \'cf\'ca \'d0\'c8\'ca\par
+}
+\trowd \cellx4498\cellx9104
+\pard\plain\intbl
+\cell \cell
+\row
+\trowd \cellx4498\cellx9104
+\pard\plain\intbl
+c\cell d\cell
+\row
+\pard\plain
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo45543.rtf b/sw/qa/extras/rtfimport/data/fdo45543.rtf
new file mode 100644
index 000000000000..43a8c892cff0
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45543.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\fonttbl
+{\fdbminor\f31505\fbidi \froman\fcharset128\fprq1\'82\'6c\'82\'72 \'96\'be\'92\'a9;}
+}
+\pard\plain
+\f31505 \'82\'b1\'82\'cc\'95\'b6\'8f\'91\'82\'cd
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo45553.rtf b/sw/qa/extras/rtfimport/data/fdo45553.rtf
new file mode 100644
index 000000000000..38b9d36e64df
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45553.rtf
@@ -0,0 +1,2 @@
+{\rtf1 \sa240 space-after\par\pard
+\sb120 space-before\par}
diff --git a/sw/qa/extras/rtfimport/data/fdo45563.rtf b/sw/qa/extras/rtfimport/data/fdo45563.rtf
new file mode 100644
index 000000000000..3dd3fd0b9956
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo45563.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+only n\
+only r\ both r and n\
+last\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo46662.rtf b/sw/qa/extras/rtfimport/data/fdo46662.rtf
new file mode 100644
index 000000000000..db93c9c1eadc
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo46662.rtf
@@ -0,0 +1,46 @@
+{\rtf1
+{\*\listtable
+{\list\listtemplateid3
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'01\'00;}
+{\levelnumbers\'01;}
+\fi-360\li720\lin720 }
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'03\'00.\'01;}
+{\levelnumbers\'01\'03;}
+\fi-360\li1080\lin1080 }
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'05\'00.\'01.\'02;}
+{\levelnumbers\'01\'03\'05;}
+\fi-360\li1440\lin1440
+}
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'07\'00.\'01.\'02.\'03;}
+{\levelnumbers\'01\'03\'05\'07;}
+\fi-360\li1800\lin1800 }
+\listid3}
+}
+{\*\listoverridetable
+{\listoverride\listid3\listoverridecount0\ls3}
+}
+\pard\ls3
+{numbering with all sublevels: test 1
+\par
+}
+\pard\ls3\ilvl1
+{test 1.1
+\par
+}
+\pard\ls3\ilvl2
+{test 1.1.1
+\par
+}
+\pard\ls3\ilvl3
+{test 1.1.1.1
+\par
+}
+\pard\ls3
+{test 2
+\par
+}
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo46955.rtf b/sw/qa/extras/rtfimport/data/fdo46955.rtf
new file mode 100644
index 000000000000..4e3ddda79935
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo46955.rtf
@@ -0,0 +1 @@
+{\rtf1 \caps caps\par}
diff --git a/sw/qa/extras/rtfimport/data/fdo46966.rtf b/sw/qa/extras/rtfimport/data/fdo46966.rtf
new file mode 100644
index 000000000000..de0f7dff9c2f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo46966.rtf
@@ -0,0 +1,10 @@
+{\rtf1\ansi
+{\fonttbl{\f0 Times New Roman;}}
+{\stylesheet{\s0\snext0\f0\fs24 Normal;}}
+
+\margl720\margr1440\margt720\margb1440
+\sectd
+\marglsxn720\margrsxn1440\margtsxn720\margbsxn1440
+{\header Header}
+Text
+\par }
diff --git a/sw/qa/extras/rtfimport/data/fdo47036.rtf b/sw/qa/extras/rtfimport/data/fdo47036.rtf
new file mode 100644
index 000000000000..cc988f1eac0d
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo47036.rtf
@@ -0,0 +1,73 @@
+{\rtf1
+\paperw11904\paperh16836\margl864\margr288\margt360\margb360\gutter0\ltrsect
+\widowctrl\ftnbj\aenddoc\donotembedsysfont0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120
+\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot15426039 \fet0
+\ilfomacatclnup0\ltrpar \sectd \ltrsect\sbknone\linex0\sectdefaultcl\sftnbj
+\pard\plain \ltrpar\qc \li0\ri0\nowidctlpar
+\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\tx9360\tx9720\pvpg\phpg\posx939
+\posy2714\absh-450\absw10080\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1775824
+{\shp
+{\*\shpinst\shpleft1074\shptop528\shpright11487\shpbottom1945\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz3\shplid1029
+{\sp
+{\sn shapeType}
+{\sv 75}
+}
+{\sp
+{\sn fFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fFlipV}
+{\sv 0}
+}
+{\sp
+{\sn pib}
+{\sv
+{\pict\picscalex92\picscaley92\piccropl0\piccropr0\piccropt0\piccropb0
+\picw20032\pich2725\picwgoal11357\pichgoal1545\pngblip\bliptag-1891142031
+{\*\blipuid 8f477671d3377e167ce61bb2e9de72f7}
+47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b
+}
+}
+}
+{\sp
+{\sn posrelh}
+{\sv 1}
+}
+{\sp
+{\sn posrelv}
+{\sv 1}
+}
+{\sp
+{\sn fLayoutInCell}
+{\sv 0}
+}
+{\sp
+{\sn fBehindDocument}
+{\sv 1}
+}
+{\sp
+{\sn fLayoutInCell}
+{\sv 0}
+}
+}
+}
+}
+{\rtlch\fcs1 \ab\af1\afs33 \ltrch\fcs0
+\b\f1\fs33\cf1\insrsid15426039 Booking Advice}
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid15426039
+\par }
+\pard \pvpg\phpg\posx1914\posy4761\absh-2400\absw7674\wrapdefault
+\faauto\rin0\lin0\itap0
+{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf1\insrsid15426039 foo \tab \tab \tab \tab \tab \tab }
+{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid15426039
+\par }
+{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf1\insrsid15426039 x\tab
+\par
+\par }
+{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf6\insrsid16139741 y}
+{\rtlch\fcs1 \af1 \ltrch\fcs0
+\f1\cf6\insrsid15426039\charrsid15426039
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo47107.rtf b/sw/qa/extras/rtfimport/data/fdo47107.rtf
new file mode 100644
index 000000000000..74371cd57471
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo47107.rtf
@@ -0,0 +1,21 @@
+{\rtf1
+{\fonttbl
+{\f1 Symbol;}
+}
+\pard \fi-283\li283
+{\*\pn \pnlvlbody\pndec\pnstart1
+{\pntxta .}
+}
+{Alpha
+\par
+Beta
+\par }
+\pard \fi-283\li283
+{\*\pn \pnlvlblt\pnf1\pnstart1
+{\pntxtb \'b7}
+}
+{Alpha
+\par
+Beta
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo47326.rtf b/sw/qa/extras/rtfimport/data/fdo47326.rtf
new file mode 100644
index 000000000000..264e719127b7
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo47326.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+Windows\super\'ae\nosupersub XP:
+\pard
+ Cartes:\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo47764.rtf b/sw/qa/extras/rtfimport/data/fdo47764.rtf
new file mode 100644
index 000000000000..2a9d367b5aff
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo47764.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\cbpat0\cf0
+bug
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo48023.rtf b/sw/qa/extras/rtfimport/data/fdo48023.rtf
new file mode 100644
index 000000000000..6d6a0d9b551e
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48023.rtf
@@ -0,0 +1,8 @@
+{\rtf
+{\fonttbl
+{\f1 Arial;}
+}
+\pard
+\f1
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo48037.rtf b/sw/qa/extras/rtfimport/data/fdo48037.rtf
new file mode 100644
index 000000000000..af7217e49428
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48037.rtf
@@ -0,0 +1,13 @@
+{\rtf1\ansi\ansicpg1252\uc1 \deff0
+\pard\plain \lang1036
+{\f31 VINCENNES, LE }
+{\field
+{\*\fldinst
+DATE \\@ "d MMMM yyyy" \\* MERGEFORMAT
+}
+{\fldrslt
+xxx
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo48104.rtf b/sw/qa/extras/rtfimport/data/fdo48104.rtf
new file mode 100644
index 000000000000..64d5e5979e4f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48104.rtf
@@ -0,0 +1,6 @@
+{\rtf1
+first page\par
+\page
+{second page first line\par}
+second page second line\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo48193.rtf b/sw/qa/extras/rtfimport/data/fdo48193.rtf
new file mode 100644
index 000000000000..ca585496eaf4
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48193.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+\pard\plain
+foo
+{\field
+{\*\fldinst
+{\f8\fs16\f8 PAGE }
+}
+}
+bar
+\par }
diff --git a/sw/qa/extras/rtfimport/data/fdo48356.rtf b/sw/qa/extras/rtfimport/data/fdo48356.rtf
new file mode 100644
index 000000000000..59d6cb021d5f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48356.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+Ma\u269\'0dek
+\par }
diff --git a/sw/qa/extras/rtfimport/data/fdo48876.rtf b/sw/qa/extras/rtfimport/data/fdo48876.rtf
new file mode 100644
index 000000000000..49a6eb0bf6a9
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48876.rtf
@@ -0,0 +1,5 @@
+{\rtf
+\sl54
+C
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo49271.rtf b/sw/qa/extras/rtfimport/data/fdo49271.rtf
new file mode 100644
index 000000000000..4f3a48c6e9e8
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo49271.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+\fs50 one \par \par two \par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo49501.rtf b/sw/qa/extras/rtfimport/data/fdo49501.rtf
new file mode 100644
index 000000000000..47bd691b8e62
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo49501.rtf
@@ -0,0 +1,5 @@
+{\rtf
+\landscape \paperw15309 \paperh11907 \margl567 \margr567 \margt567 \margb567
+Department
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo49659.rtf b/sw/qa/extras/rtfimport/data/fdo49659.rtf
new file mode 100644
index 000000000000..c908826a1015
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo49659.rtf
@@ -0,0 +1,19 @@
+{\rtf1
+\sectd
+{\header
+{\trowd\cellx4000\cellx9500\pard\plain\intbl
+{\pict{\pngblip\picwgoal2340\pichgoal1000\picscalex50\picscaley50\piccropl0\piccropr0\piccropt0\piccropb0}89504e470d0a1a0a0000000d49484452000000750000003201000000004a22a9c50000009249444154789c63fccf800c7e3231a00216065dd33fc10f155b2c52
+5905fdf303d1e547f9a37c6af219d1d2230b03c3df94f4d058bfeb9785e63c6060606260f87be4b4ee8ad3559ff90da0fa2518db2412db1812a0e631ff3539ef
+f08581e10b030303030b030333c399957baf21ecfbf5eb3fafc3110686170c0c0c0c0cffffff293ec6a1c0c420785efeffff1fe8f60300fbbc2d919818ba7900
+00000049454e44ae426082}
+header1
+\cell\pard\plain\intbl
+header2
+\cell\row}
+}
+{\trowd\cellx4000\cellx9500\pard\plain\intbl
+body1
+\cell\pard\plain\intbl
+body2
+\cell\row}
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo49692.rtf b/sw/qa/extras/rtfimport/data/fdo49692.rtf
new file mode 100644
index 000000000000..bcd7004e627d
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo49692.rtf
@@ -0,0 +1,17 @@
+{\rtf1
+{\*\listtable
+{\list\listtemplateid1
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0
+{\leveltext \'00;}
+{\levelnumbers;}
+\fi0\li0}
+\listid1}
+}
+{\listoverridetable
+{\listoverride\listid1\listoverridecount0\ls1}
+}
+\ilvl0
+\ls1
+EULA
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo50539.rtf b/sw/qa/extras/rtfimport/data/fdo50539.rtf
new file mode 100644
index 000000000000..c8a13012f0b0
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo50539.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\chcbpat0\cf0
+bug
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo50665.rtf b/sw/qa/extras/rtfimport/data/fdo50665.rtf
new file mode 100644
index 000000000000..2536eb0df66e
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo50665.rtf
@@ -0,0 +1,16 @@
+{\rtf1\ansi\deff6
+{\fonttbl
+{\f1\fnil\fprq0\fcharset0 Times New Roman;}
+{\f4\fmodern\fprq1\fcharset0 Cumberland
+{\*\falt Courier New}
+;}
+{\f6\froman\fprq2\fcharset1 Book Antiqua
+{\*\falt Times New Roman}
+;}
+}
+\sectd\sbknone\pgwsxn11909\pghsxn16834\marglsxn1080\margrsxn1080\margtsxn2437\margbsxn1080\headery1080
+\pard\plain \s7\cf0\tqr\tx9990\tqr\tx9900
+{\loch\f6\fs24\lang1033\i0\b
+Page : \chpgn\par
+}
+}
diff --git a/sw/qa/extras/rtfimport/data/n192129.rtf b/sw/qa/extras/rtfimport/data/n192129.rtf
new file mode 100644
index 000000000000..1451b367823a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n192129.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+{\pict \pngblip \picw-64 \pich-1061137057 \picwgoal0 \pichgoal0 47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b}
+\par }
diff --git a/sw/qa/extras/rtfimport/data/n695479.rtf b/sw/qa/extras/rtfimport/data/n695479.rtf
new file mode 100644
index 000000000000..5fe7e4519c91
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n695479.rtf
@@ -0,0 +1,14 @@
+{\rtf1
+\paperw12240\paperh15840\margl360\margr360\margt360\margb302\gutter0\ltrsect
+\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\pvpg\posx116\posy2167\absh-300\absw5134\overlay\faauto\rin0\lin0\itap0
+\brdrb\brdrdb\brdrw15\brsp20
+\rtlch\fcs1 \af0\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1038\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp1038
+{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\cf1\lang1038\langfe1038\langnp1038\insrsid10974703
+\hich\af0\dbch\af31505\loch\f0 first
+\par }
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\pvpg\posx5562\posy5417\absh-226\absw5946\overlay\faauto\rin0\lin0\itap0\pararsid15926738
+{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \cf1\lang1038\langfe1038\langnp1038\insrsid10974703
+second\par }
+{\*\do\dobxmargin\dobypage\dodhgt0\dpline\dpx81\dpy4923\dpxsize11438\dpysize1\dplinecor0\dplinecog0\dplinecob0}
+\pard plain\par
+}
diff --git a/sw/qa/extras/rtfimport/data/n750757.rtf b/sw/qa/extras/rtfimport/data/n750757.rtf
new file mode 100644
index 000000000000..04d78b615a62
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n750757.rtf
@@ -0,0 +1,45 @@
+{\rtf1
+{\stylesheet
+{\s15\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033
+\sbasedon0 \snext15 \sqformat \spriority34 \styrsid13858768 List Paragraph;}
+}
+{\*\listtable
+{\list\listtemplateid188802200\listhybrid
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\leveltemplateid68026383
+\'02\'00.;}
+{\levelnumbers\'01;}
+\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li720\lin720 }
+{\listname ;}
+\listid983924569}
+}
+{\*\listoverridetable
+{\listoverride\listid983924569\listoverridecount0\ls4}
+}
+\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0
+\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 before
+\par
+{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 \hich\af31506\dbch\af31506\loch\f31506 1.\tab}
+}
+\pard\plain \ltrpar
+\s15\ql \fi-360\li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid13858768\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0
+\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 1
+\par
+{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 \hich\af31506\dbch\af31506\loch\f31506 2.\tab}
+}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0
+\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 2
+\par
+{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\insrsid420015 \hich\af31506\dbch\af31506\loch\f31506 3.\tab}
+}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid420015 num 3
+\par }
+\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033
+{
+\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 after
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/data/n751020.rtf b/sw/qa/extras/rtfimport/data/n751020.rtf
new file mode 100644
index 000000000000..66175cf8b901
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n751020.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\stylesheet
+{Normal;}
+}
+\linkstyles
+first\par
+second\par
+}
diff --git a/sw/qa/extras/rtfimport/data/n757651.rtf b/sw/qa/extras/rtfimport/data/n757651.rtf
new file mode 100644
index 000000000000..dfd49a8cda4b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n757651.rtf
@@ -0,0 +1,18 @@
+{\rtf1\ansi\deff3\adeflang1025
+{\fonttbl
+{\f0\froman\fprq2\fcharset0 Times New Roman;}
+}
+\sectd\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1260\margbsxn432
+\pard\plain\f0\fs24\sl480\slmult1
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par
+\pard\plain\f0\fs24\sl480\slmult1
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par
+\pard\plain\f0\fs24\sl480\slmult1
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par
+\pard\plain\f0\fs24\sl480\slmult1
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par
+\pard\plain\f0\fs24\sl480\slmult1
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par
+\pard\plain\f0\fs24\sl480\slmult1
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
new file mode 100644
index 000000000000..cb5a584503e0
--- /dev/null
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -0,0 +1,818 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Miklos Vajna <vmiklos@suse.cz> (SUSE, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2012 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "../swmodeltestbase.hxx"
+
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/graphic/GraphicType.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/style/CaseMap.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/LineSpacingMode.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
+#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/TextContentAnchorType.hpp>
+#include <com/sun/star/text/XFootnotesSupplier.hpp>
+#include <com/sun/star/text/XPageCursor.hpp>
+#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
+#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextTablesSupplier.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+
+#include <rtl/oustringostreaminserter.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/svapp.hxx>
+
+#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
+
+using rtl::OString;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
+class Test : public SwModelTestBase
+{
+public:
+ void testFdo45553();
+ void testN192129();
+ void testFdo45543();
+ void testN695479();
+ void testFdo42465();
+ void testFdo45187();
+ void testFdo46662();
+ void testN750757();
+ void testFdo45563();
+ void testFdo43965();
+ void testN751020();
+ void testFdo47326();
+ void testFdo47036();
+ void testFdo46955();
+ void testFdo45394();
+ void testFdo48104();
+ void testFdo47107();
+ void testFdo45182();
+ void testFdo44176();
+ void testFdo39053();
+ void testFdo48356();
+ void testFdo48023();
+ void testFdo48876();
+ void testFdo48193();
+ void testFdo44211();
+ void testFdo48037();
+ void testFdo47764();
+ void testFdo38786();
+ void testN757651();
+ void testFdo49501();
+ void testFdo49271();
+ void testFdo49692();
+ void testFdo45190();
+ void testFdo50539();
+ void testFdo50665();
+ void testFdo49659();
+ void testFdo46966();
+
+ CPPUNIT_TEST_SUITE(Test);
+#if !defined(MACOSX) && !defined(WNT)
+ CPPUNIT_TEST(testFdo45553);
+ CPPUNIT_TEST(testN192129);
+ CPPUNIT_TEST(testFdo45543);
+ CPPUNIT_TEST(testN695479);
+ CPPUNIT_TEST(testFdo42465);
+ CPPUNIT_TEST(testFdo45187);
+ CPPUNIT_TEST(testFdo46662);
+ CPPUNIT_TEST(testN750757);
+ CPPUNIT_TEST(testFdo45563);
+ CPPUNIT_TEST(testFdo43965);
+ CPPUNIT_TEST(testN751020);
+ CPPUNIT_TEST(testFdo47326);
+ CPPUNIT_TEST(testFdo47036);
+ CPPUNIT_TEST(testFdo46955);
+ CPPUNIT_TEST(testFdo45394);
+ CPPUNIT_TEST(testFdo48104);
+ CPPUNIT_TEST(testFdo47107);
+ CPPUNIT_TEST(testFdo45182);
+ CPPUNIT_TEST(testFdo44176);
+ CPPUNIT_TEST(testFdo39053);
+ CPPUNIT_TEST(testFdo48356);
+ CPPUNIT_TEST(testFdo48023);
+ CPPUNIT_TEST(testFdo48876);
+ CPPUNIT_TEST(testFdo48193);
+ CPPUNIT_TEST(testFdo44211);
+ CPPUNIT_TEST(testFdo48037);
+ CPPUNIT_TEST(testFdo47764);
+ CPPUNIT_TEST(testFdo38786);
+ CPPUNIT_TEST(testN757651);
+ CPPUNIT_TEST(testFdo49501);
+ CPPUNIT_TEST(testFdo49271);
+ CPPUNIT_TEST(testFdo49692);
+ CPPUNIT_TEST(testFdo45190);
+ CPPUNIT_TEST(testFdo50539);
+ CPPUNIT_TEST(testFdo50665);
+ CPPUNIT_TEST(testFdo49659);
+ CPPUNIT_TEST(testFdo46966);
+#endif
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ /// Load an RTF file and make the document available via mxComponent.
+ void load(const OUString& rURL);
+ /// Get page count.
+ int getPages();
+};
+
+void Test::load(const OUString& rFilename)
+{
+ mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + rFilename);
+}
+
+int Test::getPages()
+{
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ return xCursor->getPage();
+}
+
+void Test::testFdo45553()
+{
+ load("fdo45553.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ while (xParaEnum->hasMoreElements())
+ {
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ while (xRangeEnum->hasMoreElements())
+ {
+ uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
+ OUString aStr = xRange->getString();
+ if ( aStr == "space-before" )
+ {
+ sal_Int32 nMargin = 0;
+ uno::Reference<beans::XPropertySet> xPropertySet(xRange, uno::UNO_QUERY);
+ xPropertySet->getPropertyValue("ParaTopMargin") >>= nMargin;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(120)), nMargin);
+ }
+ else if ( aStr == "space-after" )
+ {
+ sal_Int32 nMargin = 0;
+ uno::Reference<beans::XPropertySet> xPropertySet(xRange, uno::UNO_QUERY);
+ xPropertySet->getPropertyValue("ParaBottomMargin") >>= nMargin;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(240)), nMargin);
+ }
+ }
+ }
+}
+
+void Test::testN192129()
+{
+ load("n192129.rtf");
+
+ // We expect that the result will be 16x16px.
+ Size aExpectedSize(16, 16);
+ MapMode aMap(MAP_100TH_MM);
+ aExpectedSize = Application::GetDefaultDevice()->PixelToLogic( aExpectedSize, aMap );
+
+ uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ awt::Size aActualSize(xShape->getSize());
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height);
+}
+
+void Test::testFdo45543()
+{
+ load("fdo45543.rtf");
+ CPPUNIT_ASSERT_EQUAL(5, getLength());
+}
+
+void Test::testN695479()
+{
+ load("n695479.rtf");
+
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+
+ // Negative ABSH should mean fixed size.
+ sal_Int16 nSizeType = 0;
+ xPropertySet->getPropertyValue("SizeType") >>= nSizeType;
+ CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, nSizeType);
+ sal_Int32 nHeight = 0;
+ xPropertySet->getPropertyValue("Height") >>= nHeight;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(300)), nHeight);
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ bool bFrameFound = false, bDrawFound = false;
+ for (int i = 0; i < xDraws->getCount(); ++i)
+ {
+ uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(i), uno::UNO_QUERY);
+ if (xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
+ {
+ // Both frames should be anchored to the first paragraph.
+ bFrameFound = true;
+ uno::Reference<text::XTextContent> xTextContent(xServiceInfo, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xRange(xTextContent->getAnchor(), uno::UNO_QUERY);
+ uno::Reference<text::XText> xText(xRange->getText(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("plain"), xText->getString());
+
+ if (i == 0)
+ {
+ // Additonally, the frist frame should have double border at the bottom.
+ table::BorderLine2 aBorder;
+ xPropertySet->getPropertyValue("BottomBorder") >>= aBorder;
+ CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::DOUBLE, aBorder.LineStyle);
+ }
+ }
+ else if (xServiceInfo->supportsService("com.sun.star.drawing.LineShape"))
+ {
+ // The older "drawing objects" syntax should be recognized.
+ bDrawFound = true;
+ xPropertySet.set(xServiceInfo, uno::UNO_QUERY);
+ sal_Int16 nHori = 0;
+ xPropertySet->getPropertyValue("HoriOrientRelation") >>= nHori;
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, nHori);
+ sal_Int16 nVert = 0;
+ xPropertySet->getPropertyValue("VertOrientRelation") >>= nVert;
+ CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, nVert);
+ }
+ }
+ CPPUNIT_ASSERT(bFrameFound);
+ CPPUNIT_ASSERT(bDrawFound);
+}
+
+void Test::testFdo42465()
+{
+ load("fdo42465.rtf");
+ CPPUNIT_ASSERT_EQUAL(3, getLength());
+}
+
+void Test::testFdo45187()
+{
+ load("fdo45187.rtf");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ // There should be two shapes.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount());
+ // They should be anchored to different paragraphs.
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ awt::Point aFirstPoint;
+ xPropertySet->getPropertyValue("AnchorPosition") >>= aFirstPoint;
+ xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY);
+ awt::Point aSecondPoint;
+ xPropertySet->getPropertyValue("AnchorPosition") >>= aSecondPoint;
+ CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y);
+}
+
+void Test::testFdo46662()
+{
+ load("fdo46662.rtf");
+
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum3"), uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProps;
+ xLevels->getByIndex(1) >>= aProps; // 2nd level
+
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ const beans::PropertyValue& rProp = aProps[i];
+
+ if ( rProp.Name == "ParentNumbering" )
+ {
+ sal_Int16 nValue;
+ rProp.Value >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nValue);
+ }
+ else if ( rProp.Name == "Suffix" )
+ {
+ rtl::OUString sValue;
+ rProp.Value >>= sValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
+ }
+ }
+}
+
+void Test::testN750757()
+{
+ load("n750757.rtf");
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+
+ uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+ sal_Bool bValue;
+ xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Bool(false), bValue);
+
+ xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+ xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue);
+}
+
+void Test::testFdo45563()
+{
+ load("fdo45563.rtf");
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ int i = 0;
+ while (xParaEnum->hasMoreElements())
+ {
+ xParaEnum->nextElement();
+ i++;
+ }
+ CPPUNIT_ASSERT_EQUAL(4, i);
+}
+
+void Test::testFdo43965()
+{
+ load("fdo43965.rtf");
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+
+ // First paragraph: the parameter of \up was ignored
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue;
+ xPropertySet->getPropertyValue("CharEscapement") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(58), nValue);
+ xPropertySet->getPropertyValue("CharEscapementHeight") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue);
+
+ // Second paragraph: Word vs Writer border default problem
+ xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+ table::BorderLine2 aBorder;
+ xPropertySet->getPropertyValue("TopBorder") >>= aBorder;
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth);
+
+ // Finally, make sure that we have two pages
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
+void Test::testN751020()
+{
+ load("n751020.rtf");
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
+ uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ xPropertySet->getPropertyValue("ParaBottomMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue);
+}
+
+void Test::testFdo47326()
+{
+ load("fdo47326.rtf");
+ // This was 15 only, as \super buffered text, then the contents of it got lost.
+ CPPUNIT_ASSERT_EQUAL(19, getLength());
+}
+
+void Test::testFdo47036()
+{
+ load("fdo47036.rtf");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ int nAtCharacter = 0;
+ for (int i = 0; i < xDraws->getCount(); ++i)
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY);
+ text::TextContentAnchorType eValue;
+ xPropertySet->getPropertyValue("AnchorType") >>= eValue;
+ if (eValue == text::TextContentAnchorType_AT_CHARACTER)
+ nAtCharacter++;
+ }
+ // The image at the document start was ignored.
+ CPPUNIT_ASSERT_EQUAL(1, nAtCharacter);
+
+ // There should be 2 textboxes, not 4
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+}
+
+void Test::testFdo46955()
+{
+ load("fdo46955.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ while (xParaEnum->hasMoreElements())
+ {
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ while (xRangeEnum->hasMoreElements())
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int16 nValue;
+ xPropertySet->getPropertyValue("CharCaseMap") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, nValue);
+ }
+ }
+}
+
+void Test::testFdo45394()
+{
+ load("fdo45394.rtf");
+
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ uno::Reference<text::XText> xHeaderText(xPropertySet->getPropertyValue("HeaderText"), uno::UNO_QUERY);
+ OUString aActual = xHeaderText->getString();
+ // Encoding in the header was wrong.
+ OUString aExpected("ПК РИК", 11, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+}
+
+void Test::testFdo48104()
+{
+ load("fdo48104.rtf");
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
+void Test::testFdo47107()
+{
+ load("fdo47107.rtf");
+
+ uno::Reference<container::XNameAccess> xNumberingStyles(getStyles("NumberingStyles"));
+ // Make sure numbered and bullet legacy syntax is recognized, this used to throw a NoSuchElementException
+ xNumberingStyles->getByName("WWNum1");
+ xNumberingStyles->getByName("WWNum2");
+}
+
+void Test::testFdo45182()
+{
+ load("fdo45182.rtf");
+
+ uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY);
+ // Encoding in the footnote was wrong.
+ OUString aExpected("živností", 10, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
+}
+
+void Test::testFdo44176()
+{
+ load("fdo44176.rtf");
+
+ uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles"));
+ uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xDefault(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+ sal_Int32 nFirstTop = 0, nDefaultTop = 0, nDefaultHeader = 0;
+ xFirstPage->getPropertyValue("TopMargin") >>= nFirstTop;
+ xDefault->getPropertyValue("TopMargin") >>= nDefaultTop;
+ xDefault->getPropertyValue("HeaderHeight") >>= nDefaultHeader;
+ CPPUNIT_ASSERT_EQUAL(nFirstTop, nDefaultTop + nDefaultHeader);
+}
+
+void Test::testFdo39053()
+{
+ load("fdo39053.rtf");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ int nAsCharacter = 0;
+ for (int i = 0; i < xDraws->getCount(); ++i)
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY);
+ text::TextContentAnchorType eValue;
+ xPropertySet->getPropertyValue("AnchorType") >>= eValue;
+ if (eValue == text::TextContentAnchorType_AS_CHARACTER)
+ nAsCharacter++;
+ }
+ // The image in binary format was ignored.
+ CPPUNIT_ASSERT_EQUAL(1, nAsCharacter);
+}
+
+void Test::testFdo48356()
+{
+ load("fdo48356.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ OUStringBuffer aBuf;
+ int i = 0;
+ while (xParaEnum->hasMoreElements())
+ {
+ xParaEnum->nextElement();
+ i++;
+ }
+ // The document used to be imported as two paragraphs.
+ CPPUNIT_ASSERT_EQUAL(1, i);
+}
+
+void Test::testFdo48023()
+{
+ lang::Locale aLocale;
+ aLocale.Language = "ru";
+ AllSettings aSettings(Application::GetSettings());
+ AllSettings aSavedSettings(aSettings);
+ aSettings.SetLocale(aLocale);
+ Application::SetSettings(aSettings);
+ load("fdo48023.rtf");
+ Application::SetSettings(aSavedSettings);
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ uno::Reference<text::XTextRange> xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
+
+ // Implicit encoding detection based on locale was missing
+ OUString aExpected("Программист", 22, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
+}
+
+void Test::testFdo48876()
+{
+ load("fdo48876.rtf");
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
+ uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+ style::LineSpacing aSpacing;
+ xPropertySet->getPropertyValue("ParaLineSpacing") >>= aSpacing;
+ CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, aSpacing.Mode);
+}
+
+void Test::testFdo48193()
+{
+ load("fdo48193.rtf");
+ CPPUNIT_ASSERT_EQUAL(7, getLength());
+}
+
+void Test::testFdo44211()
+{
+ lang::Locale aLocale;
+ aLocale.Language = "lt";
+ AllSettings aSettings(Application::GetSettings());
+ AllSettings aSavedSettings(aSettings);
+ aSettings.SetLocale(aLocale);
+ Application::SetSettings(aSettings);
+ load("fdo44211.rtf");
+ Application::SetSettings(aSavedSettings);
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRangeEnum = xRangeEnumAccess->createEnumeration();
+ uno::Reference<text::XTextRange> xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
+
+ OUString aExpected("ąčę", 6, RTL_TEXTENCODING_UTF8);
+ CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString());
+}
+
+void Test::testFdo48037()
+{
+ load("fdo48037.rtf");
+
+ uno::Reference<util::XNumberFormatsSupplier> xNumberSupplier(mxComponent, uno::UNO_QUERY_THROW);
+ lang::Locale aUSLocale, aFRLocale;
+ aUSLocale.Language = "en";
+ aFRLocale.Language = "fr";
+ sal_Int32 nExpected = xNumberSupplier->getNumberFormats()->addNewConverted("d MMMM yyyy", aUSLocale, aFRLocale);
+
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+ uno::Reference<beans::XPropertySet> xPropertySet(xFields->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nActual = 0;
+ xPropertySet->getPropertyValue("NumberFormat") >>= nActual;
+
+ CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+}
+
+void Test::testFdo47764()
+{
+ load("fdo47764.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ // \cbpat with zero argument should mean the auto (-1) color, not a default color (black)
+ xPropertySet->getPropertyValue("ParaBackColor") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
+}
+
+void Test::testFdo38786()
+{
+ load("fdo38786.rtf");
+
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+ // \chpgn was ignored, so exception was thrown
+ xFields->nextElement();
+}
+
+void Test::testN757651()
+{
+ load("n757651.rtf");
+
+ // The bug was that due to buggy layout the text expanded to two pages.
+ if (Application::GetDefaultDevice()->IsFontAvailable(OUString("Times New Roman")))
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
+void Test::testFdo49501()
+{
+ load("fdo49501.rtf");
+
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+
+ sal_Bool bIsLandscape = sal_False;
+ xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape;
+ CPPUNIT_ASSERT_EQUAL(sal_True, bIsLandscape);
+ sal_Int32 nExpected(TWIP_TO_MM100(567));
+ sal_Int32 nValue = 0;
+ xStyle->getPropertyValue("LeftMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
+ xStyle->getPropertyValue("RightMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
+ xStyle->getPropertyValue("TopMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
+ xStyle->getPropertyValue("BottomMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(nExpected, nValue);
+}
+
+void Test::testFdo49271()
+{
+ load("fdo49271.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ xParaEnum->nextElement();
+ uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+ float fValue = 0;
+ xPropertySet->getPropertyValue("CharHeight") >>= fValue;
+
+ CPPUNIT_ASSERT_EQUAL(25.f, fValue);
+}
+
+void Test::testFdo49692()
+{
+ load("fdo49692.rtf");
+
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProps;
+ xLevels->getByIndex(0) >>= aProps; // 1st level
+
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ const beans::PropertyValue& rProp = aProps[i];
+
+ if (rProp.Name == "Suffix")
+ {
+ rtl::OUString sValue;
+ rProp.Value >>= sValue;
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
+ }
+ }
+}
+
+void Test::testFdo45190()
+{
+ load("fdo45190.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+
+ // inherited \fi should be reset
+ uno::Reference<beans::XPropertySet> xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue);
+
+ // but direct one not
+ xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+ xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), nValue);
+}
+
+void Test::testFdo50539()
+{
+ load("fdo50539.rtf");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black)
+ xPropertySet->getPropertyValue("CharBackColor") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue);
+}
+
+void Test::testFdo50665()
+{
+ load("fdo50665.rtf");
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
+
+ // Access the second run, which is a textfield
+ xRunEnum->nextElement();
+ uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ OUString aValue;
+ xRun->getPropertyValue("CharFontName") >>= aValue;
+ // This used to be the default, as character properties were ignored.
+ CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), aValue);
+}
+
+void Test::testFdo49659()
+{
+ load("fdo49659.rtf");
+
+ // Both tables were ignored: 1) was in the header, 2) was ignored due to missing empty par at the end of the doc
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+
+ // The graphic was also empty
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xGraphic;
+ xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
+ sal_Int8 nValue = 0;
+ xGraphic->getPropertyValue("GraphicType") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, nValue);
+}
+
+void Test::testFdo46966()
+{
+ /*
+ * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch).
+ *
+ * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin
+ */
+ load("fdo46966.rtf");
+
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ xPropertySet->getPropertyValue("TopMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), nValue);
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */