diff options
-rw-r--r-- | sw/CppunitTest_sw_rtfexport2.mk | 60 | ||||
-rw-r--r-- | sw/CppunitTest_sw_rtfexport3.mk | 58 | ||||
-rw-r--r-- | sw/Module_sw.mk | 2 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/all_gaps_word.rtf (renamed from sw/qa/extras/rtfimport/data/all_gaps_word.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/bin-skipping.rtf (renamed from sw/qa/extras/rtfimport/data/bin-skipping.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/char-color.rtf (renamed from sw/qa/extras/rtfimport/data/char-color.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/classification-confidential.rtf (renamed from sw/qa/extras/rtfimport/data/classification-confidential.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/classification-no.rtf | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/classification-yes.rtf | 11 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/copypaste-footnote-paste.rtf (renamed from sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/copypaste-footnote.rtf (renamed from sw/qa/extras/rtfimport/data/copypaste-footnote.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/copypaste-pagestyle-paste.rtf (renamed from sw/qa/extras/rtfimport/data/copypaste-pagestyle-paste.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/copypaste-pagestyle.rtf (renamed from sw/qa/extras/rtfimport/data/copypaste-pagestyle.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/cp1000018.rtf (renamed from sw/qa/extras/rtfimport/data/cp1000018.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/cs-bold.rtf (renamed from sw/qa/extras/rtfimport/data/cs-bold.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/do-dhgt-old.rtf (renamed from sw/qa/extras/rtfimport/data/do-dhgt-old.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/do-dhgt.rtf (renamed from sw/qa/extras/rtfimport/data/do-dhgt.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/dplinehollow.rtf (renamed from sw/qa/extras/rtfimport/data/dplinehollow.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/dppolyline.rtf (renamed from sw/qa/extras/rtfimport/data/dppolyline.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/dprect-anchor.rtf (renamed from sw/qa/extras/rtfimport/data/dprect-anchor.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/dptxbx-relation.rtf (renamed from sw/qa/extras/rtfimport/data/dptxbx-relation.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo36089.rtf (renamed from sw/qa/extras/rtfimport/data/fdo36089.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo37716.rtf (renamed from sw/qa/extras/rtfimport/data/fdo37716.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo38786.rtf (renamed from sw/qa/extras/rtfimport/data/fdo38786.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo39001.rtf (renamed from sw/qa/extras/rtfimport/data/fdo39001.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo39053.rtf (renamed from sw/qa/extras/rtfimport/data/fdo39053.rtf) | bin | 22118 -> 22118 bytes | |||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo42109.rtf (renamed from sw/qa/extras/rtfimport/data/fdo42109.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo42465.rtf (renamed from sw/qa/extras/rtfimport/data/fdo42465.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo43965.rtf (renamed from sw/qa/extras/rtfimport/data/fdo43965.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo44053.rtf (renamed from sw/qa/extras/rtfimport/data/fdo44053.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo44176.rtf (renamed from sw/qa/extras/rtfimport/data/fdo44176.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo44211.rtf (renamed from sw/qa/extras/rtfimport/data/fdo44211.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo44715.rtf (renamed from sw/qa/extras/rtfimport/data/fdo44715.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo45187.rtf (renamed from sw/qa/extras/rtfimport/data/fdo45187.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo45394.rtf (renamed from sw/qa/extras/rtfimport/data/fdo45394.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo45543.rtf (renamed from sw/qa/extras/rtfimport/data/fdo45543.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo45553.rtf (renamed from sw/qa/extras/rtfimport/data/fdo45553.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo45563.rtf (renamed from sw/qa/extras/rtfimport/data/fdo45563.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo46955.rtf (renamed from sw/qa/extras/rtfimport/data/fdo46955.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo46966.rtf (renamed from sw/qa/extras/rtfimport/data/fdo46966.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo47107.rtf (renamed from sw/qa/extras/rtfimport/data/fdo47107.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo47326.rtf (renamed from sw/qa/extras/rtfimport/data/fdo47326.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo47495.rtf (renamed from sw/qa/extras/rtfimport/data/fdo47495.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo47764.rtf (renamed from sw/qa/extras/rtfimport/data/fdo47764.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo47802.rtf (renamed from sw/qa/extras/rtfimport/data/fdo47802.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48023.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48023.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48033.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48033.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48037.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48037.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48104.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48104.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48193.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48193.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48356.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48356.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48440.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48440.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48446.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48446.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo48876.rtf (renamed from sw/qa/extras/rtfimport/data/fdo48876.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo49271.rtf (renamed from sw/qa/extras/rtfimport/data/fdo49271.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo49501.rtf (renamed from sw/qa/extras/rtfimport/data/fdo49501.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo49655.rtf (renamed from sw/qa/extras/rtfimport/data/fdo49655.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo49659.rtf (renamed from sw/qa/extras/rtfimport/data/fdo49659.rtf) | 0 | ||||
-rwxr-xr-x | sw/qa/extras/rtfexport/data/fdo49893-2.rtf (renamed from sw/qa/extras/rtfimport/data/fdo49893-2.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo49934.rtf (renamed from sw/qa/extras/rtfimport/data/fdo49934.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo50539.rtf (renamed from sw/qa/extras/rtfimport/data/fdo50539.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo50665.rtf (renamed from sw/qa/extras/rtfimport/data/fdo50665.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo51916.rtf (renamed from sw/qa/extras/rtfimport/data/fdo51916.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo52389.rtf (renamed from sw/qa/extras/rtfimport/data/fdo52389.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo52475.rtf (renamed from sw/qa/extras/rtfimport/data/fdo52475.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo52989.rtf (renamed from sw/qa/extras/rtfimport/data/fdo52989.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo53594.rtf (renamed from sw/qa/extras/rtfimport/data/fdo53594.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo54473.rtf (renamed from sw/qa/extras/rtfimport/data/fdo54473.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo54612.rtf (renamed from sw/qa/extras/rtfimport/data/fdo54612.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo54900.rtf (renamed from sw/qa/extras/rtfimport/data/fdo54900.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo55493.rtf (renamed from sw/qa/extras/rtfimport/data/fdo55493.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo56512.rtf (renamed from sw/qa/extras/rtfimport/data/fdo56512.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo57678.rtf (renamed from sw/qa/extras/rtfimport/data/fdo57678.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo57886.rtf (renamed from sw/qa/extras/rtfimport/data/fdo57886.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo58076-2.rtf (renamed from sw/qa/extras/rtfimport/data/fdo58076-2.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo58076.rtf (renamed from sw/qa/extras/rtfimport/data/fdo58076.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo58646.rtf (renamed from sw/qa/extras/rtfimport/data/fdo58646.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo58646line.rtf (renamed from sw/qa/extras/rtfimport/data/fdo58646line.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo58933.rtf (renamed from sw/qa/extras/rtfimport/data/fdo58933.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo59419.rtf (renamed from sw/qa/extras/rtfimport/data/fdo59419.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo59638.rtf (renamed from sw/qa/extras/rtfimport/data/fdo59638.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo60722.rtf (renamed from sw/qa/extras/rtfimport/data/fdo60722.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo61193.rtf (renamed from sw/qa/extras/rtfimport/data/fdo61193.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo61909.rtf (renamed from sw/qa/extras/rtfimport/data/fdo61909.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo62044-paste.rtf (renamed from sw/qa/extras/rtfimport/data/fdo62044-paste.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo62044.rtf (renamed from sw/qa/extras/rtfimport/data/fdo62044.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo62288.rtf (renamed from sw/qa/extras/rtfimport/data/fdo62288.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo62805.rtf (renamed from sw/qa/extras/rtfimport/data/fdo62805.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo62977.rtf (renamed from sw/qa/extras/rtfimport/data/fdo62977.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo63023.rtf (renamed from sw/qa/extras/rtfimport/data/fdo63023.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo63428.rtf (renamed from sw/qa/extras/rtfimport/data/fdo63428.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo64637.rtf (renamed from sw/qa/extras/rtfimport/data/fdo64637.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo64671.rtf (renamed from sw/qa/extras/rtfimport/data/fdo64671.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo65090.rtf (renamed from sw/qa/extras/rtfimport/data/fdo65090.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo66040.rtf (renamed from sw/qa/extras/rtfimport/data/fdo66040.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo67498.rtf (renamed from sw/qa/extras/rtfimport/data/fdo67498.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo68076.rtf (renamed from sw/qa/extras/rtfimport/data/fdo68076.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo68779.rtf (renamed from sw/qa/extras/rtfimport/data/fdo68779.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo69289.rtf (renamed from sw/qa/extras/rtfimport/data/fdo69289.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo69384-paste.rtf (renamed from sw/qa/extras/rtfimport/data/fdo69384-paste.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo70221.rtf (renamed from sw/qa/extras/rtfimport/data/fdo70221.rtf) | bin | 3714 -> 3714 bytes | |||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo70578.rtf (renamed from sw/qa/extras/rtfimport/data/fdo70578.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo72031.rtf (renamed from sw/qa/extras/rtfimport/data/fdo72031.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo73241.rtf (renamed from sw/qa/extras/rtfimport/data/fdo73241.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo74229.rtf (renamed from sw/qa/extras/rtfimport/data/fdo74229.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo75735.rtf (renamed from sw/qa/extras/rtfimport/data/fdo75735.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo76628.rtf (renamed from sw/qa/extras/rtfimport/data/fdo76628.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo76633.rtf (renamed from sw/qa/extras/rtfimport/data/fdo76633.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo77267.rtf (renamed from sw/qa/extras/rtfimport/data/fdo77267.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo77996.rtf (renamed from sw/qa/extras/rtfimport/data/fdo77996.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo78502.rtf (renamed from sw/qa/extras/rtfimport/data/fdo78502.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo79384.rtf (renamed from sw/qa/extras/rtfimport/data/fdo79384.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo79959.rtf (renamed from sw/qa/extras/rtfimport/data/fdo79959.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo80905.rtf (renamed from sw/qa/extras/rtfimport/data/fdo80905.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo81892.rtf (renamed from sw/qa/extras/rtfimport/data/fdo81892.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo82076.rtf (renamed from sw/qa/extras/rtfimport/data/fdo82076.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo82078.rtf (renamed from sw/qa/extras/rtfimport/data/fdo82078.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo82106.rtf (renamed from sw/qa/extras/rtfimport/data/fdo82106.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo82859.rtf (renamed from sw/qa/extras/rtfimport/data/fdo82859.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo83204.rtf (renamed from sw/qa/extras/rtfimport/data/fdo83204.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo83464.rtf (renamed from sw/qa/extras/rtfimport/data/fdo83464.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo84679.rtf (renamed from sw/qa/extras/rtfimport/data/fdo84679.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo85889-mac.rtf (renamed from sw/qa/extras/rtfimport/data/fdo85889-mac.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo85889-pc.rtf (renamed from sw/qa/extras/rtfimport/data/fdo85889-pc.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo85889-pca.rtf (renamed from sw/qa/extras/rtfimport/data/fdo85889-pca.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo86750.rtf (renamed from sw/qa/extras/rtfimport/data/fdo86750.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo86761.rtf (renamed from sw/qa/extras/rtfimport/data/fdo86761.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/fdo89496.rtf (renamed from sw/qa/extras/rtfimport/data/fdo89496.rtf) | 0 | ||||
-rwxr-xr-x | sw/qa/extras/rtfexport/data/fdo94835.rtf (renamed from sw/qa/extras/rtfimport/data/fdo94835.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/font-override.rtf (renamed from sw/qa/extras/rtfimport/data/font-override.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/footer-para.rtf (renamed from sw/qa/extras/rtfimport/data/footer-para.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/hello.rtf | 1 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/hexcrlf.rtf (renamed from sw/qa/extras/rtfimport/data/hexcrlf.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/landscape.rtf (renamed from sw/qa/extras/rtfimport/data/landscape.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/leftmargin-default.rtf (renamed from sw/qa/extras/rtfimport/data/leftmargin-default.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/levelfollow.rtf (renamed from sw/qa/extras/rtfimport/data/levelfollow.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/mathtype.rtf (renamed from sw/qa/extras/rtfimport/data/mathtype.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n192129.rtf (renamed from sw/qa/extras/rtfimport/data/n192129.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n750757.rtf (renamed from sw/qa/extras/rtfimport/data/n750757.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n751020.rtf (renamed from sw/qa/extras/rtfimport/data/n751020.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n757651.rtf (renamed from sw/qa/extras/rtfimport/data/n757651.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n818997.rtf (renamed from sw/qa/extras/rtfimport/data/n818997.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n820504.rtf (renamed from sw/qa/extras/rtfimport/data/n820504.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/n825305.rtf (renamed from sw/qa/extras/rtfimport/data/n825305.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/para-bottom-margin.rtf (renamed from sw/qa/extras/rtfimport/data/para-bottom-margin.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/rhbz1065629.rtf (renamed from sw/qa/extras/rtfimport/data/rhbz1065629.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/shptxt-pard.rtf (renamed from sw/qa/extras/rtfimport/data/shptxt-pard.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/shpz-dhgt.rtf (renamed from sw/qa/extras/rtfimport/data/shpz-dhgt.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf100507.rtf (renamed from sw/qa/extras/rtfimport/data/tdf100507.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf104287.rtf (renamed from sw/qa/extras/rtfimport/data/tdf104287.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf104317.rtf (renamed from sw/qa/extras/rtfimport/data/tdf104317.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf104744.rtf (renamed from sw/qa/extras/rtfimport/data/tdf104744.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf105729.rtf (renamed from sw/qa/extras/rtfimport/data/tdf105729.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf105852.rtf (renamed from sw/qa/extras/rtfimport/data/tdf105852.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf106694.rtf (renamed from sw/qa/extras/rtfimport/data/tdf106694.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf106950.rtf (renamed from sw/qa/extras/rtfimport/data/tdf106950.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf106953.rtf (renamed from sw/qa/extras/rtfimport/data/tdf106953.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf107116.rtf (renamed from sw/qa/extras/rtfimport/data/tdf107116.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf108123.rtf (renamed from sw/qa/extras/rtfimport/data/tdf108123.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf108416.rtf (renamed from sw/qa/extras/rtfimport/data/tdf108416.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf108949_footnoteCharFormat.odt | bin | 0 -> 14038 bytes | |||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf44986.rtf (renamed from sw/qa/extras/rtfimport/data/tdf44986.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf50821.rtf (renamed from sw/qa/extras/rtfimport/data/tdf50821.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf54584.rtf (renamed from sw/qa/extras/rtfimport/data/tdf54584.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf74795.rtf (renamed from sw/qa/extras/rtfimport/data/tdf74795.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf75614.rtf (renamed from sw/qa/extras/rtfimport/data/tdf75614.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf77349.rtf (renamed from sw/qa/extras/rtfimport/data/tdf77349.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf82073.rtf (renamed from sw/qa/extras/rtfimport/data/tdf82073.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf86182.rtf (renamed from sw/qa/extras/rtfimport/data/tdf86182.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf86814.rtf (renamed from sw/qa/extras/rtfimport/data/tdf86814.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf87034.rtf (renamed from sw/qa/extras/rtfimport/data/tdf87034.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf88811.rtf (renamed from sw/qa/extras/rtfimport/data/tdf88811.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf90260-nopar.rtf (renamed from sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf90697.rtf (renamed from sw/qa/extras/rtfimport/data/tdf90697.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf91074.rtf (renamed from sw/qa/extras/rtfimport/data/tdf91074.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf92061.rtf (renamed from sw/qa/extras/rtfimport/data/tdf92061.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf92481.rtf (renamed from sw/qa/extras/rtfimport/data/tdf92481.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf94435.rtf (renamed from sw/qa/extras/rtfimport/data/tdf94435.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf94456.rtf (renamed from sw/qa/extras/rtfimport/data/tdf94456.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf95707.rtf (renamed from sw/qa/extras/rtfimport/data/tdf95707.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf96275.rtf (renamed from sw/qa/extras/rtfimport/data/tdf96275.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf96308-deftab.rtf (renamed from sw/qa/extras/rtfimport/data/tdf96308-deftab.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf97035.rtf (renamed from sw/qa/extras/rtfimport/data/tdf97035.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport2.cxx | 1844 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport3.cxx | 40 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 1768 |
186 files changed, 2019 insertions, 1766 deletions
diff --git a/sw/CppunitTest_sw_rtfexport2.mk b/sw/CppunitTest_sw_rtfexport2.mk new file mode 100644 index 000000000000..3519afec5e7a --- /dev/null +++ b/sw/CppunitTest_sw_rtfexport2.mk @@ -0,0 +1,60 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_rtfexport2)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_rtfexport2, \ + sw/qa/extras/rtfexport/rtfexport2 \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_rtfexport2, \ + comphelper \ + cppu \ + cppuhelper \ + i18nlangtag \ + sal \ + sfx \ + sw \ + test \ + unotest \ + utl \ + vcl \ + tl \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_rtfexport2,\ + boost_headers \ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_rtfexport2,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + -I$(SRCDIR)/sw/qa/extras/inc \ + $$(INCLUDE) \ +)) + +ifeq ($(OS),WNT) +$(eval $(call gb_CppunitTest_add_cxxflags,sw_rtfexport2,\ + -bigobj \ +)) +endif + +$(eval $(call gb_CppunitTest_use_sdk_api,sw_rtfexport2)) + +$(eval $(call gb_CppunitTest_use_ure,sw_rtfexport2)) +$(eval $(call gb_CppunitTest_use_vcl,sw_rtfexport2)) + +$(eval $(call gb_CppunitTest_use_rdb,sw_rtfexport2,services)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_rtfexport2)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_rtfexport3.mk b/sw/CppunitTest_sw_rtfexport3.mk new file mode 100644 index 000000000000..d0ebff13c4aa --- /dev/null +++ b/sw/CppunitTest_sw_rtfexport3.mk @@ -0,0 +1,58 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_rtfexport3)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_rtfexport3, \ + sw/qa/extras/rtfexport/rtfexport3 \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_rtfexport3, \ + comphelper \ + cppu \ + cppuhelper \ + sal \ + sfx \ + sw \ + test \ + unotest \ + utl \ + tl \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_rtfexport3,\ + boost_headers \ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_rtfexport3,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + -I$(SRCDIR)/sw/qa/extras/inc \ + $$(INCLUDE) \ +)) + +ifeq ($(OS),WNT) +$(eval $(call gb_CppunitTest_add_cxxflags,sw_rtfexport3,\ + -bigobj \ +)) +endif + +$(eval $(call gb_CppunitTest_use_sdk_api,sw_rtfexport3)) + +$(eval $(call gb_CppunitTest_use_ure,sw_rtfexport3)) +$(eval $(call gb_CppunitTest_use_vcl,sw_rtfexport3)) + +$(eval $(call gb_CppunitTest_use_rdb,sw_rtfexport3,services)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_rtfexport3)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 243566b9de9e..54a43681bed3 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -72,6 +72,8 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_ww8export2 \ CppunitTest_sw_ww8import \ CppunitTest_sw_rtfexport \ + CppunitTest_sw_rtfexport2 \ + CppunitTest_sw_rtfexport3 \ CppunitTest_sw_rtfimport \ CppunitTest_sw_odfexport \ CppunitTest_sw_odfimport \ diff --git a/sw/qa/extras/rtfimport/data/all_gaps_word.rtf b/sw/qa/extras/rtfexport/data/all_gaps_word.rtf index 0e37b3b50069..0e37b3b50069 100644 --- a/sw/qa/extras/rtfimport/data/all_gaps_word.rtf +++ b/sw/qa/extras/rtfexport/data/all_gaps_word.rtf diff --git a/sw/qa/extras/rtfimport/data/bin-skipping.rtf b/sw/qa/extras/rtfexport/data/bin-skipping.rtf index 442607490bf3..442607490bf3 100644 --- a/sw/qa/extras/rtfimport/data/bin-skipping.rtf +++ b/sw/qa/extras/rtfexport/data/bin-skipping.rtf diff --git a/sw/qa/extras/rtfimport/data/char-color.rtf b/sw/qa/extras/rtfexport/data/char-color.rtf index a6483be2096e..a6483be2096e 100644 --- a/sw/qa/extras/rtfimport/data/char-color.rtf +++ b/sw/qa/extras/rtfexport/data/char-color.rtf diff --git a/sw/qa/extras/rtfimport/data/classification-confidential.rtf b/sw/qa/extras/rtfexport/data/classification-confidential.rtf index c7207f9de57d..c7207f9de57d 100644 --- a/sw/qa/extras/rtfimport/data/classification-confidential.rtf +++ b/sw/qa/extras/rtfexport/data/classification-confidential.rtf diff --git a/sw/qa/extras/rtfexport/data/classification-no.rtf b/sw/qa/extras/rtfexport/data/classification-no.rtf new file mode 100644 index 000000000000..7c773d1e2a1c --- /dev/null +++ b/sw/qa/extras/rtfexport/data/classification-no.rtf @@ -0,0 +1 @@ +{\rtf1 \par classification-no\par} diff --git a/sw/qa/extras/rtfexport/data/classification-yes.rtf b/sw/qa/extras/rtfexport/data/classification-yes.rtf new file mode 100644 index 000000000000..a40c3d1dbb7b --- /dev/null +++ b/sw/qa/extras/rtfexport/data/classification-yes.rtf @@ -0,0 +1,11 @@ +{\rtf1{\*\userprops +{\propname urn:bails:IntellectualProperty:Authorization:StartValidity}\proptype30{\staticval 2016-03-08T10:55:18,531376147}{\propname urn:bails:IntellectualProperty:Authorization:StopValidity}\proptype30{\staticval None}{\propname urn:bails:IntellectualPr +operty:BusinessAuthorization:Identifier}\proptype30{\staticval urn:example:tscp:1}{\propname urn:bails:IntellectualProperty:BusinessAuthorization:Locator}\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:BusinessAuthorization:Name} +\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier}\proptype30{\staticval urn:example:tscp:1:internal-only}{\propname urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Identifier:OID} +\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Locator}\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:BusinessAuthorizationCategory:Name}\proptype30{\staticval Internal Only} +{\propname urn:bails:IntellectualProperty:Impact:Level:Availability}\proptype30{\staticval 3}{\propname urn:bails:IntellectualProperty:Impact:Level:Confidentiality}\proptype30{\staticval 3}{\propname urn:bails:IntellectualProperty:Impact:Level:Integrity} +\proptype30{\staticval 3}{\propname urn:bails:IntellectualProperty:Impact:Scale}\proptype30{\staticval UK-Cabinet}{\propname urn:bails:IntellectualProperty:Marking:document-footer}\proptype30{\staticval This content is marked Internal Only. Do not distrib +ute it outside of the business.}{\propname urn:bails:IntellectualProperty:Marking:document-header}\proptype30{\staticval Classification: Internal Only}{\propname urn:bails:IntellectualProperty:Marking:document-watermark}\proptype30{\staticval Internal Onl +y}{\propname urn:bails:IntellectualProperty:MarkingPrecedence}\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:Policy:Identifier}\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:Policy:Name}\proptype30{\staticval +TSCP Example Policy}{\propname urn:bails:IntellectualProperty:PolicyAuthority:Country}\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:PolicyAuthority:Identifier}\proptype30{\staticval None}{\propname urn:bails:IntellectualProperty:Po +licyAuthority:Name}\proptype30{\staticval TSCP Example Policy Authority}}\par classification-yes\par} diff --git a/sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf b/sw/qa/extras/rtfexport/data/copypaste-footnote-paste.rtf index a7c6bb244e55..a7c6bb244e55 100644 --- a/sw/qa/extras/rtfimport/data/copypaste-footnote-paste.rtf +++ b/sw/qa/extras/rtfexport/data/copypaste-footnote-paste.rtf diff --git a/sw/qa/extras/rtfimport/data/copypaste-footnote.rtf b/sw/qa/extras/rtfexport/data/copypaste-footnote.rtf index 1420878ef5d4..1420878ef5d4 100644 --- a/sw/qa/extras/rtfimport/data/copypaste-footnote.rtf +++ b/sw/qa/extras/rtfexport/data/copypaste-footnote.rtf diff --git a/sw/qa/extras/rtfimport/data/copypaste-pagestyle-paste.rtf b/sw/qa/extras/rtfexport/data/copypaste-pagestyle-paste.rtf index 3eca5f0275f2..3eca5f0275f2 100644 --- a/sw/qa/extras/rtfimport/data/copypaste-pagestyle-paste.rtf +++ b/sw/qa/extras/rtfexport/data/copypaste-pagestyle-paste.rtf diff --git a/sw/qa/extras/rtfimport/data/copypaste-pagestyle.rtf b/sw/qa/extras/rtfexport/data/copypaste-pagestyle.rtf index 6ab0e635f3f8..6ab0e635f3f8 100644 --- a/sw/qa/extras/rtfimport/data/copypaste-pagestyle.rtf +++ b/sw/qa/extras/rtfexport/data/copypaste-pagestyle.rtf diff --git a/sw/qa/extras/rtfimport/data/cp1000018.rtf b/sw/qa/extras/rtfexport/data/cp1000018.rtf index 725d21e94bc2..725d21e94bc2 100644 --- a/sw/qa/extras/rtfimport/data/cp1000018.rtf +++ b/sw/qa/extras/rtfexport/data/cp1000018.rtf diff --git a/sw/qa/extras/rtfimport/data/cs-bold.rtf b/sw/qa/extras/rtfexport/data/cs-bold.rtf index 8be0f2702fee..8be0f2702fee 100644 --- a/sw/qa/extras/rtfimport/data/cs-bold.rtf +++ b/sw/qa/extras/rtfexport/data/cs-bold.rtf diff --git a/sw/qa/extras/rtfimport/data/do-dhgt-old.rtf b/sw/qa/extras/rtfexport/data/do-dhgt-old.rtf index 07da38ff0ef8..07da38ff0ef8 100644 --- a/sw/qa/extras/rtfimport/data/do-dhgt-old.rtf +++ b/sw/qa/extras/rtfexport/data/do-dhgt-old.rtf diff --git a/sw/qa/extras/rtfimport/data/do-dhgt.rtf b/sw/qa/extras/rtfexport/data/do-dhgt.rtf index d46c6c7a1918..d46c6c7a1918 100644 --- a/sw/qa/extras/rtfimport/data/do-dhgt.rtf +++ b/sw/qa/extras/rtfexport/data/do-dhgt.rtf diff --git a/sw/qa/extras/rtfimport/data/dplinehollow.rtf b/sw/qa/extras/rtfexport/data/dplinehollow.rtf index fdfddbf4da01..fdfddbf4da01 100644 --- a/sw/qa/extras/rtfimport/data/dplinehollow.rtf +++ b/sw/qa/extras/rtfexport/data/dplinehollow.rtf diff --git a/sw/qa/extras/rtfimport/data/dppolyline.rtf b/sw/qa/extras/rtfexport/data/dppolyline.rtf index 0f6b8ce3d626..0f6b8ce3d626 100644 --- a/sw/qa/extras/rtfimport/data/dppolyline.rtf +++ b/sw/qa/extras/rtfexport/data/dppolyline.rtf diff --git a/sw/qa/extras/rtfimport/data/dprect-anchor.rtf b/sw/qa/extras/rtfexport/data/dprect-anchor.rtf index ac5675e5f975..ac5675e5f975 100644 --- a/sw/qa/extras/rtfimport/data/dprect-anchor.rtf +++ b/sw/qa/extras/rtfexport/data/dprect-anchor.rtf diff --git a/sw/qa/extras/rtfimport/data/dptxbx-relation.rtf b/sw/qa/extras/rtfexport/data/dptxbx-relation.rtf index 82f0741284bd..82f0741284bd 100644 --- a/sw/qa/extras/rtfimport/data/dptxbx-relation.rtf +++ b/sw/qa/extras/rtfexport/data/dptxbx-relation.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo36089.rtf b/sw/qa/extras/rtfexport/data/fdo36089.rtf index 035d74f6cec6..035d74f6cec6 100644 --- a/sw/qa/extras/rtfimport/data/fdo36089.rtf +++ b/sw/qa/extras/rtfexport/data/fdo36089.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo37716.rtf b/sw/qa/extras/rtfexport/data/fdo37716.rtf index 489bdb7fcd72..489bdb7fcd72 100644 --- a/sw/qa/extras/rtfimport/data/fdo37716.rtf +++ b/sw/qa/extras/rtfexport/data/fdo37716.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo38786.rtf b/sw/qa/extras/rtfexport/data/fdo38786.rtf index 6397cee7a670..6397cee7a670 100644 --- a/sw/qa/extras/rtfimport/data/fdo38786.rtf +++ b/sw/qa/extras/rtfexport/data/fdo38786.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo39001.rtf b/sw/qa/extras/rtfexport/data/fdo39001.rtf index 939b21dcbe13..939b21dcbe13 100644 --- a/sw/qa/extras/rtfimport/data/fdo39001.rtf +++ b/sw/qa/extras/rtfexport/data/fdo39001.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo39053.rtf b/sw/qa/extras/rtfexport/data/fdo39053.rtf Binary files differindex 71d26916fc99..71d26916fc99 100644 --- a/sw/qa/extras/rtfimport/data/fdo39053.rtf +++ b/sw/qa/extras/rtfexport/data/fdo39053.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo42109.rtf b/sw/qa/extras/rtfexport/data/fdo42109.rtf index fae63ac1933f..fae63ac1933f 100644 --- a/sw/qa/extras/rtfimport/data/fdo42109.rtf +++ b/sw/qa/extras/rtfexport/data/fdo42109.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo42465.rtf b/sw/qa/extras/rtfexport/data/fdo42465.rtf index 06c29d42022c..06c29d42022c 100644 --- a/sw/qa/extras/rtfimport/data/fdo42465.rtf +++ b/sw/qa/extras/rtfexport/data/fdo42465.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo43965.rtf b/sw/qa/extras/rtfexport/data/fdo43965.rtf index 968fe77e2782..968fe77e2782 100644 --- a/sw/qa/extras/rtfimport/data/fdo43965.rtf +++ b/sw/qa/extras/rtfexport/data/fdo43965.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo44053.rtf b/sw/qa/extras/rtfexport/data/fdo44053.rtf index ef5f97567634..ef5f97567634 100644 --- a/sw/qa/extras/rtfimport/data/fdo44053.rtf +++ b/sw/qa/extras/rtfexport/data/fdo44053.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo44176.rtf b/sw/qa/extras/rtfexport/data/fdo44176.rtf index c1754afced77..c1754afced77 100644 --- a/sw/qa/extras/rtfimport/data/fdo44176.rtf +++ b/sw/qa/extras/rtfexport/data/fdo44176.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo44211.rtf b/sw/qa/extras/rtfexport/data/fdo44211.rtf index 699ce73e280f..699ce73e280f 100644 --- a/sw/qa/extras/rtfimport/data/fdo44211.rtf +++ b/sw/qa/extras/rtfexport/data/fdo44211.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo44715.rtf b/sw/qa/extras/rtfexport/data/fdo44715.rtf index 1b2287f43d74..1b2287f43d74 100644 --- a/sw/qa/extras/rtfimport/data/fdo44715.rtf +++ b/sw/qa/extras/rtfexport/data/fdo44715.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo45187.rtf b/sw/qa/extras/rtfexport/data/fdo45187.rtf index 61b71ade8082..61b71ade8082 100644 --- a/sw/qa/extras/rtfimport/data/fdo45187.rtf +++ b/sw/qa/extras/rtfexport/data/fdo45187.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo45394.rtf b/sw/qa/extras/rtfexport/data/fdo45394.rtf index 6d02f50602ce..6d02f50602ce 100644 --- a/sw/qa/extras/rtfimport/data/fdo45394.rtf +++ b/sw/qa/extras/rtfexport/data/fdo45394.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo45543.rtf b/sw/qa/extras/rtfexport/data/fdo45543.rtf index 43a8c892cff0..43a8c892cff0 100644 --- a/sw/qa/extras/rtfimport/data/fdo45543.rtf +++ b/sw/qa/extras/rtfexport/data/fdo45543.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo45553.rtf b/sw/qa/extras/rtfexport/data/fdo45553.rtf index 38b9d36e64df..38b9d36e64df 100644 --- a/sw/qa/extras/rtfimport/data/fdo45553.rtf +++ b/sw/qa/extras/rtfexport/data/fdo45553.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo45563.rtf b/sw/qa/extras/rtfexport/data/fdo45563.rtf index 3dd3fd0b9956..3dd3fd0b9956 100644 --- a/sw/qa/extras/rtfimport/data/fdo45563.rtf +++ b/sw/qa/extras/rtfexport/data/fdo45563.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo46955.rtf b/sw/qa/extras/rtfexport/data/fdo46955.rtf index 4e3ddda79935..4e3ddda79935 100644 --- a/sw/qa/extras/rtfimport/data/fdo46955.rtf +++ b/sw/qa/extras/rtfexport/data/fdo46955.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo46966.rtf b/sw/qa/extras/rtfexport/data/fdo46966.rtf index de0f7dff9c2f..de0f7dff9c2f 100644 --- a/sw/qa/extras/rtfimport/data/fdo46966.rtf +++ b/sw/qa/extras/rtfexport/data/fdo46966.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo47107.rtf b/sw/qa/extras/rtfexport/data/fdo47107.rtf index 74371cd57471..74371cd57471 100644 --- a/sw/qa/extras/rtfimport/data/fdo47107.rtf +++ b/sw/qa/extras/rtfexport/data/fdo47107.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo47326.rtf b/sw/qa/extras/rtfexport/data/fdo47326.rtf index 264e719127b7..264e719127b7 100644 --- a/sw/qa/extras/rtfimport/data/fdo47326.rtf +++ b/sw/qa/extras/rtfexport/data/fdo47326.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo47495.rtf b/sw/qa/extras/rtfexport/data/fdo47495.rtf index d7a7ca6c87c5..d7a7ca6c87c5 100644 --- a/sw/qa/extras/rtfimport/data/fdo47495.rtf +++ b/sw/qa/extras/rtfexport/data/fdo47495.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo47764.rtf b/sw/qa/extras/rtfexport/data/fdo47764.rtf index 2a9d367b5aff..2a9d367b5aff 100644 --- a/sw/qa/extras/rtfimport/data/fdo47764.rtf +++ b/sw/qa/extras/rtfexport/data/fdo47764.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo47802.rtf b/sw/qa/extras/rtfexport/data/fdo47802.rtf index cbbf94f70b54..cbbf94f70b54 100644 --- a/sw/qa/extras/rtfimport/data/fdo47802.rtf +++ b/sw/qa/extras/rtfexport/data/fdo47802.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48023.rtf b/sw/qa/extras/rtfexport/data/fdo48023.rtf index 6d6a0d9b551e..6d6a0d9b551e 100644 --- a/sw/qa/extras/rtfimport/data/fdo48023.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48023.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48033.rtf b/sw/qa/extras/rtfexport/data/fdo48033.rtf index 609a020556d2..609a020556d2 100644 --- a/sw/qa/extras/rtfimport/data/fdo48033.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48033.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48037.rtf b/sw/qa/extras/rtfexport/data/fdo48037.rtf index af7217e49428..af7217e49428 100644 --- a/sw/qa/extras/rtfimport/data/fdo48037.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48037.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48104.rtf b/sw/qa/extras/rtfexport/data/fdo48104.rtf index 64d5e5979e4f..64d5e5979e4f 100644 --- a/sw/qa/extras/rtfimport/data/fdo48104.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48104.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48193.rtf b/sw/qa/extras/rtfexport/data/fdo48193.rtf index ca585496eaf4..ca585496eaf4 100644 --- a/sw/qa/extras/rtfimport/data/fdo48193.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48193.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48356.rtf b/sw/qa/extras/rtfexport/data/fdo48356.rtf index 59d6cb021d5f..59d6cb021d5f 100644 --- a/sw/qa/extras/rtfimport/data/fdo48356.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48356.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48440.rtf b/sw/qa/extras/rtfexport/data/fdo48440.rtf index 8c5ac2dc41d9..8c5ac2dc41d9 100644 --- a/sw/qa/extras/rtfimport/data/fdo48440.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48440.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48446.rtf b/sw/qa/extras/rtfexport/data/fdo48446.rtf index 9ff8f6ca15e7..9ff8f6ca15e7 100644 --- a/sw/qa/extras/rtfimport/data/fdo48446.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48446.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo48876.rtf b/sw/qa/extras/rtfexport/data/fdo48876.rtf index 49a6eb0bf6a9..49a6eb0bf6a9 100644 --- a/sw/qa/extras/rtfimport/data/fdo48876.rtf +++ b/sw/qa/extras/rtfexport/data/fdo48876.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo49271.rtf b/sw/qa/extras/rtfexport/data/fdo49271.rtf index 4f3a48c6e9e8..4f3a48c6e9e8 100644 --- a/sw/qa/extras/rtfimport/data/fdo49271.rtf +++ b/sw/qa/extras/rtfexport/data/fdo49271.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo49501.rtf b/sw/qa/extras/rtfexport/data/fdo49501.rtf index 47bd691b8e62..47bd691b8e62 100644 --- a/sw/qa/extras/rtfimport/data/fdo49501.rtf +++ b/sw/qa/extras/rtfexport/data/fdo49501.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo49655.rtf b/sw/qa/extras/rtfexport/data/fdo49655.rtf index 60f90fc527c0..60f90fc527c0 100644 --- a/sw/qa/extras/rtfimport/data/fdo49655.rtf +++ b/sw/qa/extras/rtfexport/data/fdo49655.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo49659.rtf b/sw/qa/extras/rtfexport/data/fdo49659.rtf index c908826a1015..c908826a1015 100644 --- a/sw/qa/extras/rtfimport/data/fdo49659.rtf +++ b/sw/qa/extras/rtfexport/data/fdo49659.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo49893-2.rtf b/sw/qa/extras/rtfexport/data/fdo49893-2.rtf index ac05451d431d..ac05451d431d 100755 --- a/sw/qa/extras/rtfimport/data/fdo49893-2.rtf +++ b/sw/qa/extras/rtfexport/data/fdo49893-2.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo49934.rtf b/sw/qa/extras/rtfexport/data/fdo49934.rtf index 19ba5cda5a69..19ba5cda5a69 100644 --- a/sw/qa/extras/rtfimport/data/fdo49934.rtf +++ b/sw/qa/extras/rtfexport/data/fdo49934.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo50539.rtf b/sw/qa/extras/rtfexport/data/fdo50539.rtf index c8a13012f0b0..c8a13012f0b0 100644 --- a/sw/qa/extras/rtfimport/data/fdo50539.rtf +++ b/sw/qa/extras/rtfexport/data/fdo50539.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo50665.rtf b/sw/qa/extras/rtfexport/data/fdo50665.rtf index 2536eb0df66e..2536eb0df66e 100644 --- a/sw/qa/extras/rtfimport/data/fdo50665.rtf +++ b/sw/qa/extras/rtfexport/data/fdo50665.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo51916.rtf b/sw/qa/extras/rtfexport/data/fdo51916.rtf index b2359c3fbd8a..b2359c3fbd8a 100644 --- a/sw/qa/extras/rtfimport/data/fdo51916.rtf +++ b/sw/qa/extras/rtfexport/data/fdo51916.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo52389.rtf b/sw/qa/extras/rtfexport/data/fdo52389.rtf index 37fbb2a01064..37fbb2a01064 100644 --- a/sw/qa/extras/rtfimport/data/fdo52389.rtf +++ b/sw/qa/extras/rtfexport/data/fdo52389.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo52475.rtf b/sw/qa/extras/rtfexport/data/fdo52475.rtf index fe4a557d77ca..fe4a557d77ca 100644 --- a/sw/qa/extras/rtfimport/data/fdo52475.rtf +++ b/sw/qa/extras/rtfexport/data/fdo52475.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo52989.rtf b/sw/qa/extras/rtfexport/data/fdo52989.rtf index 513f868e0c5c..513f868e0c5c 100644 --- a/sw/qa/extras/rtfimport/data/fdo52989.rtf +++ b/sw/qa/extras/rtfexport/data/fdo52989.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo53594.rtf b/sw/qa/extras/rtfexport/data/fdo53594.rtf index 55468a63afda..55468a63afda 100644 --- a/sw/qa/extras/rtfimport/data/fdo53594.rtf +++ b/sw/qa/extras/rtfexport/data/fdo53594.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo54473.rtf b/sw/qa/extras/rtfexport/data/fdo54473.rtf index 7bb6208fe304..7bb6208fe304 100644 --- a/sw/qa/extras/rtfimport/data/fdo54473.rtf +++ b/sw/qa/extras/rtfexport/data/fdo54473.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo54612.rtf b/sw/qa/extras/rtfexport/data/fdo54612.rtf index 3867d0edfe5b..3867d0edfe5b 100644 --- a/sw/qa/extras/rtfimport/data/fdo54612.rtf +++ b/sw/qa/extras/rtfexport/data/fdo54612.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo54900.rtf b/sw/qa/extras/rtfexport/data/fdo54900.rtf index 0ebd9d1f85da..0ebd9d1f85da 100644 --- a/sw/qa/extras/rtfimport/data/fdo54900.rtf +++ b/sw/qa/extras/rtfexport/data/fdo54900.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo55493.rtf b/sw/qa/extras/rtfexport/data/fdo55493.rtf index 22d8ca916dd3..22d8ca916dd3 100644 --- a/sw/qa/extras/rtfimport/data/fdo55493.rtf +++ b/sw/qa/extras/rtfexport/data/fdo55493.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo56512.rtf b/sw/qa/extras/rtfexport/data/fdo56512.rtf index bc400cf0adfb..bc400cf0adfb 100644 --- a/sw/qa/extras/rtfimport/data/fdo56512.rtf +++ b/sw/qa/extras/rtfexport/data/fdo56512.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo57678.rtf b/sw/qa/extras/rtfexport/data/fdo57678.rtf index e0a26cdfab8e..e0a26cdfab8e 100644 --- a/sw/qa/extras/rtfimport/data/fdo57678.rtf +++ b/sw/qa/extras/rtfexport/data/fdo57678.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo57886.rtf b/sw/qa/extras/rtfexport/data/fdo57886.rtf index 04699e02940e..04699e02940e 100644 --- a/sw/qa/extras/rtfimport/data/fdo57886.rtf +++ b/sw/qa/extras/rtfexport/data/fdo57886.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo58076-2.rtf b/sw/qa/extras/rtfexport/data/fdo58076-2.rtf index c918953faab1..c918953faab1 100644 --- a/sw/qa/extras/rtfimport/data/fdo58076-2.rtf +++ b/sw/qa/extras/rtfexport/data/fdo58076-2.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo58076.rtf b/sw/qa/extras/rtfexport/data/fdo58076.rtf index 2acbfd8ec7d0..2acbfd8ec7d0 100644 --- a/sw/qa/extras/rtfimport/data/fdo58076.rtf +++ b/sw/qa/extras/rtfexport/data/fdo58076.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo58646.rtf b/sw/qa/extras/rtfexport/data/fdo58646.rtf index 4314272e54a9..4314272e54a9 100644 --- a/sw/qa/extras/rtfimport/data/fdo58646.rtf +++ b/sw/qa/extras/rtfexport/data/fdo58646.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo58646line.rtf b/sw/qa/extras/rtfexport/data/fdo58646line.rtf index 63cf71dc6399..63cf71dc6399 100644 --- a/sw/qa/extras/rtfimport/data/fdo58646line.rtf +++ b/sw/qa/extras/rtfexport/data/fdo58646line.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo58933.rtf b/sw/qa/extras/rtfexport/data/fdo58933.rtf index 7568e274f03d..7568e274f03d 100644 --- a/sw/qa/extras/rtfimport/data/fdo58933.rtf +++ b/sw/qa/extras/rtfexport/data/fdo58933.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo59419.rtf b/sw/qa/extras/rtfexport/data/fdo59419.rtf index ec52508b312d..ec52508b312d 100644 --- a/sw/qa/extras/rtfimport/data/fdo59419.rtf +++ b/sw/qa/extras/rtfexport/data/fdo59419.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo59638.rtf b/sw/qa/extras/rtfexport/data/fdo59638.rtf index e2572bf008e3..e2572bf008e3 100644 --- a/sw/qa/extras/rtfimport/data/fdo59638.rtf +++ b/sw/qa/extras/rtfexport/data/fdo59638.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo60722.rtf b/sw/qa/extras/rtfexport/data/fdo60722.rtf index 498df01fceb9..498df01fceb9 100644 --- a/sw/qa/extras/rtfimport/data/fdo60722.rtf +++ b/sw/qa/extras/rtfexport/data/fdo60722.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo61193.rtf b/sw/qa/extras/rtfexport/data/fdo61193.rtf index 6618bda8b4ac..6618bda8b4ac 100644 --- a/sw/qa/extras/rtfimport/data/fdo61193.rtf +++ b/sw/qa/extras/rtfexport/data/fdo61193.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo61909.rtf b/sw/qa/extras/rtfexport/data/fdo61909.rtf index e31414a9b655..e31414a9b655 100644 --- a/sw/qa/extras/rtfimport/data/fdo61909.rtf +++ b/sw/qa/extras/rtfexport/data/fdo61909.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo62044-paste.rtf b/sw/qa/extras/rtfexport/data/fdo62044-paste.rtf index cea4373f5ca8..cea4373f5ca8 100644 --- a/sw/qa/extras/rtfimport/data/fdo62044-paste.rtf +++ b/sw/qa/extras/rtfexport/data/fdo62044-paste.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo62044.rtf b/sw/qa/extras/rtfexport/data/fdo62044.rtf index 8ab293bbb7ac..8ab293bbb7ac 100644 --- a/sw/qa/extras/rtfimport/data/fdo62044.rtf +++ b/sw/qa/extras/rtfexport/data/fdo62044.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo62288.rtf b/sw/qa/extras/rtfexport/data/fdo62288.rtf index f5ec592fc1fc..f5ec592fc1fc 100644 --- a/sw/qa/extras/rtfimport/data/fdo62288.rtf +++ b/sw/qa/extras/rtfexport/data/fdo62288.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo62805.rtf b/sw/qa/extras/rtfexport/data/fdo62805.rtf index fee2b59fe668..fee2b59fe668 100644 --- a/sw/qa/extras/rtfimport/data/fdo62805.rtf +++ b/sw/qa/extras/rtfexport/data/fdo62805.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo62977.rtf b/sw/qa/extras/rtfexport/data/fdo62977.rtf index f16135d81a72..f16135d81a72 100644 --- a/sw/qa/extras/rtfimport/data/fdo62977.rtf +++ b/sw/qa/extras/rtfexport/data/fdo62977.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo63023.rtf b/sw/qa/extras/rtfexport/data/fdo63023.rtf index c246dc634b10..c246dc634b10 100644 --- a/sw/qa/extras/rtfimport/data/fdo63023.rtf +++ b/sw/qa/extras/rtfexport/data/fdo63023.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo63428.rtf b/sw/qa/extras/rtfexport/data/fdo63428.rtf index 826d4ca063e2..826d4ca063e2 100644 --- a/sw/qa/extras/rtfimport/data/fdo63428.rtf +++ b/sw/qa/extras/rtfexport/data/fdo63428.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo64637.rtf b/sw/qa/extras/rtfexport/data/fdo64637.rtf index 9bec690cde23..9bec690cde23 100644 --- a/sw/qa/extras/rtfimport/data/fdo64637.rtf +++ b/sw/qa/extras/rtfexport/data/fdo64637.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo64671.rtf b/sw/qa/extras/rtfexport/data/fdo64671.rtf index 385dca4294f1..385dca4294f1 100644 --- a/sw/qa/extras/rtfimport/data/fdo64671.rtf +++ b/sw/qa/extras/rtfexport/data/fdo64671.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo65090.rtf b/sw/qa/extras/rtfexport/data/fdo65090.rtf index 8a3eabd25723..8a3eabd25723 100644 --- a/sw/qa/extras/rtfimport/data/fdo65090.rtf +++ b/sw/qa/extras/rtfexport/data/fdo65090.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo66040.rtf b/sw/qa/extras/rtfexport/data/fdo66040.rtf index e067f2386ff6..e067f2386ff6 100644 --- a/sw/qa/extras/rtfimport/data/fdo66040.rtf +++ b/sw/qa/extras/rtfexport/data/fdo66040.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo67498.rtf b/sw/qa/extras/rtfexport/data/fdo67498.rtf index f1058c0ae9c2..f1058c0ae9c2 100644 --- a/sw/qa/extras/rtfimport/data/fdo67498.rtf +++ b/sw/qa/extras/rtfexport/data/fdo67498.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo68076.rtf b/sw/qa/extras/rtfexport/data/fdo68076.rtf index 84c605a2fda6..84c605a2fda6 100644 --- a/sw/qa/extras/rtfimport/data/fdo68076.rtf +++ b/sw/qa/extras/rtfexport/data/fdo68076.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo68779.rtf b/sw/qa/extras/rtfexport/data/fdo68779.rtf index 5dc7683fc858..5dc7683fc858 100644 --- a/sw/qa/extras/rtfimport/data/fdo68779.rtf +++ b/sw/qa/extras/rtfexport/data/fdo68779.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo69289.rtf b/sw/qa/extras/rtfexport/data/fdo69289.rtf index 96054a98dd29..96054a98dd29 100644 --- a/sw/qa/extras/rtfimport/data/fdo69289.rtf +++ b/sw/qa/extras/rtfexport/data/fdo69289.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo69384-paste.rtf b/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf index cbdca5be6e9c..cbdca5be6e9c 100644 --- a/sw/qa/extras/rtfimport/data/fdo69384-paste.rtf +++ b/sw/qa/extras/rtfexport/data/fdo69384-paste.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo70221.rtf b/sw/qa/extras/rtfexport/data/fdo70221.rtf Binary files differindex 1ca7939c64c1..1ca7939c64c1 100644 --- a/sw/qa/extras/rtfimport/data/fdo70221.rtf +++ b/sw/qa/extras/rtfexport/data/fdo70221.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo70578.rtf b/sw/qa/extras/rtfexport/data/fdo70578.rtf index b2a4ea826a7d..b2a4ea826a7d 100644 --- a/sw/qa/extras/rtfimport/data/fdo70578.rtf +++ b/sw/qa/extras/rtfexport/data/fdo70578.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo72031.rtf b/sw/qa/extras/rtfexport/data/fdo72031.rtf index ee589dab7d6b..ee589dab7d6b 100644 --- a/sw/qa/extras/rtfimport/data/fdo72031.rtf +++ b/sw/qa/extras/rtfexport/data/fdo72031.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo73241.rtf b/sw/qa/extras/rtfexport/data/fdo73241.rtf index b919e25b1da7..b919e25b1da7 100644 --- a/sw/qa/extras/rtfimport/data/fdo73241.rtf +++ b/sw/qa/extras/rtfexport/data/fdo73241.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo74229.rtf b/sw/qa/extras/rtfexport/data/fdo74229.rtf index f425f0847a1a..f425f0847a1a 100644 --- a/sw/qa/extras/rtfimport/data/fdo74229.rtf +++ b/sw/qa/extras/rtfexport/data/fdo74229.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo75735.rtf b/sw/qa/extras/rtfexport/data/fdo75735.rtf index 7d844bd485e9..7d844bd485e9 100644 --- a/sw/qa/extras/rtfimport/data/fdo75735.rtf +++ b/sw/qa/extras/rtfexport/data/fdo75735.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo76628.rtf b/sw/qa/extras/rtfexport/data/fdo76628.rtf index 9429fb88e938..9429fb88e938 100644 --- a/sw/qa/extras/rtfimport/data/fdo76628.rtf +++ b/sw/qa/extras/rtfexport/data/fdo76628.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo76633.rtf b/sw/qa/extras/rtfexport/data/fdo76633.rtf index d339b12e2917..d339b12e2917 100644 --- a/sw/qa/extras/rtfimport/data/fdo76633.rtf +++ b/sw/qa/extras/rtfexport/data/fdo76633.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo77267.rtf b/sw/qa/extras/rtfexport/data/fdo77267.rtf index f9b9060f6719..f9b9060f6719 100644 --- a/sw/qa/extras/rtfimport/data/fdo77267.rtf +++ b/sw/qa/extras/rtfexport/data/fdo77267.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo77996.rtf b/sw/qa/extras/rtfexport/data/fdo77996.rtf index 055d86008ebb..055d86008ebb 100644 --- a/sw/qa/extras/rtfimport/data/fdo77996.rtf +++ b/sw/qa/extras/rtfexport/data/fdo77996.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo78502.rtf b/sw/qa/extras/rtfexport/data/fdo78502.rtf index 2a1baf3e3550..2a1baf3e3550 100644 --- a/sw/qa/extras/rtfimport/data/fdo78502.rtf +++ b/sw/qa/extras/rtfexport/data/fdo78502.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo79384.rtf b/sw/qa/extras/rtfexport/data/fdo79384.rtf index 2a900852861d..2a900852861d 100644 --- a/sw/qa/extras/rtfimport/data/fdo79384.rtf +++ b/sw/qa/extras/rtfexport/data/fdo79384.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo79959.rtf b/sw/qa/extras/rtfexport/data/fdo79959.rtf index 231f39a4e123..231f39a4e123 100644 --- a/sw/qa/extras/rtfimport/data/fdo79959.rtf +++ b/sw/qa/extras/rtfexport/data/fdo79959.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo80905.rtf b/sw/qa/extras/rtfexport/data/fdo80905.rtf index c088fe0e727d..c088fe0e727d 100644 --- a/sw/qa/extras/rtfimport/data/fdo80905.rtf +++ b/sw/qa/extras/rtfexport/data/fdo80905.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo81892.rtf b/sw/qa/extras/rtfexport/data/fdo81892.rtf index 73cd53d50acc..73cd53d50acc 100644 --- a/sw/qa/extras/rtfimport/data/fdo81892.rtf +++ b/sw/qa/extras/rtfexport/data/fdo81892.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo82076.rtf b/sw/qa/extras/rtfexport/data/fdo82076.rtf index 20b33e9385af..20b33e9385af 100644 --- a/sw/qa/extras/rtfimport/data/fdo82076.rtf +++ b/sw/qa/extras/rtfexport/data/fdo82076.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo82078.rtf b/sw/qa/extras/rtfexport/data/fdo82078.rtf index 5899b7e1c0f6..5899b7e1c0f6 100644 --- a/sw/qa/extras/rtfimport/data/fdo82078.rtf +++ b/sw/qa/extras/rtfexport/data/fdo82078.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo82106.rtf b/sw/qa/extras/rtfexport/data/fdo82106.rtf index 391914a5f491..391914a5f491 100644 --- a/sw/qa/extras/rtfimport/data/fdo82106.rtf +++ b/sw/qa/extras/rtfexport/data/fdo82106.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo82859.rtf b/sw/qa/extras/rtfexport/data/fdo82859.rtf index eac5e6f3f972..eac5e6f3f972 100644 --- a/sw/qa/extras/rtfimport/data/fdo82859.rtf +++ b/sw/qa/extras/rtfexport/data/fdo82859.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo83204.rtf b/sw/qa/extras/rtfexport/data/fdo83204.rtf index 39d89b0303e2..39d89b0303e2 100644 --- a/sw/qa/extras/rtfimport/data/fdo83204.rtf +++ b/sw/qa/extras/rtfexport/data/fdo83204.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo83464.rtf b/sw/qa/extras/rtfexport/data/fdo83464.rtf index 28c9202c957e..28c9202c957e 100644 --- a/sw/qa/extras/rtfimport/data/fdo83464.rtf +++ b/sw/qa/extras/rtfexport/data/fdo83464.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo84679.rtf b/sw/qa/extras/rtfexport/data/fdo84679.rtf index 64611be9878f..64611be9878f 100644 --- a/sw/qa/extras/rtfimport/data/fdo84679.rtf +++ b/sw/qa/extras/rtfexport/data/fdo84679.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf b/sw/qa/extras/rtfexport/data/fdo85889-mac.rtf index 8056d47aacce..8056d47aacce 100644 --- a/sw/qa/extras/rtfimport/data/fdo85889-mac.rtf +++ b/sw/qa/extras/rtfexport/data/fdo85889-mac.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf b/sw/qa/extras/rtfexport/data/fdo85889-pc.rtf index a3b9d2745397..a3b9d2745397 100644 --- a/sw/qa/extras/rtfimport/data/fdo85889-pc.rtf +++ b/sw/qa/extras/rtfexport/data/fdo85889-pc.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf b/sw/qa/extras/rtfexport/data/fdo85889-pca.rtf index 34eeb18ef29d..34eeb18ef29d 100644 --- a/sw/qa/extras/rtfimport/data/fdo85889-pca.rtf +++ b/sw/qa/extras/rtfexport/data/fdo85889-pca.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo86750.rtf b/sw/qa/extras/rtfexport/data/fdo86750.rtf index 29f0b84ca995..29f0b84ca995 100644 --- a/sw/qa/extras/rtfimport/data/fdo86750.rtf +++ b/sw/qa/extras/rtfexport/data/fdo86750.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo86761.rtf b/sw/qa/extras/rtfexport/data/fdo86761.rtf index f22d8361bbcd..f22d8361bbcd 100644 --- a/sw/qa/extras/rtfimport/data/fdo86761.rtf +++ b/sw/qa/extras/rtfexport/data/fdo86761.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo89496.rtf b/sw/qa/extras/rtfexport/data/fdo89496.rtf index 761966d2c5de..761966d2c5de 100644 --- a/sw/qa/extras/rtfimport/data/fdo89496.rtf +++ b/sw/qa/extras/rtfexport/data/fdo89496.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo94835.rtf b/sw/qa/extras/rtfexport/data/fdo94835.rtf index 3eb0d0245ccf..3eb0d0245ccf 100755 --- a/sw/qa/extras/rtfimport/data/fdo94835.rtf +++ b/sw/qa/extras/rtfexport/data/fdo94835.rtf diff --git a/sw/qa/extras/rtfimport/data/font-override.rtf b/sw/qa/extras/rtfexport/data/font-override.rtf index a41d2ab90e28..a41d2ab90e28 100644 --- a/sw/qa/extras/rtfimport/data/font-override.rtf +++ b/sw/qa/extras/rtfexport/data/font-override.rtf diff --git a/sw/qa/extras/rtfimport/data/footer-para.rtf b/sw/qa/extras/rtfexport/data/footer-para.rtf index 28863b202f17..28863b202f17 100644 --- a/sw/qa/extras/rtfimport/data/footer-para.rtf +++ b/sw/qa/extras/rtfexport/data/footer-para.rtf diff --git a/sw/qa/extras/rtfexport/data/hello.rtf b/sw/qa/extras/rtfexport/data/hello.rtf new file mode 100644 index 000000000000..472817d311b9 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/hello.rtf @@ -0,0 +1 @@ +{\rtf1 Hello world!\par} diff --git a/sw/qa/extras/rtfimport/data/hexcrlf.rtf b/sw/qa/extras/rtfexport/data/hexcrlf.rtf index 1aaa0839c7eb..1aaa0839c7eb 100644 --- a/sw/qa/extras/rtfimport/data/hexcrlf.rtf +++ b/sw/qa/extras/rtfexport/data/hexcrlf.rtf diff --git a/sw/qa/extras/rtfimport/data/landscape.rtf b/sw/qa/extras/rtfexport/data/landscape.rtf index 9bbc3f711d4d..9bbc3f711d4d 100644 --- a/sw/qa/extras/rtfimport/data/landscape.rtf +++ b/sw/qa/extras/rtfexport/data/landscape.rtf diff --git a/sw/qa/extras/rtfimport/data/leftmargin-default.rtf b/sw/qa/extras/rtfexport/data/leftmargin-default.rtf index cf3ffd385c47..cf3ffd385c47 100644 --- a/sw/qa/extras/rtfimport/data/leftmargin-default.rtf +++ b/sw/qa/extras/rtfexport/data/leftmargin-default.rtf diff --git a/sw/qa/extras/rtfimport/data/levelfollow.rtf b/sw/qa/extras/rtfexport/data/levelfollow.rtf index b35027640805..b35027640805 100644 --- a/sw/qa/extras/rtfimport/data/levelfollow.rtf +++ b/sw/qa/extras/rtfexport/data/levelfollow.rtf diff --git a/sw/qa/extras/rtfimport/data/mathtype.rtf b/sw/qa/extras/rtfexport/data/mathtype.rtf index 411e8bd4d277..411e8bd4d277 100644 --- a/sw/qa/extras/rtfimport/data/mathtype.rtf +++ b/sw/qa/extras/rtfexport/data/mathtype.rtf diff --git a/sw/qa/extras/rtfimport/data/n192129.rtf b/sw/qa/extras/rtfexport/data/n192129.rtf index 1451b367823a..1451b367823a 100644 --- a/sw/qa/extras/rtfimport/data/n192129.rtf +++ b/sw/qa/extras/rtfexport/data/n192129.rtf diff --git a/sw/qa/extras/rtfimport/data/n750757.rtf b/sw/qa/extras/rtfexport/data/n750757.rtf index 04d78b615a62..04d78b615a62 100644 --- a/sw/qa/extras/rtfimport/data/n750757.rtf +++ b/sw/qa/extras/rtfexport/data/n750757.rtf diff --git a/sw/qa/extras/rtfimport/data/n751020.rtf b/sw/qa/extras/rtfexport/data/n751020.rtf index 66175cf8b901..66175cf8b901 100644 --- a/sw/qa/extras/rtfimport/data/n751020.rtf +++ b/sw/qa/extras/rtfexport/data/n751020.rtf diff --git a/sw/qa/extras/rtfimport/data/n757651.rtf b/sw/qa/extras/rtfexport/data/n757651.rtf index dfd49a8cda4b..dfd49a8cda4b 100644 --- a/sw/qa/extras/rtfimport/data/n757651.rtf +++ b/sw/qa/extras/rtfexport/data/n757651.rtf diff --git a/sw/qa/extras/rtfimport/data/n818997.rtf b/sw/qa/extras/rtfexport/data/n818997.rtf index 2ce44048626a..2ce44048626a 100644 --- a/sw/qa/extras/rtfimport/data/n818997.rtf +++ b/sw/qa/extras/rtfexport/data/n818997.rtf diff --git a/sw/qa/extras/rtfimport/data/n820504.rtf b/sw/qa/extras/rtfexport/data/n820504.rtf index 6d2d88e5e992..6d2d88e5e992 100644 --- a/sw/qa/extras/rtfimport/data/n820504.rtf +++ b/sw/qa/extras/rtfexport/data/n820504.rtf diff --git a/sw/qa/extras/rtfimport/data/n825305.rtf b/sw/qa/extras/rtfexport/data/n825305.rtf index 72a6b52a4016..72a6b52a4016 100644 --- a/sw/qa/extras/rtfimport/data/n825305.rtf +++ b/sw/qa/extras/rtfexport/data/n825305.rtf diff --git a/sw/qa/extras/rtfimport/data/para-bottom-margin.rtf b/sw/qa/extras/rtfexport/data/para-bottom-margin.rtf index 7bc505139514..7bc505139514 100644 --- a/sw/qa/extras/rtfimport/data/para-bottom-margin.rtf +++ b/sw/qa/extras/rtfexport/data/para-bottom-margin.rtf diff --git a/sw/qa/extras/rtfimport/data/rhbz1065629.rtf b/sw/qa/extras/rtfexport/data/rhbz1065629.rtf index 53955200fc77..53955200fc77 100644 --- a/sw/qa/extras/rtfimport/data/rhbz1065629.rtf +++ b/sw/qa/extras/rtfexport/data/rhbz1065629.rtf diff --git a/sw/qa/extras/rtfimport/data/shptxt-pard.rtf b/sw/qa/extras/rtfexport/data/shptxt-pard.rtf index 31c9df556bc6..31c9df556bc6 100644 --- a/sw/qa/extras/rtfimport/data/shptxt-pard.rtf +++ b/sw/qa/extras/rtfexport/data/shptxt-pard.rtf diff --git a/sw/qa/extras/rtfimport/data/shpz-dhgt.rtf b/sw/qa/extras/rtfexport/data/shpz-dhgt.rtf index 63df566bc9b2..63df566bc9b2 100644 --- a/sw/qa/extras/rtfimport/data/shpz-dhgt.rtf +++ b/sw/qa/extras/rtfexport/data/shpz-dhgt.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf100507.rtf b/sw/qa/extras/rtfexport/data/tdf100507.rtf index 1665c4e40dd5..1665c4e40dd5 100644 --- a/sw/qa/extras/rtfimport/data/tdf100507.rtf +++ b/sw/qa/extras/rtfexport/data/tdf100507.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf104287.rtf b/sw/qa/extras/rtfexport/data/tdf104287.rtf index 2ec87e60c0a4..2ec87e60c0a4 100644 --- a/sw/qa/extras/rtfimport/data/tdf104287.rtf +++ b/sw/qa/extras/rtfexport/data/tdf104287.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf104317.rtf b/sw/qa/extras/rtfexport/data/tdf104317.rtf index 3f80f3f0bd76..3f80f3f0bd76 100644 --- a/sw/qa/extras/rtfimport/data/tdf104317.rtf +++ b/sw/qa/extras/rtfexport/data/tdf104317.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf104744.rtf b/sw/qa/extras/rtfexport/data/tdf104744.rtf index ef329982bf3b..ef329982bf3b 100644 --- a/sw/qa/extras/rtfimport/data/tdf104744.rtf +++ b/sw/qa/extras/rtfexport/data/tdf104744.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf105729.rtf b/sw/qa/extras/rtfexport/data/tdf105729.rtf index 996dd37b0057..996dd37b0057 100644 --- a/sw/qa/extras/rtfimport/data/tdf105729.rtf +++ b/sw/qa/extras/rtfexport/data/tdf105729.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf105852.rtf b/sw/qa/extras/rtfexport/data/tdf105852.rtf index bf3e073a2c8d..bf3e073a2c8d 100644 --- a/sw/qa/extras/rtfimport/data/tdf105852.rtf +++ b/sw/qa/extras/rtfexport/data/tdf105852.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf106694.rtf b/sw/qa/extras/rtfexport/data/tdf106694.rtf index 9abcb205bbeb..9abcb205bbeb 100644 --- a/sw/qa/extras/rtfimport/data/tdf106694.rtf +++ b/sw/qa/extras/rtfexport/data/tdf106694.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf106950.rtf b/sw/qa/extras/rtfexport/data/tdf106950.rtf index 8ebaa3ce100f..8ebaa3ce100f 100644 --- a/sw/qa/extras/rtfimport/data/tdf106950.rtf +++ b/sw/qa/extras/rtfexport/data/tdf106950.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf106953.rtf b/sw/qa/extras/rtfexport/data/tdf106953.rtf index 398f9df78dcf..398f9df78dcf 100644 --- a/sw/qa/extras/rtfimport/data/tdf106953.rtf +++ b/sw/qa/extras/rtfexport/data/tdf106953.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf107116.rtf b/sw/qa/extras/rtfexport/data/tdf107116.rtf index 17c2f5b61a59..17c2f5b61a59 100644 --- a/sw/qa/extras/rtfimport/data/tdf107116.rtf +++ b/sw/qa/extras/rtfexport/data/tdf107116.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf108123.rtf b/sw/qa/extras/rtfexport/data/tdf108123.rtf index d4e51c347e84..d4e51c347e84 100644 --- a/sw/qa/extras/rtfimport/data/tdf108123.rtf +++ b/sw/qa/extras/rtfexport/data/tdf108123.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf108416.rtf b/sw/qa/extras/rtfexport/data/tdf108416.rtf index 5d38d0741068..5d38d0741068 100644 --- a/sw/qa/extras/rtfimport/data/tdf108416.rtf +++ b/sw/qa/extras/rtfexport/data/tdf108416.rtf diff --git a/sw/qa/extras/rtfexport/data/tdf108949_footnoteCharFormat.odt b/sw/qa/extras/rtfexport/data/tdf108949_footnoteCharFormat.odt Binary files differnew file mode 100644 index 000000000000..906effcc7536 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf108949_footnoteCharFormat.odt diff --git a/sw/qa/extras/rtfimport/data/tdf44986.rtf b/sw/qa/extras/rtfexport/data/tdf44986.rtf index d255e101a937..d255e101a937 100644 --- a/sw/qa/extras/rtfimport/data/tdf44986.rtf +++ b/sw/qa/extras/rtfexport/data/tdf44986.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf50821.rtf b/sw/qa/extras/rtfexport/data/tdf50821.rtf index 03f253dbe6a6..03f253dbe6a6 100644 --- a/sw/qa/extras/rtfimport/data/tdf50821.rtf +++ b/sw/qa/extras/rtfexport/data/tdf50821.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf54584.rtf b/sw/qa/extras/rtfexport/data/tdf54584.rtf index 2a497de63552..2a497de63552 100644 --- a/sw/qa/extras/rtfimport/data/tdf54584.rtf +++ b/sw/qa/extras/rtfexport/data/tdf54584.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf74795.rtf b/sw/qa/extras/rtfexport/data/tdf74795.rtf index 6db300890a7b..6db300890a7b 100644 --- a/sw/qa/extras/rtfimport/data/tdf74795.rtf +++ b/sw/qa/extras/rtfexport/data/tdf74795.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf75614.rtf b/sw/qa/extras/rtfexport/data/tdf75614.rtf index 123380190daf..123380190daf 100644 --- a/sw/qa/extras/rtfimport/data/tdf75614.rtf +++ b/sw/qa/extras/rtfexport/data/tdf75614.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf77349.rtf b/sw/qa/extras/rtfexport/data/tdf77349.rtf index 1451b367823a..1451b367823a 100644 --- a/sw/qa/extras/rtfimport/data/tdf77349.rtf +++ b/sw/qa/extras/rtfexport/data/tdf77349.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf82073.rtf b/sw/qa/extras/rtfexport/data/tdf82073.rtf index 79d9734de76c..79d9734de76c 100644 --- a/sw/qa/extras/rtfimport/data/tdf82073.rtf +++ b/sw/qa/extras/rtfexport/data/tdf82073.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf86182.rtf b/sw/qa/extras/rtfexport/data/tdf86182.rtf index d63c48934a97..d63c48934a97 100644 --- a/sw/qa/extras/rtfimport/data/tdf86182.rtf +++ b/sw/qa/extras/rtfexport/data/tdf86182.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf86814.rtf b/sw/qa/extras/rtfexport/data/tdf86814.rtf index 6fb394e1a153..6fb394e1a153 100644 --- a/sw/qa/extras/rtfimport/data/tdf86814.rtf +++ b/sw/qa/extras/rtfexport/data/tdf86814.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf87034.rtf b/sw/qa/extras/rtfexport/data/tdf87034.rtf index 16f322c6ff28..16f322c6ff28 100644 --- a/sw/qa/extras/rtfimport/data/tdf87034.rtf +++ b/sw/qa/extras/rtfexport/data/tdf87034.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf88811.rtf b/sw/qa/extras/rtfexport/data/tdf88811.rtf index a20835c4746c..a20835c4746c 100644 --- a/sw/qa/extras/rtfimport/data/tdf88811.rtf +++ b/sw/qa/extras/rtfexport/data/tdf88811.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf b/sw/qa/extras/rtfexport/data/tdf90260-nopar.rtf index c54eedd28878..c54eedd28878 100644 --- a/sw/qa/extras/rtfimport/data/tdf90260-nopar.rtf +++ b/sw/qa/extras/rtfexport/data/tdf90260-nopar.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf90697.rtf b/sw/qa/extras/rtfexport/data/tdf90697.rtf index 2e49379a17c7..2e49379a17c7 100644 --- a/sw/qa/extras/rtfimport/data/tdf90697.rtf +++ b/sw/qa/extras/rtfexport/data/tdf90697.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf91074.rtf b/sw/qa/extras/rtfexport/data/tdf91074.rtf index ff3fe9b4b420..ff3fe9b4b420 100644 --- a/sw/qa/extras/rtfimport/data/tdf91074.rtf +++ b/sw/qa/extras/rtfexport/data/tdf91074.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf92061.rtf b/sw/qa/extras/rtfexport/data/tdf92061.rtf index 03978b483673..03978b483673 100644 --- a/sw/qa/extras/rtfimport/data/tdf92061.rtf +++ b/sw/qa/extras/rtfexport/data/tdf92061.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf92481.rtf b/sw/qa/extras/rtfexport/data/tdf92481.rtf index 09a6c5e5934f..09a6c5e5934f 100644 --- a/sw/qa/extras/rtfimport/data/tdf92481.rtf +++ b/sw/qa/extras/rtfexport/data/tdf92481.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf94435.rtf b/sw/qa/extras/rtfexport/data/tdf94435.rtf index c1dbf0e3c08f..c1dbf0e3c08f 100644 --- a/sw/qa/extras/rtfimport/data/tdf94435.rtf +++ b/sw/qa/extras/rtfexport/data/tdf94435.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf94456.rtf b/sw/qa/extras/rtfexport/data/tdf94456.rtf index 075fb53e2715..075fb53e2715 100644 --- a/sw/qa/extras/rtfimport/data/tdf94456.rtf +++ b/sw/qa/extras/rtfexport/data/tdf94456.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf95707.rtf b/sw/qa/extras/rtfexport/data/tdf95707.rtf index d4f7678287d9..d4f7678287d9 100644 --- a/sw/qa/extras/rtfimport/data/tdf95707.rtf +++ b/sw/qa/extras/rtfexport/data/tdf95707.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf96275.rtf b/sw/qa/extras/rtfexport/data/tdf96275.rtf index aec13d195206..aec13d195206 100644 --- a/sw/qa/extras/rtfimport/data/tdf96275.rtf +++ b/sw/qa/extras/rtfexport/data/tdf96275.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf96308-deftab.rtf b/sw/qa/extras/rtfexport/data/tdf96308-deftab.rtf index 49ad344fcb0b..49ad344fcb0b 100644 --- a/sw/qa/extras/rtfimport/data/tdf96308-deftab.rtf +++ b/sw/qa/extras/rtfexport/data/tdf96308-deftab.rtf diff --git a/sw/qa/extras/rtfimport/data/tdf97035.rtf b/sw/qa/extras/rtfexport/data/tdf97035.rtf index a8f1d8a43e81..a8f1d8a43e81 100644 --- a/sw/qa/extras/rtfimport/data/tdf97035.rtf +++ b/sw/qa/extras/rtfexport/data/tdf97035.rtf diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx new file mode 100644 index 000000000000..034f32c2de26 --- /dev/null +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -0,0 +1,1844 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <memory> +#include <swmodeltestbase.hxx> + +#include <com/sun/star/awt/FontWeight.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/graphic/GraphicType.hpp> +#include <com/sun/star/lang/IndexOutOfBoundsException.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/style/ParagraphAdjust.hpp> +#include <com/sun/star/style/TabStop.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/TableColumnSeparator.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/XTextRangeCompare.hpp> +#include <com/sun/star/text/XTextTablesSupplier.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> + +#include <rtl/ustring.hxx> +#include <vcl/outdev.hxx> +#include <vcl/svapp.hxx> +#include <vcl/settings.hxx> +#include <unotools/ucbstreamhelper.hxx> +#include <unotools/streamwrap.hxx> +#include <comphelper/sequenceashashmap.hxx> +#include "comphelper/configuration.hxx" + +#include <bordertest.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/rtfexport/data/", "Rich Text Format") + { + } + + virtual std::unique_ptr<Resetter> preTest(const char* filename) override + { + m_aSavedSettings = Application::GetSettings(); + if (OString(filename) == "fdo48023.rtf" || OString(filename) == "fdo72031.rtf") + { + std::unique_ptr<Resetter> pResetter(new Resetter([this]() + { + Application::SetSettings(this->m_aSavedSettings); + })); + AllSettings aSettings(m_aSavedSettings); + aSettings.SetLanguageTag(LanguageTag("ru")); + Application::SetSettings(aSettings); + return pResetter; + } + else if (OString(filename) == "fdo44211.rtf") + { + std::unique_ptr<Resetter> pResetter(new Resetter([this]() + { + Application::SetSettings(this->m_aSavedSettings); + })); + AllSettings aSettings(m_aSavedSettings); + aSettings.SetLanguageTag(LanguageTag("lt")); + Application::SetSettings(aSettings); + return pResetter; + } + return nullptr; + } + +protected: + /// Copy&paste helper. + void paste(const OUString& aFilename, uno::Reference<text::XTextRange> const& xTextRange = uno::Reference<text::XTextRange>()) + { + uno::Reference<document::XFilter> xFilter(m_xSFactory->createInstance("com.sun.star.comp.Writer.RtfFilter"), uno::UNO_QUERY_THROW); + uno::Reference<document::XImporter> xImporter(xFilter, uno::UNO_QUERY_THROW); + xImporter->setTargetDocument(mxComponent); + uno::Sequence<beans::PropertyValue> aDescriptor(xTextRange.is() ? 3 : 2); + aDescriptor[0].Name = "InputStream"; + SvStream* pStream = utl::UcbStreamHelper::CreateStream(m_directories.getURLFromSrc("/sw/qa/extras/rtfexport/data/") + aFilename, StreamMode::WRITE); + uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); + aDescriptor[0].Value <<= xStream; + aDescriptor[1].Name = "InsertMode"; + aDescriptor[1].Value <<= true; + if (xTextRange.is()) + { + aDescriptor[2].Name = "TextInsertModeRange"; + aDescriptor[2].Value <<= xTextRange; + } + xFilter->filter(aDescriptor); + } + AllSettings m_aSavedSettings; +}; + +#if !defined(_WIN32) + +DECLARE_RTFEXPORT_TEST(testFdo45553, "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") + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(120)), getProperty<sal_Int32>(xRange, "ParaTopMargin")); + else if (aStr == "space-after") + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(240)), getProperty<sal_Int32>(xRange, "ParaBottomMargin")); + } + } +} + +DECLARE_RTFEXPORT_TEST(testN192129, "n192129.rtf") +{ + // We expect that the result will be 16x16px. + Size aExpectedSize(16, 16); + MapMode aMap(MapUnit::Map100thMM); + 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()); + if ((aExpectedSize.Width() - aActualSize.Width) / 2 != 0) + { + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width); + } + if ((aExpectedSize.Height() - aActualSize.Height) / 2 != 0) + { + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height); + } +} + +DECLARE_RTFEXPORT_TEST(testFdo45543, "fdo45543.rtf") +{ + CPPUNIT_ASSERT_EQUAL(5, getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFdo42465, "fdo42465.rtf") +{ + CPPUNIT_ASSERT_EQUAL(3, getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFdo45187, "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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xAnchor0 = uno::Reference<text::XTextContent>(xDraws->getByIndex(0), uno::UNO_QUERY)->getAnchor(); + uno::Reference<text::XTextRange> xAnchor1 = uno::Reference<text::XTextContent>(xDraws->getByIndex(1), uno::UNO_QUERY)->getAnchor(); + // Was 0 ("starts at the same position"), should be 1 ("starts before") + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xTextRangeCompare->compareRegionStarts(xAnchor0, xAnchor1)); +} + +DECLARE_RTFEXPORT_TEST(testN750757, "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(); + + CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin"))); + CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin"))); +} + +DECLARE_RTFEXPORT_TEST(testFdo45563, "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); +} + +DECLARE_RTFEXPORT_TEST(testFdo43965, "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); + CPPUNIT_ASSERT_EQUAL(sal_Int32(36), getProperty<sal_Int32>(xPropertySet, "CharEscapement")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(xPropertySet, "CharEscapementHeight")); + + // Second paragraph: Word vs Writer border default problem + CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), getProperty<table::BorderLine2>(xParaEnum->nextElement(), "TopBorder").LineWidth); + + // Finally, make sure that we have two pages + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testN751020, "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()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(200)), getProperty<sal_Int32>(xParaEnum->nextElement(), "ParaBottomMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo79384, "fdo79384.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + CPPUNIT_ASSERT_EQUAL(OUString("Маркеры спискамЫ", 31, RTL_TEXTENCODING_UTF8), xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo47326, "fdo47326.rtf") +{ + // This was 15 only, as \super buffered text, then the contents of it got lost. + CPPUNIT_ASSERT_EQUAL(19, getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFdo46955, "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()) + CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(xRangeEnum->nextElement(), "CharCaseMap")); + } +} + +DECLARE_RTFEXPORT_TEST(testFdo81892, "fdo81892.rtf") +{ + // table was not centered + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(xTable, "HoriOrient")); + + // fdo#81893: paragraph with \page was not centered + uno::Reference<text::XTextRange> xPara(getParagraph(2, "Performance")); + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); +} + +DECLARE_RTFEXPORT_TEST(testFdo45394, "fdo45394.rtf") +{ + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + OUString aActual = xHeaderText->getString(); + // Encoding in the header was wrong. + OUString aExpected("\xd0\x9f\xd0\x9a \xd0\xa0\xd0\x98\xd0\x9a", 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()); +} + +DECLARE_RTFEXPORT_TEST(testFdo48104, "fdo48104.rtf") +{ + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo47107, "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"); +} + +DECLARE_RTFEXPORT_TEST(testFdo44176, "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("Standard"), 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); +} + +DECLARE_RTFEXPORT_TEST(testFdo39053, "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) + if (getProperty<text::TextContentAnchorType>(xDraws->getByIndex(i), "AnchorType") == text::TextContentAnchorType_AS_CHARACTER) + nAsCharacter++; + // The image in binary format was ignored. + CPPUNIT_ASSERT_EQUAL(1, nAsCharacter); +} + +DECLARE_RTFEXPORT_TEST(testFdo48356, "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(); + int i = 0; + while (xParaEnum->hasMoreElements()) + { + xParaEnum->nextElement(); + i++; + } + // The document used to be imported as two paragraphs. + CPPUNIT_ASSERT_EQUAL(1, i); +} + +DECLARE_RTFEXPORT_TEST(testFdo48023, "fdo48023.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + // Implicit encoding detection based on locale was missing + OUString aExpected("\xd0\x9f\xd1\x80\xd0\xbe\xd0\xb3\xd1\x80\xd0\xb0\xd0\xbc\xd0\xbc\xd0\xb8\xd1\x81\xd1\x82", 22, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo48876, "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()); + CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, getProperty<style::LineSpacing>(xParaEnum->nextElement(), "ParaLineSpacing").Mode); +} + +DECLARE_RTFEXPORT_TEST(testFdo48193, "fdo48193.rtf") +{ + CPPUNIT_ASSERT_EQUAL(7, getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFdo44211, "fdo44211.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc4\x85\xc4\x8d\xc4\x99", 6, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo48037, "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); +} + +DECLARE_RTFEXPORT_TEST(testFdo47764, "fdo47764.rtf") +{ + // \cbpat with zero argument should mean the auto (-1) color, not a default color (black) + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getParagraph(1), "ParaBackColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo38786, "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(); +} + +DECLARE_RTFEXPORT_TEST(testN757651, "n757651.rtf") +{ + // The bug was that due to buggy layout the text expanded to two pages. + if (Application::GetDefaultDevice()->IsFontAvailable("Times New Roman")) + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo49501, "fdo49501.rtf") +{ + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle, "IsLandscape")); + sal_Int32 nExpected(convertTwipToMm100(567)); + CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "LeftMargin")); + CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "RightMargin")); + CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "TopMargin")); + CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "BottomMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo49271, "fdo49271.rtf") +{ + CPPUNIT_ASSERT_EQUAL(25.f, getProperty<float>(getParagraph(2), "CharHeight")); +} + +DECLARE_RTFEXPORT_TEST(testFdo50539, "fdo50539.rtf") +{ + // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black) + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharBackColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo50665, "fdo50665.rtf") +{ + // Access the second run, which is a textfield + uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); + // This used to be the default, as character properties were ignored. + CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), getProperty<OUString>(xRun, "CharFontName")); +} + +DECLARE_RTFEXPORT_TEST(testFdo49659, "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<beans::XPropertySet> xGraphic(getProperty< uno::Reference<beans::XPropertySet> >(getShape(1), "Graphic"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, getProperty<sal_Int8>(xGraphic, "GraphicType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo46966, "fdo46966.rtf") +{ + /* + * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch). + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin + */ + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(720)), getProperty<sal_Int32>(xPropertySet, "TopMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo76633, "fdo76633.rtf") +{ + // check that there is only a graphic object, not an additional rectangle + uno::Reference<lang::XServiceInfo> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape.is()); + CPPUNIT_ASSERT(xShape->supportsService("com.sun.star.text.TextGraphicObject")); + try + { + uno::Reference<drawing::XShape> xShape2(getShape(2), uno::UNO_QUERY); + CPPUNIT_FAIL("exception expected"); + } + catch (lang::IndexOutOfBoundsException const&) + { + /* expected */ + } +} + +DECLARE_RTFEXPORT_TEST(testFdo48033, "fdo48033.rtf") +{ + /* + * The problem was that the picture (48033) or OLE object (53594) was in the first cell, + * instead of the second one. + * + * oTable = ThisComponent.TextTables(0) + * oParas = oTable.getCellByName("B1").Text.createEnumeration + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * xray oRun.TextPortionType ' Frame, was Text + */ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xPara, 1), "TextPortionType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo53594, "fdo53594.rtf") +{ + /* + * The problem was that the picture (48033) or OLE object (53594) was in the first cell, + * instead of the second one. + * + * oTable = ThisComponent.TextTables(0) + * oParas = oTable.getCellByName("B1").Text.createEnumeration + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * xray oRun.TextPortionType ' Frame, was Text + */ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xPara, 1), "TextPortionType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo36089, "fdo36089.rtf") +{ + CPPUNIT_ASSERT_EQUAL(sal_Int16(-50), getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEscapement")); +} + +DECLARE_RTFEXPORT_TEST(testFdo48446, "fdo48446.rtf") +{ + OUString aExpected("\xd0\x98\xd0\xbc\xd1\x8f", 6, RTL_TEXTENCODING_UTF8); + getParagraph(1, aExpected); +} + +DECLARE_RTFEXPORT_TEST(testFdo47495, "fdo47495.rtf") +{ + // Used to have 4 paragraphs, as a result the original bugdoc had 2 pages instead of 1. + CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); +} + +DECLARE_RTFEXPORT_TEST(testAllGapsWord, "all_gaps_word.rtf") +{ + BorderTest borderTest; + BorderTest::testTheBorders(mxComponent, false); +} + +DECLARE_RTFEXPORT_TEST(testFdo52389, "fdo52389.rtf") +{ + // The last '!' character at the end of the document was lost + CPPUNIT_ASSERT_EQUAL(6, getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFdo49655, "fdo49655.rtf") +{ + /* + * 49655 : + * The problem was that the table was not imported due to the ' ' string in the middle of the table definition. + * + * xray ThisComponent.TextTables.Count 'was 0 + */ + 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()); +} + +DECLARE_RTFEXPORT_TEST(testFdo62805, "fdo62805.rtf") +{ + /* + * 62805 : + * The problem was that the table was not imported due to the absence of \pard after \row. + * The table was instead in a group (the '}' replace the \pard). + */ + 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()); +} + +DECLARE_RTFEXPORT_TEST(testFdo52475, "fdo52475.rtf") +{ + // The problem was that \chcbpat0 resulted in no color, instead of COL_AUTO. + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getRun(getParagraph(1), 3), "CharBackColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo55493, "fdo55493.rtf") +{ + // The problem was that the width of the PNG was detected as 15,24cm, instead of 3.97cm + uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3969), xShape->getSize().Width); +} + +DECLARE_RTFEXPORT_TEST(testCopyPastePageStyle, "copypaste-pagestyle.rtf") +{ + // The problem was that RTF import during copy&paste did not ignore page styles. + // Once we have more copy&paste tests, makes sense to refactor this to some helper method. + paste("copypaste-pagestyle-paste.rtf"); + + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590 +} + +DECLARE_RTFEXPORT_TEST(testCopyPasteFootnote, "copypaste-footnote.rtf") +{ + // The RTF import did not handle the case when the position wasn't the main document XText, but something different, e.g. a footnote. + 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); + paste("copypaste-footnote-paste.rtf", xTextRange); + + CPPUNIT_ASSERT_EQUAL(OUString("bbb"), xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo61193, "hello.rtf") +{ + // Pasting content that contained a footnote caused a crash. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("fdo61193.rtf", xEnd); +} + +DECLARE_RTFEXPORT_TEST(testTdf108123, "hello.rtf") +{ + // This crashed, the shape push/pop and table manager stack went out of + // sync -> we tried to de-reference an empty stack. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("tdf108123.rtf", xEnd); +} + +DECLARE_RTFEXPORT_TEST(testShptxtPard, "shptxt-pard.rtf") +{ + // The problem was that \pard inside \shptxt caused loss of shape text + uno::Reference<text::XText> xText(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("shape text"), xText->getString()); +} + +DECLARE_RTFEXPORT_TEST(testDoDhgt, "do-dhgt.rtf") +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + for (int i = 0; i < xDraws->getCount(); ++i) + { + sal_Int32 nFillColor = getProperty<sal_Int32>(xDraws->getByIndex(i), "FillColor"); + if (nFillColor == 0xc0504d) // red + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); + else if (nFillColor == 0x9bbb59) // green + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); + else if (nFillColor == 0x4f81bd) // blue + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); + } +} + +DECLARE_RTFEXPORT_TEST(testDplinehollow, "dplinehollow.rtf") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + table::BorderLine2 line(getProperty<table::BorderLine2>(xPropertySet, "TopBorder")); + CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, line.LineStyle); +} + +DECLARE_RTFEXPORT_TEST(testLeftmarginDefault, "leftmargin-default.rtf") +{ + // The default left/right margin was incorrect when the top margin was set to zero. + CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Standard"), "LeftMargin")); +} + +DECLARE_RTFEXPORT_TEST(testDppolyline, "dppolyline.rtf") +{ + // This was completely ignored, for now, just make sure we have all 4 lines. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xDraws->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testFdo56512, "fdo56512.rtf") +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + OUString aExpected("\xd7\xa2\xd7\x95\xd7\xa1\xd7\xa7 \xd7\x9e\xd7\x95\xd7\xa8\xd7\xa9\xd7\x94 ", 20, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo52989, "fdo52989.rtf") +{ + // Same as n#192129, but for JPEG files. + uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); + OString aMessage("xShape->getSize().Width() = "); + aMessage += OString::number(xShape->getSize().Width); + + // This was 2, should be 423 (or 369?). + CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), xShape->getSize().Width >= 273); +} + +DECLARE_RTFEXPORT_TEST(testFdo54473, "fdo54473.rtf") +{ + // The problem was that character styles were not imported due to a typo. + CPPUNIT_ASSERT_EQUAL(OUString("Anot"), getProperty<OUString>(getRun(getParagraph(1), 1, "Text "), "CharStyleName")); + CPPUNIT_ASSERT_EQUAL(OUString("ForeignTxt"), getProperty<OUString>(getRun(getParagraph(1), 3, "character "), "CharStyleName")); +} + +DECLARE_RTFEXPORT_TEST(testFdo49934, "fdo49934.rtf") +{ + // Column break without columns defined should be a page break, but it was just ignored. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo57886, "fdo57886.rtf") +{ + // Was 'int from <?> to <?> <?>'. + CPPUNIT_ASSERT_EQUAL(OUString("int from {firstlower} to {firstupper} {firstbody}"), getFormula(getRun(getParagraph(1), 1))); +} + +DECLARE_RTFEXPORT_TEST(testFdo58076, "fdo58076.rtf") +{ + // An additional section was created, so the default page style didn't have the custom margins. + uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2251), getProperty<sal_Int32>(xStyle, "LeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1752), getProperty<sal_Int32>(xStyle, "RightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(635), getProperty<sal_Int32>(xStyle, "TopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(635), getProperty<sal_Int32>(xStyle, "BottomMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo57678, "fdo57678.rtf") +{ + // Paragraphs of the two tables were not converted to tables. + 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()); +} + +DECLARE_RTFEXPORT_TEST(testFdo54612, "fdo54612.rtf") +{ + // \dpptx without a \dppolycount caused a crash. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), xDraws->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testFdo58933, "fdo58933.rtf") +{ + // The problem was that the table had an additional cell in its first line. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // This was 4. + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getCellNames().getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFdo44053, "fdo44053.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // The with of the table's A1 and A2 cell should equal. + CPPUNIT_ASSERT_EQUAL(getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position, + getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); +} + +DECLARE_RTFEXPORT_TEST(testFdo48440, "fdo48440.rtf") +{ + // Page break was ignored. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo58646line, "fdo58646line.rtf") +{ + // \line symbol was ignored + getParagraph(1, "foo\nbar"); +} + +DECLARE_RTFEXPORT_TEST(testFdo78502, "fdo78502.rtf") +{ + // ";" separators were inserted as text + getParagraph(1, "foo"); +} + +DECLARE_RTFEXPORT_TEST(testFdo58646, "fdo58646.rtf") +{ + // Page break was ignored inside a continuous section, on title page. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo59419, "fdo59419.rtf") +{ + // Junk to be ignored broke import of the table. + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testHexCRLF, "hexcrlf.rtf") +{ + // hex-escaped \r and \n should create a paragraph break + getParagraph(1, "foo"); + getParagraph(2, "bar"); + getParagraph(3, "baz"); + getParagraph(4, ""); + getParagraph(5, "quux"); +} + +DECLARE_RTFEXPORT_TEST(testFdo58076_2, "fdo58076-2.rtf") +{ + // Position of the picture wasn't correct. + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(8345)), getProperty<sal_Int32>(getShape(1), "HoriOrientPosition")); +} + +DECLARE_RTFEXPORT_TEST(testFdo59638, "fdo59638.rtf") +{ + // The problem was that w:lvlOverride inside w:num was ignores by dmapper. + + 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 == "BulletChar") + { + // Was '*', should be 'o'. + CPPUNIT_ASSERT_EQUAL(OUString("\xEF\x82\xB7", 3, RTL_TEXTENCODING_UTF8), rProp.Value.get<OUString>()); + return; + } + } + CPPUNIT_FAIL("no BulletChar property"); +} + +DECLARE_RTFEXPORT_TEST(testFdo60722, "fdo60722.rtf") +{ + // The problem was that the larger shape was over the smaller one, and not the other way around. + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(OUString("larger"), getProperty<OUString>(xShape, "Description")); + + xShape.set(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(OUString("smaller"), getProperty<OUString>(xShape, "Description")); + + // Color of the line was blue, and it had zero width. + xShape.set(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), getProperty<sal_uInt32>(xShape, "LineWidth")); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty<sal_uInt32>(xShape, "LineColor")); +} + +DECLARE_RTFEXPORT_TEST(testDoDhgtOld, "do-dhgt-old.rtf") +{ + // The file contains 3 shapes which have the same dhgt (z-order). + // Test that the order is 1) a 2) black rectangle 3) b, and not something else + uno::Reference<text::XText> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(OUString("a"), xShape->getString()); + + xShape.set(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<sal_uInt32>(xShape, "FillColor")); + + xShape.set(getShape(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(OUString("b"), xShape->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo61909, "fdo61909.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + // Was the Writer default font. + CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty<OUString>(xTextRange, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(xTextRange, "CharBackColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo62288, "fdo62288.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + // Margins were inherited from the previous cell, even there was a \pard there. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaLeftMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo37716, "fdo37716.rtf") +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFrames(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + // \nowrap got ignored, so Surround was text::WrapTextMode_PARALLEL + CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(xFrames->getByIndex(0), "Surround")); +} + +DECLARE_RTFEXPORT_TEST(testFdo51916, "fdo51916.rtf") +{ + // Complex nested table caused a crash. +} + +DECLARE_RTFEXPORT_TEST(testFdo63023, "fdo63023.rtf") +{ + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + // Back color was black (0) in the header, due to missing color table in the substream. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF99), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xHeaderText), 1), "CharBackColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo42109, "fdo42109.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + // Make sure the page number is imported as a field in the B1 cell. + CPPUNIT_ASSERT_EQUAL(OUString("TextField"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo62977, "fdo62977.rtf") +{ + // The middle character was imported as '?' instead of the proper unicode value. + getRun(getParagraph(1), 1, OUString("\xE5\xB9\xB4\xEF\xBC\x94\xE6\x9C\x88", 9, RTL_TEXTENCODING_UTF8)); +} + +DECLARE_RTFEXPORT_TEST(testN818997, "n818997.rtf") +{ + // \page was ignored between two \shp tokens. + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo64671, "fdo64671.rtf") +{ + // Additional '}' was inserted before the special character. + getRun(getParagraph(1), 1, OUString("\xC5\xBD", 2, RTL_TEXTENCODING_UTF8)); +} + +DECLARE_RTFEXPORT_TEST(testFdo62044, "fdo62044.rtf") +{ + // The problem was that RTF import during copy&paste did not ignore existing paragraph styles. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("fdo62044-paste.rtf", xEnd); + + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(xPropertySet, "CharHeight")); // Was 18, i.e. reset back to original value. +} + +DECLARE_RTFEXPORT_TEST(testFdo70578, "fdo70578.rtf") +{ + // Style without explicit \s0 was not imported as the default style + uno::Reference<beans::XPropertySet> xPropertySet( + getStyles("ParagraphStyles")->getByName("Subtitle"), uno::UNO_QUERY); + uno::Reference<style::XStyle> xStyle(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Standard"), xStyle->getParentStyle()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); +} + +DECLARE_RTFEXPORT_TEST(testN825305, "n825305.rtf") +{ + // The problem was that the textbox wasn't transparent, due to unimplemented fFilled == 0. + uno::Reference<beans::XPropertyState> xPropertyState(getShape(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getShape(2), "BackColorTransparency")); + beans::PropertyState ePropertyState = xPropertyState->getPropertyState("BackColorTransparency"); + // Was beans::PropertyState_DEFAULT_VALUE. + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState); +} + +DECLARE_RTFEXPORT_TEST(testTdf106953, "tdf106953.rtf") +{ + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + uno::Reference<beans::XPropertyState> xPropertyState(getParagraph(1), uno::UNO_QUERY); + beans::PropertyState ePropertyState = xPropertyState->getPropertyState("ParaLeftMargin"); + // Was beans::PropertyState_DEFAULT_VALUE. + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState); +} + +DECLARE_RTFEXPORT_TEST(testParaBottomMargin, "para-bottom-margin.rtf") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(353), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); + + // This was 353, i.e. bottom margin of the paragraph was 0.35cm instead of 0. + // The reason why this is 0 despite the default style containing \sa200 + // is that Word will actually interpret \sN (or \pard which apparently + // implies \s0) as "set style N and for every attribute of that style, + // set an attribute with default value on the paragraph" + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo66040, "fdo66040.rtf") +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + // This was 0 (no shapes were imported), we want two textframes. + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount()); + + // The second paragraph of the first shape should be actually a table, with "A" in its A1 cell. + uno::Reference<text::XTextRange> xTextRange(xDraws->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextRange->getText(); + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString()); + + // Make sure the second shape has the correct position and size. + uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14420), getProperty<sal_Int32>(xShape, "HoriOrientPosition")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1032), getProperty<sal_Int32>(xShape, "VertOrientPosition")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14000), xShape->getSize().Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), xShape->getSize().Height); +} + +DECLARE_RTFEXPORT_TEST(testFdo77996, "fdo77996.rtf") +{ + // all styles were imported as name "0" + uno::Reference<container::XNameAccess> xChars(getStyles("CharacterStyles")); + CPPUNIT_ASSERT(!xChars->hasByName("0")); + CPPUNIT_ASSERT(xChars->hasByName("strong")); + CPPUNIT_ASSERT(xChars->hasByName("author")); + uno::Reference<container::XNameAccess> xParas(getStyles("ParagraphStyles")); + CPPUNIT_ASSERT(!xParas->hasByName("0")); + CPPUNIT_ASSERT(xParas->hasByName("extract2")); + // some document properties were lost + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<document::XDocumentProperties> xProps(xDocumentPropertiesSupplier->getDocumentProperties()); + CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor()); + OUString aTitle("\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8", 30, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aTitle, xProps->getTitle()); + uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("jay"), getProperty<OUString>(xUDProps, "Operator")); + + // fdo#80486 also check that the ftnsep doesn't insert paragraph breaks + getParagraph(1, aTitle); +} + +DECLARE_RTFEXPORT_TEST(testFdo47802, "fdo47802.rtf") +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + // Shape inside table was ignored. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testFdo39001, "fdo39001.rtf") +{ + // Document was of 4 pages, \sect at the end of the doc wasn't ignored. + CPPUNIT_ASSERT_EQUAL(3, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo54900, "fdo54900.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // Paragraph was aligned to left, should be center. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraphOfText(1, xCell->getText()), "ParaAdjust"))); +} + +DECLARE_RTFEXPORT_TEST(testFdo64637, "fdo64637.rtf") +{ + // The problem was that the custom "Company" property was added twice, the second invocation resulted in an exception. + uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xDocumentPropertiesSupplier->getDocumentProperties()->getUserDefinedProperties(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("bbb"), getProperty<OUString>(xPropertySet, "Company")); +} + +DECLARE_RTFEXPORT_TEST(testN820504, "n820504.rtf") +{ + // The shape was anchored at-page instead of at-character (that's incorrect as Word only supports at-character and as-character). + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo67498, "fdo67498.rtf") +{ + // Left margin of the default page style wasn't set (was 2000). + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(5954)), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Standard"), "LeftMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo63428, "hello.rtf") +{ + // Pasting content that contained an annotation caused a crash. + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("fdo63428.rtf", xEnd); + + // Additionally, commented range was imported as a normal comment. + CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo44715, "fdo44715.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // Style information wasn't reset, which caused character height to be 16. + CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(getParagraphOfText(2, xCell->getText()), "CharHeight")); +} + +DECLARE_RTFEXPORT_TEST(testFdo68076, "fdo68076.rtf") +{ + // Encoding of the last char was wrong (more 'o' than 'y'). + OUString aExpected("\xD0\x9E\xD0\xB1\xD1\x8A\xD0\xB5\xD0\xBA\xD1\x82 \xE2\x80\x93 \xD1\x83", 19, RTL_TEXTENCODING_UTF8); + getParagraph(1, aExpected); +} + +DECLARE_RTFEXPORT_TEST(testFdo69384, "hello.rtf") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("fdo69384-paste.rtf", xEnd); + + // Import got interrupted in the middle of style sheet table import, + // resulting in missing styles and text. + getStyles("ParagraphStyles")->getByName("Text body justified"); +} + +DECLARE_RTFEXPORT_TEST(testFdo70221, "fdo70221.rtf") +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + // The picture was imported twice. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testCp1000018, "cp1000018.rtf") +{ + // The problem was that the empty paragraph at the end of the footnote got + // lost during import. + 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); + OUString const aExpected("Footnote first line.\n"); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} +#endif + +DECLARE_RTFEXPORT_TEST(testFdo94835, "fdo94835.rtf") +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + // The picture was imported twice. + CPPUNIT_ASSERT_EQUAL(sal_Int32(19), xDraws->getCount()); +} +DECLARE_RTFEXPORT_TEST(testNestedTable, "rhbz1065629.rtf") +{ + // nested table in second cell was missing + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Responsable Commercial:"), xPara->getString()); + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + xParaEnum = xParaEnumAccess->createEnumeration(); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Nom: John Doe"), xPara->getString()); + + // outer table: background color, borders for B1/B2 cell + xTable.set(xTables->getByIndex(2), uno::UNO_QUERY); + xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 fullPtSolid(1, 0, 35, 0, table::BorderLineStyle::SOLID, 35); + CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, + getProperty<table::BorderLine2>(xCell, "RightBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, + getProperty<table::BorderLine2>(xCell, "TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, + getProperty<table::BorderLine2>(xCell, "BottomBorder")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xCC0000), getProperty<sal_Int32>(xCell, "BackColor")); + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 halfPtSolid(/*0*/1, 0, 18, 0, table::BorderLineStyle::SOLID, 18); + CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff), + getProperty<sal_Int32>(xCell, "BackColor")); + xCell.set(xTable->getCellByName("B2"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, + getProperty<table::BorderLine2>(xCell, "RightBorder")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff), + getProperty<sal_Int32>(xCell, "BackColor")); + + // \sect at the end resulted in spurious page break + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFooterPara, "footer-para.rtf") +{ + // check that paragraph properties in footer are imported + uno::Reference<text::XText> xFooterText = + getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("First Page"), "FooterText"); + uno::Reference<text::XTextContent> xParagraph = + getParagraphOrTable(1, xFooterText); + CPPUNIT_ASSERT_EQUAL(OUString("All Rights Reserved."), + uno::Reference<text::XTextRange>(xParagraph, uno::UNO_QUERY)->getString()); + CPPUNIT_ASSERT_EQUAL((sal_Int16)style::ParagraphAdjust_CENTER, + getProperty</*style::ParagraphAdjust*/sal_Int16>(xParagraph, "ParaAdjust")); +} + +DECLARE_RTFEXPORT_TEST(testCp1000016, "hello.rtf") +{ + // The single-line document had a second fake empty para on Windows. + bool bFound = true; + try + { + getParagraph(2); + } + catch (const container::NoSuchElementException&) + { + bFound = false; + } + CPPUNIT_ASSERT_EQUAL(false, bFound); +} + +DECLARE_RTFEXPORT_TEST(testFdo65090, "fdo65090.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // The first row had 3 cells, instead of a horizontally merged one and a normal one (2 -> 1 separator). + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); +} + +DECLARE_RTFEXPORT_TEST(testTableBorderDefaults, "fdo68779.rtf") +{ + // table borders without \brdrw were not imported + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 solid(1, 0, 26, 0, table::BorderLineStyle::SOLID, 26); + CPPUNIT_ASSERT_BORDER_EQUAL(solid, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(solid, + getProperty<table::BorderLine2>(xCell, "RightBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(solid, + getProperty<table::BorderLine2>(xCell, "TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(solid, + getProperty<table::BorderLine2>(xCell, "BottomBorder")); + + xTable.set(xTables->getByIndex(1), uno::UNO_QUERY); + xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 dotted(1, 0, 26, 0, table::BorderLineStyle::DOTTED, 26); + CPPUNIT_ASSERT_BORDER_EQUAL(dotted, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(dotted, + getProperty<table::BorderLine2>(xCell, "RightBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(dotted, + getProperty<table::BorderLine2>(xCell, "TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(dotted, + getProperty<table::BorderLine2>(xCell, "BottomBorder")); + + xTable.set(xTables->getByIndex(2), uno::UNO_QUERY); + xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 doubled(1, 26, 26, 26, table::BorderLineStyle::DOUBLE, 79); + CPPUNIT_ASSERT_BORDER_EQUAL(doubled, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(doubled, + getProperty<table::BorderLine2>(xCell, "RightBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(doubled, + getProperty<table::BorderLine2>(xCell, "TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(doubled, + getProperty<table::BorderLine2>(xCell, "BottomBorder")); + + xTable.set(xTables->getByIndex(3), uno::UNO_QUERY); + xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 thinThickMG(1, 14, 26, 14, table::BorderLineStyle::THINTHICK_MEDIUMGAP, 53); + CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, + getProperty<table::BorderLine2>(xCell, "LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, + getProperty<table::BorderLine2>(xCell, "RightBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, + getProperty<table::BorderLine2>(xCell, "TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, + getProperty<table::BorderLine2>(xCell, "BottomBorder")); +} + +DECLARE_RTFEXPORT_TEST(testShpzDhgt, "shpz-dhgt.rtf") +{ + // Test that shpz has priority over dhgt and not the other way around. + // Drawpage is sorted by ZOrder, so first should be red (back). + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(getShape(1), "FillColor")); + // Second (front) should be green. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(2), "FillColor")); +} + +DECLARE_RTFEXPORT_TEST(testLevelfollow, "levelfollow.rtf") +{ + uno::Reference<container::XIndexAccess> xNum1Levels = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(SvxNumberFormat::LISTTAB), comphelper::SequenceAsHashMap(xNum1Levels->getByIndex(0))["LabelFollowedBy"].get<sal_Int16>()); // first level, tab + + uno::Reference<container::XIndexAccess> xNum2Levels = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum2"), "NumberingRules"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(SvxNumberFormat::SPACE), comphelper::SequenceAsHashMap(xNum2Levels->getByIndex(0))["LabelFollowedBy"].get<sal_Int16>()); // first level, space + + uno::Reference<container::XIndexAccess> xNum3Levels = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum3"), "NumberingRules"); + CPPUNIT_ASSERT_EQUAL(sal_Int16(SvxNumberFormat::NOTHING), comphelper::SequenceAsHashMap(xNum3Levels->getByIndex(0))["LabelFollowedBy"].get<sal_Int16>()); // first level, nothing +} + +DECLARE_RTFEXPORT_TEST(testCharColor, "char-color.rtf") +{ + // This was -1: character color wasn't set. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x365F91), getProperty<sal_Int32>(getParagraph(1), "CharColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo69289, "fdo69289.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); + // There were only 2 cells (1 separators) in the table, should be 3 (2 separators). + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); +} + +DECLARE_RTFEXPORT_TEST(testDptxbxRelation, "dptxbx-relation.rtf") +{ + // This was FRAME, not PAGE_FRAME, even if dobxpage is in the document. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(getShape(1), "HoriOrientRelation")); +} + +DECLARE_RTFEXPORT_TEST(testDprectAnchor, "dprect-anchor.rtf") +{ + // This was at-page, which is not something Word supports, so clearly an import error. + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo76628, "fdo76628.rtf") +{ + OUString aExpected("\xd0\x9e\xd0\x91\xd0\xa0\xd0\x90\xd0\x97\xd0\x95\xd0\xa6", 14, RTL_TEXTENCODING_UTF8); + // Should be 'SAMPLE' in Russian, was garbage. + getParagraph(1, aExpected); + + uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); + OUString aExpectedHeader("\xd0\x9f\xd0\xbe\xd0\xb4\xd0\xb3\xd0\xbe\xd1\x82\xd0\xbe\xd0\xb2\xd0\xbb\xd0\xb5\xd0\xbd\xd0\xbe", 24, RTL_TEXTENCODING_UTF8); + // Should be 'prepared' in Russian, was garbage. + getParagraphOfText(1, xHeaderText, aExpectedHeader); +} + +DECLARE_RTFEXPORT_TEST(testFdo77267, "fdo77267.rtf") +{ + // Paragraph was aligned to left, should be center. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); +} + +DECLARE_RTFEXPORT_TEST(testFdo75735, "fdo75735.rtf") +{ + // Number of tabstops in the second paragraph should be 3, was 6. + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<style::TabStop> >(getParagraph(2), "ParaTabStops").getLength()); +} + +DECLARE_RTFEXPORT_TEST(testFontOverride, "font-override.rtf") +{ + // This was "Times New Roman". + CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName")); +} + +DECLARE_RTFEXPORT_TEST(testFdo73241, "fdo73241.rtf") +{ + // This was 2, page break in table wasn't ignored. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testFdo80905, "fdo80905.rtf") +{ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + xFields->nextElement(); + // The problem was that there was only one field in the document, but there should be true. + CPPUNIT_ASSERT_EQUAL(true, static_cast<bool>(xFields->hasMoreElements())); +} + +DECLARE_RTFEXPORT_TEST(testFdo82106, "fdo82106.rtf") +{ + // Tab was missing after footnote not containing a tab. + getParagraph(2, "before\tafter"); +} + +DECLARE_RTFEXPORT_TEST(testFdo74229, "fdo74229.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 0, due to ignoring RTF_TRGAPH. + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(67)), getProperty<sal_Int32>(xCell, "RightBorderDistance")); +} + +DECLARE_RTFEXPORT_TEST(testFdo79959, "fdo79959.rtf") +{ + // This was false, as the style was imported as " Test", i.e. no whitespace stripping. + CPPUNIT_ASSERT_EQUAL(true, static_cast<bool>(getStyles("ParagraphStyles")->hasByName("Test"))); +} + +DECLARE_RTFEXPORT_TEST(testFdo82078, "fdo82078.rtf") +{ + // This was awt::FontWeight::BOLD, i.e. the second run was bold, when it should be normal. + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(getRun(getParagraph(1), 2), "CharWeight")); +} + +DECLARE_RTFEXPORT_TEST(testCsBold, "cs-bold.rtf") +{ + // This was awt::FontWeight::NORMAL, i.e. the first run was bold, when it should be bold (applied character style without direct formatting). + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight")); +} + +DECLARE_RTFEXPORT_TEST(testFdo84679, "fdo84679.rtf") +{ + // The problem was that the paragraph in A1 had some bottom margin, but it should not. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 282. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); +} + +DECLARE_RTFEXPORT_TEST(testFdo83464, "fdo83464.rtf") +{ + // Problem was that the text in the textframe had wrong font. + uno::Reference<text::XTextRange> xFrameText(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xFrameText->getString()); + // This was Times New Roman. + CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), getProperty<OUString>(getRun(getParagraphOfText(1, xFrameText->getText()), 1), "CharFontName")); +} + +DECLARE_RTFEXPORT_TEST(testFdo86761, "fdo86761.rtf") +{ + // This was 26, even if the picture should have no border, due to fLine=0. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineWidth); +} + +DECLARE_RTFEXPORT_TEST(testFdo82859, "fdo82859.rtf") +{ + // This was 0: "0xffffff" was converted to 0, i.e. the background was black instead of the default. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(getShape(1), "BackColor")); +} + +DECLARE_RTFEXPORT_TEST(testFdo82076, "fdo82076.rtf") +{ + // Footnote position was wrong: should be at the end of the B1 cell. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); + // This resulted in container::NoSuchElementException: the footnote was at the start of the A1 cell. + CPPUNIT_ASSERT_EQUAL(OUString("Footnote"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 2), "TextPortionType")); +} + +DECLARE_RTFEXPORT_TEST(testFdo83204, "fdo83204.rtf") +{ + // This was Standard, \sN was ignored after \bkmkstart and \pard. + CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty<OUString>(getParagraph(1), "ParaStyleName")); +} + +DECLARE_RTFEXPORT_TEST(testFdo85889pc, "fdo85889-pc.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc2\xb1\xe2\x89\xa5\xe2\x89\xa4", 8, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo85889pca, "fdo85889-pca.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc2\xb1\xe2\x80\x97\xc2\xbe", 7, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo85889mac, "fdo85889-mac.rtf") +{ + uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); + + OUString aExpected("\xc3\x92\xc3\x9a\xc3\x9b", 6, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo72031, "fdo72031.rtf") +{ + OUString aExpected("\xc3\x85", 2, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, getRun(getParagraph(1), 1)->getString()); +} + +DECLARE_RTFEXPORT_TEST(testFdo86750, "fdo86750.rtf") +{ + // This was 'HYPERLINK#anchor', the URL of the hyperlink had the field type as a prefix, leading to broken links. + CPPUNIT_ASSERT_EQUAL(OUString("#anchor"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + +DECLARE_RTFEXPORT_TEST(testTdf88811, "tdf88811.rtf") +{ + // The problem was that shapes anchored to the paragraph that is moved into a textframe were lost, so this was 2. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xDrawPage->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testFdo49893_2, "fdo49893-2.rtf") +{ + // Ensure that header text exists on each page (especially on second page) + CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[3]/header/txt/text()")); +} + +DECLARE_RTFEXPORT_TEST(testFdo89496, "fdo89496.rtf") +{ + // Just ensure that document is loaded and shape exists + uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape.is()); +} + +DECLARE_RTFEXPORT_TEST(testFdo75614, "tdf75614.rtf") +{ + // Text after the footnote was missing, so this resulted in a css::container::NoSuchElementException. + CPPUNIT_ASSERT_EQUAL(OUString("after."), getRun(getParagraph(1), 3)->getString()); +} + +DECLARE_RTFEXPORT_TEST(mathtype, "mathtype.rtf") +{ + OUString aFormula = getFormula(getRun(getParagraph(1), 1)); + CPPUNIT_ASSERT(!aFormula.isEmpty()); +} + +DECLARE_RTFEXPORT_TEST(testTdf86182, "tdf86182.rtf") +{ + // Writing mode was the default, i.e. text::WritingMode2::CONTEXT. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(getParagraph(1), "WritingMode")); +} + +DECLARE_RTFEXPORT_TEST(testTdf91074, "tdf91074.rtf") +{ + // The file failed to load, as the border color was imported using the LineColor UNO property. + uno::Reference<drawing::XShape> xShape = getShape(1); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_LIGHTRED), getProperty<table::BorderLine2>(xShape, "TopBorder").Color); +} + +DECLARE_RTFEXPORT_TEST(testTdf90260Nopar, "hello.rtf") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + paste("tdf90260-nopar.rtf", xEnd); + CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); +} + +DECLARE_RTFEXPORT_TEST(testTdf86814, "tdf86814.rtf") +{ + // This was awt::FontWeight::NORMAL, i.e. the first run wasn't bold, when it should be bold (applied paragraph style with direct formatting). + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight")); +} + +DECLARE_RTFEXPORT_TEST(testTdf108416, "tdf108416.rtf") +{ + uno::Reference<container::XNameAccess> xCharacterStyles(getStyles("CharacterStyles")); + uno::Reference<beans::XPropertySet> xListLabel(xCharacterStyles->getByName("ListLabel 1"), uno::UNO_QUERY); + // This was awt::FontWeight::BOLD, list numbering got an unexpected bold formatting. + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xListLabel, "CharWeight")); +} + +DECLARE_RTFEXPORT_TEST(testBinSkipping, "bin-skipping.rtf") +{ + // before, it was importing '/nMUST NOT IMPORT' + CPPUNIT_ASSERT_EQUAL(OUString("text"), getRun(getParagraph(1), 1)->getString()); +} + +DECLARE_RTFEXPORT_TEST(testTdf92061, "tdf92061.rtf") +{ + // This was "C", i.e. part of the footnote ended up in the body text. + CPPUNIT_ASSERT_EQUAL(OUString("body-after"), getRun(getParagraph(1), 3)->getString()); +} + +DECLARE_RTFEXPORT_TEST(testTdf92481, "tdf92481.rtf") +{ + // This was 0, RTF_WIDOWCTRL was not imported. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int8>(2), getProperty<sal_Int8>(getParagraph(1), "ParaWidows")); +} + +DECLARE_RTFEXPORT_TEST(testTdf94456, "tdf94456.rtf") +{ + // Paragraph left margin and first line indent wasn't imported correctly. + + // This was 1270. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(762), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + // This was -635. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-762), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); +} + +DECLARE_RTFEXPORT_TEST(testTdf94435, "tdf94435.rtf") +{ + // This was style::ParagraphAdjust_LEFT, \ltrpar undone the effect of \qc. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); +} + +DECLARE_RTFEXPORT_TEST(testTdf54584, "tdf54584.rtf") +{ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + // \PAGE was ignored, so no fields were in document -> exception was thrown + CPPUNIT_ASSERT_NO_THROW_MESSAGE("No fields in document found: field \"\\PAGE\" was not properly read", + xFields->nextElement()); +} + +DECLARE_RTFEXPORT_TEST(testTdf96308Deftab, "tdf96308-deftab.rtf") +{ + uno::Reference<lang::XMultiServiceFactory> xTextFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xDefaults(xTextFactory->createInstance("com.sun.star.text.Defaults"), uno::UNO_QUERY); + // This was 1270 as \deftab was ignored on import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(284)), getProperty<sal_Int32>(xDefaults, "TabStopDistance")); +} + +DECLARE_RTFEXPORT_TEST(testLandscape, "landscape.rtf") +{ + // Check landscape flag. + CPPUNIT_ASSERT_EQUAL(3, getPages()); + + // All pages should have flag orientiation + uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles"); + + // get a page cursor + 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); + + // check that the first page has landscape flag + xCursor->jumpToFirstPage(); + OUString pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + uno::Reference<style::XStyle> xStylePage(pageStyles->getByName(pageStyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, "IsLandscape")); + + // check that the second page has landscape flag + xCursor->jumpToPage(2); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, "IsLandscape")); + + // check that the last page has landscape flag + xCursor->jumpToLastPage(); + pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); + xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, "IsLandscape")); +} + +DECLARE_RTFEXPORT_TEST(testTdf97035, "tdf97035.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + // First cell width of the second row should be 2299 + uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2299), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); +} + +DECLARE_RTFEXPORT_TEST(testTdf87034, "tdf87034.rtf") +{ + // This was A1BC34D, i.e. the first "super" text portion was mis-imported, + // and was inserted instead right before the second "super" text portion. + CPPUNIT_ASSERT_EQUAL(OUString("A1B3C4D"), getParagraph(1)->getString()); +} + +DECLARE_RTFEXPORT_TEST(testClassificatonPasteLevels, "classification-confidential.rtf") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xEnd = xText->getEnd(); + + // Classified source and classified destination, but internal only has a + // higher level than confidential: nothing should happen. + OUString aOld = xText->getString(); + paste("classification-yes.rtf", xEnd); + CPPUNIT_ASSERT_EQUAL(aOld, xText->getString()); +} + +DECLARE_RTFEXPORT_TEST(testTdf95707, "tdf95707.rtf") +{ + // Graphic was replaced with a "Read-Error" placeholder. + CPPUNIT_ASSERT(getProperty<OUString>(getShape(1), "GraphicURL") != "vnd.sun.star.GraphicObject:0000000000000000000000000000000000000000"); +} + +DECLARE_RTFEXPORT_TEST(testTdf96275, "tdf96275.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(3, xCell->getText()); + // This was text: the shape's frame was part of the 1st paragraph instead of the 3rd one. + CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xParagraph, 1), "TextPortionType")); +} + +DECLARE_RTFEXPORT_TEST(testTdf82073, "tdf82073.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was -1: the background color was automatic, not black. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xCell, "BackColor")); +} + +DECLARE_RTFEXPORT_TEST(testTdf74795, "tdf74795.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 0, \trpaddl was ignored on import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(635), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); + + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + // Make sure that the scope of the default is only one row. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); +} + +DECLARE_RTFEXPORT_TEST(testTdf77349, "tdf77349.rtf") +{ + uno::Reference<container::XNamed> xImage(getShape(1), uno::UNO_QUERY); + // This was empty: imported image wasn't named automatically. + CPPUNIT_ASSERT_EQUAL(OUString("Image1"), xImage->getName()); +} + +DECLARE_RTFEXPORT_TEST(testTdf50821, "tdf50821.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 0, \trpaddfl was mishandled on import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(191), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); +} + +DECLARE_RTFEXPORT_TEST(testTdf100507, "tdf100507.rtf") +{ + // This was 0: left margin of the first paragraph was lost on import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6618), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); +} + +DECLARE_RTFEXPORT_TEST(testTdf44986, "tdf44986.rtf") +{ + // Check that the table at the second paragraph. + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); + // Check the first row of the table, it should have two cells (one separator). + // This was 0: the first row had no separators, so it had only one cell, which was too wide. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); +} + +DECLARE_RTFEXPORT_TEST(testTdf90697, "tdf90697.rtf") +{ + // We want section breaks to be seen as section breaks, not as page breaks, + // so this document should have only one page, not three. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +DECLARE_RTFEXPORT_TEST(testTdf104317, "tdf104317.rtf") +{ + // This failed to load, we tried to set CustomShapeGeometry on a line shape. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xDrawPage->getCount()); +} + +DECLARE_RTFEXPORT_TEST(testTdf104744, "tdf104744.rtf") +{ + // This was 0, as an unexpected "left margin is 0" token was created during + // import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); +} + +DECLARE_RTFEXPORT_TEST(testTdf105852, "tdf105852.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // All rows but last were merged -> there were only 2 rows + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xTableRows->getCount()); + // The first row must have 4 cells. + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); + // The third row must have 1 merged cell. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(2), "TableColumnSeparators").getLength()); +} + +DECLARE_RTFEXPORT_TEST(testTdf104287, "tdf104287.rtf") +{ + uno::Reference<text::XTextContent> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xShape.is()); + // This failed, the bitmap had no valid anchor. + CPPUNIT_ASSERT(xShape->getAnchor().is()); +} + +DECLARE_RTFEXPORT_TEST(testTdf105729, "tdf105729.rtf") +{ + // This was style::ParagraphAdjust_LEFT, \ltrpar undone the effect of \qc from style. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); +} + +DECLARE_RTFEXPORT_TEST(testTdf106694, "tdf106694.rtf") +{ + auto aTabs = getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aTabs.getLength()); + // This was 0, tab position was incorrect, looked like it was missing. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14605), aTabs[0].Position); +} + +DECLARE_RTFEXPORT_TEST(testTdf107116, "tdf107116.rtf") +{ + // This was 0, upper border around text (and its distance) was missing. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(120)), getProperty<sal_Int32>(getParagraph(2), "TopBorderDistance")); +} + +DECLARE_RTFEXPORT_TEST(testTdf106950, "tdf106950.rtf") +{ + uno::Reference<text::XTextRange> xPara(getParagraph(1)); + // This was ParagraphAdjust_LEFT, trying to set CharShadingValue on a + // paragraph style thrown an exception, and remaining properties were not + // set. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); +} + + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx new file mode 100644 index 000000000000..afba7d9fec87 --- /dev/null +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <swmodeltestbase.hxx> + +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/style/PageStyleLayout.hpp> +#include <com/sun/star/text/XFootnotesSupplier.hpp> +#include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/text/XTextColumns.hpp> + +class Test : public SwModelTestBase +{ +public: + Test() : SwModelTestBase("/sw/qa/extras/rtfexport/data/", "Rich Text Format") {} +}; + +DECLARE_RTFEXPORT_TEST(testTdf108949, "tdf108949_footnoteCharFormat.odt") +{ + //CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph Numbering style", OUString(), getProperty<OUString>(getParagraph(2), "NumberingStyleName")); + + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + + uno::Reference<text::XText> xFootnoteText; + xFootnotes->getByIndex(0) >>= xFootnoteText; + // This was green (0x00A800), the character property of the footnote character, not the footnote text + //CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xFootnoteText),1), "CharColor")); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 05df875832d5..dc1f5b07706b 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -12,21 +12,14 @@ #include <com/sun/star/awt/FontDescriptor.hpp> #include <com/sun/star/awt/FontUnderline.hpp> -#include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XImporter.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> #include <com/sun/star/drawing/FillStyle.hpp> -#include <com/sun/star/drawing/LineStyle.hpp> -#include <com/sun/star/drawing/PointSequenceSequence.hpp> -#include <com/sun/star/graphic/GraphicType.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/style/BreakType.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/style/ParagraphAdjust.hpp> #include <com/sun/star/style/TabStop.hpp> #include <com/sun/star/table/BorderLine2.hpp> @@ -38,18 +31,13 @@ #include <com/sun/star/text/XDocumentIndexMark.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/XTextRangeCompare.hpp> #include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> -#include <com/sun/star/text/WritingMode2.hpp> -#include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/text/XFormField.hpp> @@ -62,8 +50,6 @@ #include <comphelper/sequenceashashmap.hxx> #include "comphelper/configuration.hxx" -#include <bordertest.hxx> - class Test : public SwModelTestBase { public: @@ -71,34 +57,6 @@ public: { } - virtual std::unique_ptr<Resetter> preTest(const char* filename) override - { - m_aSavedSettings = Application::GetSettings(); - if (OString(filename) == "fdo48023.rtf" || OString(filename) == "fdo72031.rtf") - { - std::unique_ptr<Resetter> pResetter(new Resetter([this]() - { - Application::SetSettings(this->m_aSavedSettings); - })); - AllSettings aSettings(m_aSavedSettings); - aSettings.SetLanguageTag(LanguageTag("ru")); - Application::SetSettings(aSettings); - return pResetter; - } - else if (OString(filename) == "fdo44211.rtf") - { - std::unique_ptr<Resetter> pResetter(new Resetter([this]() - { - Application::SetSettings(this->m_aSavedSettings); - })); - AllSettings aSettings(m_aSavedSettings); - aSettings.SetLanguageTag(LanguageTag("lt")); - Application::SetSettings(aSettings); - return pResetter; - } - return nullptr; - } - protected: /// Copy&paste helper. void paste(const OUString& aFilename, uno::Reference<text::XTextRange> const& xTextRange = uno::Reference<text::XTextRange>()) @@ -125,53 +83,6 @@ protected: #if !defined(_WIN32) -DECLARE_RTFIMPORT_TEST(testFdo45553, "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") - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(120)), getProperty<sal_Int32>(xRange, "ParaTopMargin")); - else if (aStr == "space-after") - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(240)), getProperty<sal_Int32>(xRange, "ParaBottomMargin")); - } - } -} - -DECLARE_RTFIMPORT_TEST(testN192129, "n192129.rtf") -{ - // We expect that the result will be 16x16px. - Size aExpectedSize(16, 16); - MapMode aMap(MapUnit::Map100thMM); - 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()); - if ((aExpectedSize.Width() - aActualSize.Width) / 2 != 0) - { - CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width); - } - if ((aExpectedSize.Height() - aActualSize.Height) / 2 != 0) - { - CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height); - } -} - -DECLARE_RTFIMPORT_TEST(testFdo45543, "fdo45543.rtf") -{ - CPPUNIT_ASSERT_EQUAL(5, getLength()); -} - DECLARE_RTFIMPORT_TEST(testN695479, "n695479.rtf") { uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); @@ -214,27 +125,6 @@ DECLARE_RTFIMPORT_TEST(testN695479, "n695479.rtf") CPPUNIT_ASSERT(bDrawFound); } -DECLARE_RTFIMPORT_TEST(testFdo42465, "fdo42465.rtf") -{ - CPPUNIT_ASSERT_EQUAL(3, getLength()); -} - -DECLARE_RTFIMPORT_TEST(testFdo45187, "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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xAnchor0 = uno::Reference<text::XTextContent>(xDraws->getByIndex(0), uno::UNO_QUERY)->getAnchor(); - uno::Reference<text::XTextRange> xAnchor1 = uno::Reference<text::XTextContent>(xDraws->getByIndex(1), uno::UNO_QUERY)->getAnchor(); - // Was 0 ("starts at the same position"), should be 1 ("starts before") - CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xTextRangeCompare->compareRegionStarts(xAnchor0, xAnchor1)); -} - DECLARE_RTFIMPORT_TEST(testFdo46662, "fdo46662.rtf") { uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum3"), uno::UNO_QUERY); @@ -253,72 +143,6 @@ DECLARE_RTFIMPORT_TEST(testFdo46662, "fdo46662.rtf") } } -DECLARE_RTFIMPORT_TEST(testN750757, "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(); - - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin"))); - CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<bool>(xParaEnum->nextElement(), "ParaContextMargin"))); -} - -DECLARE_RTFIMPORT_TEST(testFdo45563, "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); -} - -DECLARE_RTFIMPORT_TEST(testFdo43965, "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); - CPPUNIT_ASSERT_EQUAL(sal_Int32(36), getProperty<sal_Int32>(xPropertySet, "CharEscapement")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(xPropertySet, "CharEscapementHeight")); - - // Second paragraph: Word vs Writer border default problem - CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), getProperty<table::BorderLine2>(xParaEnum->nextElement(), "TopBorder").LineWidth); - - // Finally, make sure that we have two pages - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testN751020, "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()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(200)), getProperty<sal_Int32>(xParaEnum->nextElement(), "ParaBottomMargin")); -} - -DECLARE_RTFIMPORT_TEST(testFdo79384, "fdo79384.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - - CPPUNIT_ASSERT_EQUAL(OUString("Маркеры спискамЫ", 31, RTL_TEXTENCODING_UTF8), xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo47326, "fdo47326.rtf") -{ - // This was 15 only, as \super buffered text, then the contents of it got lost. - CPPUNIT_ASSERT_EQUAL(19, getLength()); -} - DECLARE_RTFIMPORT_TEST(testFdo47036, "fdo47036.rtf") { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); @@ -338,59 +162,6 @@ DECLARE_RTFIMPORT_TEST(testFdo47036, "fdo47036.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); } -DECLARE_RTFIMPORT_TEST(testFdo46955, "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()) - CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(xRangeEnum->nextElement(), "CharCaseMap")); - } -} - -DECLARE_RTFIMPORT_TEST(testFdo81892, "fdo81892.rtf") -{ - // table was not centered - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(xTable, "HoriOrient")); - - // fdo#81893: paragraph with \page was not centered - uno::Reference<text::XTextRange> xPara(getParagraph(2, "Performance")); - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); -} - -DECLARE_RTFIMPORT_TEST(testFdo45394, "fdo45394.rtf") -{ - uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); - OUString aActual = xHeaderText->getString(); - // Encoding in the header was wrong. - OUString aExpected("\xd0\x9f\xd0\x9a \xd0\xa0\xd0\x98\xd0\x9a", 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()); -} - -DECLARE_RTFIMPORT_TEST(testFdo48104, "fdo48104.rtf") -{ - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo47107, "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"); -} - DECLARE_RTFIMPORT_TEST(testFdo45182, "fdo45182.rtf") { uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); @@ -401,94 +172,6 @@ DECLARE_RTFIMPORT_TEST(testFdo45182, "fdo45182.rtf") CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); } -DECLARE_RTFIMPORT_TEST(testFdo44176, "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("Standard"), 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); -} - -DECLARE_RTFIMPORT_TEST(testFdo39053, "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) - if (getProperty<text::TextContentAnchorType>(xDraws->getByIndex(i), "AnchorType") == text::TextContentAnchorType_AS_CHARACTER) - nAsCharacter++; - // The image in binary format was ignored. - CPPUNIT_ASSERT_EQUAL(1, nAsCharacter); -} - -DECLARE_RTFIMPORT_TEST(testFdo48356, "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(); - int i = 0; - while (xParaEnum->hasMoreElements()) - { - xParaEnum->nextElement(); - i++; - } - // The document used to be imported as two paragraphs. - CPPUNIT_ASSERT_EQUAL(1, i); -} - -DECLARE_RTFIMPORT_TEST(testFdo48023, "fdo48023.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - - // Implicit encoding detection based on locale was missing - OUString aExpected("\xd0\x9f\xd1\x80\xd0\xbe\xd0\xb3\xd1\x80\xd0\xb0\xd0\xbc\xd0\xbc\xd0\xb8\xd1\x81\xd1\x82", 22, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo48876, "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()); - CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, getProperty<style::LineSpacing>(xParaEnum->nextElement(), "ParaLineSpacing").Mode); -} - -DECLARE_RTFIMPORT_TEST(testFdo48193, "fdo48193.rtf") -{ - CPPUNIT_ASSERT_EQUAL(7, getLength()); -} - -DECLARE_RTFIMPORT_TEST(testFdo44211, "fdo44211.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - - OUString aExpected("\xc4\x85\xc4\x8d\xc4\x99", 6, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo48037, "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); -} - DECLARE_RTFIMPORT_TEST(testFdo85812, "fdo85812.rtf") { lang::Locale locale(getProperty<lang::Locale>(getRun(getParagraph(1), 1, "This "), "CharLocale")); @@ -545,45 +228,6 @@ DECLARE_RTFIMPORT_TEST(testFdo85812, "fdo85812.rtf") CPPUNIT_ASSERT_EQUAL(OUString("EG"), locale.Country); } -DECLARE_RTFIMPORT_TEST(testFdo47764, "fdo47764.rtf") -{ - // \cbpat with zero argument should mean the auto (-1) color, not a default color (black) - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getParagraph(1), "ParaBackColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo38786, "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(); -} - -DECLARE_RTFIMPORT_TEST(testN757651, "n757651.rtf") -{ - // The bug was that due to buggy layout the text expanded to two pages. - if (Application::GetDefaultDevice()->IsFontAvailable("Times New Roman")) - CPPUNIT_ASSERT_EQUAL(1, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo49501, "fdo49501.rtf") -{ - uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - - CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle, "IsLandscape")); - sal_Int32 nExpected(convertTwipToMm100(567)); - CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "LeftMargin")); - CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "RightMargin")); - CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "TopMargin")); - CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "BottomMargin")); -} - -DECLARE_RTFIMPORT_TEST(testFdo49271, "fdo49271.rtf") -{ - CPPUNIT_ASSERT_EQUAL(25.f, getProperty<float>(getParagraph(2), "CharHeight")); -} - DECLARE_RTFIMPORT_TEST(testFdo49692, "fdo49692.rtf") { uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); @@ -612,32 +256,6 @@ DECLARE_RTFIMPORT_TEST(testFdo45190, "fdo45190.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-100)), getProperty<sal_Int32>(getParagraph(2), "ParaFirstLineIndent")); } -DECLARE_RTFIMPORT_TEST(testFdo50539, "fdo50539.rtf") -{ - // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black) - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharBackColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo50665, "fdo50665.rtf") -{ - // Access the second run, which is a textfield - uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); - // This used to be the default, as character properties were ignored. - CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), getProperty<OUString>(xRun, "CharFontName")); -} - -DECLARE_RTFIMPORT_TEST(testFdo49659, "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<beans::XPropertySet> xGraphic(getProperty< uno::Reference<beans::XPropertySet> >(getShape(1), "Graphic"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, getProperty<sal_Int8>(xGraphic, "GraphicType")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf59699, "tdf59699.rtf") { // This resulted in a lang.IndexOutOfBoundsException: the referenced graphic data wasn't imported. @@ -646,17 +264,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf59699, "tdf59699.rtf") CPPUNIT_ASSERT(xGraphic.is()); } -DECLARE_RTFIMPORT_TEST(testFdo46966, "fdo46966.rtf") -{ - /* - * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch). - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin - */ - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(720)), getProperty<sal_Int32>(xPropertySet, "TopMargin")); -} - DECLARE_RTFIMPORT_TEST(testFdo52066, "fdo52066.rtf") { /* @@ -668,74 +275,6 @@ DECLARE_RTFIMPORT_TEST(testFdo52066, "fdo52066.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(19)), xShape->getSize().Height); } -DECLARE_RTFIMPORT_TEST(testFdo76633, "fdo76633.rtf") -{ - // check that there is only a graphic object, not an additional rectangle - uno::Reference<lang::XServiceInfo> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xShape.is()); - CPPUNIT_ASSERT(xShape->supportsService("com.sun.star.text.TextGraphicObject")); - try - { - uno::Reference<drawing::XShape> xShape2(getShape(2), uno::UNO_QUERY); - CPPUNIT_FAIL("exception expected"); - } - catch (lang::IndexOutOfBoundsException const&) - { - /* expected */ - } -} - -DECLARE_RTFIMPORT_TEST(testFdo48033, "fdo48033.rtf") -{ - /* - * The problem was that the picture (48033) or OLE object (53594) was in the first cell, - * instead of the second one. - * - * oTable = ThisComponent.TextTables(0) - * oParas = oTable.getCellByName("B1").Text.createEnumeration - * oPara = oParas.nextElement - * oRuns = oPara.createEnumeration - * oRun = oRuns.nextElement - * xray oRun.TextPortionType ' Frame, was Text - */ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); - uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); - uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xPara, 1), "TextPortionType")); -} - -DECLARE_RTFIMPORT_TEST(testFdo53594, "fdo53594.rtf") -{ - /* - * The problem was that the picture (48033) or OLE object (53594) was in the first cell, - * instead of the second one. - * - * oTable = ThisComponent.TextTables(0) - * oParas = oTable.getCellByName("B1").Text.createEnumeration - * oPara = oParas.nextElement - * oRuns = oPara.createEnumeration - * oRun = oRuns.nextElement - * xray oRun.TextPortionType ' Frame, was Text - */ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); - uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); - uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xPara, 1), "TextPortionType")); -} - -DECLARE_RTFIMPORT_TEST(testFdo36089, "fdo36089.rtf") -{ - CPPUNIT_ASSERT_EQUAL(sal_Int16(-50), getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEscapement")); -} - DECLARE_RTFIMPORT_TEST(testFdo49892, "fdo49892.rtf") { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); @@ -757,24 +296,6 @@ DECLARE_RTFIMPORT_TEST(testFdo49892, "fdo49892.rtf") } } -DECLARE_RTFIMPORT_TEST(testFdo48446, "fdo48446.rtf") -{ - OUString aExpected("\xd0\x98\xd0\xbc\xd1\x8f", 6, RTL_TEXTENCODING_UTF8); - getParagraph(1, aExpected); -} - -DECLARE_RTFIMPORT_TEST(testFdo47495, "fdo47495.rtf") -{ - // Used to have 4 paragraphs, as a result the original bugdoc had 2 pages instead of 1. - CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); -} - -DECLARE_RTFIMPORT_TEST(testAllGapsWord, "all_gaps_word.rtf") -{ - BorderTest borderTest; - BorderTest::testTheBorders(mxComponent, false); -} - DECLARE_RTFIMPORT_TEST(testFdo52052, "fdo52052.rtf") { // Make sure the textframe containing the text "third" appears on the 3rd page. @@ -811,134 +332,6 @@ DECLARE_RTFIMPORT_TEST(testInk, "ink.rtf") CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty<text::WrapTextMode>(getShape(1), "Surround")); } -DECLARE_RTFIMPORT_TEST(testFdo52389, "fdo52389.rtf") -{ - // The last '!' character at the end of the document was lost - CPPUNIT_ASSERT_EQUAL(6, getLength()); -} - -DECLARE_RTFIMPORT_TEST(testFdo49655, "fdo49655.rtf") -{ - /* - * 49655 : - * The problem was that the table was not imported due to the ' ' string in the middle of the table definition. - * - * xray ThisComponent.TextTables.Count 'was 0 - */ - 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()); -} - -DECLARE_RTFIMPORT_TEST(testFdo62805, "fdo62805.rtf") -{ - /* - * 62805 : - * The problem was that the table was not imported due to the absence of \pard after \row. - * The table was instead in a group (the '}' replace the \pard). - */ - 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()); -} - -DECLARE_RTFIMPORT_TEST(testFdo52475, "fdo52475.rtf") -{ - // The problem was that \chcbpat0 resulted in no color, instead of COL_AUTO. - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getRun(getParagraph(1), 3), "CharBackColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo55493, "fdo55493.rtf") -{ - // The problem was that the width of the PNG was detected as 15,24cm, instead of 3.97cm - uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3969), xShape->getSize().Width); -} - -DECLARE_RTFIMPORT_TEST(testCopyPastePageStyle, "copypaste-pagestyle.rtf") -{ - // The problem was that RTF import during copy&paste did not ignore page styles. - // Once we have more copy&paste tests, makes sense to refactor this to some helper method. - paste("copypaste-pagestyle-paste.rtf"); - - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590 -} - -DECLARE_RTFIMPORT_TEST(testCopyPasteFootnote, "copypaste-footnote.rtf") -{ - // The RTF import did not handle the case when the position wasn't the main document XText, but something different, e.g. a footnote. - 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); - paste("copypaste-footnote-paste.rtf", xTextRange); - - CPPUNIT_ASSERT_EQUAL(OUString("bbb"), xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo61193, "hello.rtf") -{ - // Pasting content that contained a footnote caused a crash. - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - paste("fdo61193.rtf", xEnd); -} - -DECLARE_RTFIMPORT_TEST(testTdf108123, "hello.rtf") -{ - // This crashed, the shape push/pop and table manager stack went out of - // sync -> we tried to de-reference an empty stack. - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - paste("tdf108123.rtf", xEnd); -} - -DECLARE_RTFIMPORT_TEST(testShptxtPard, "shptxt-pard.rtf") -{ - // The problem was that \pard inside \shptxt caused loss of shape text - uno::Reference<text::XText> xText(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("shape text"), xText->getString()); -} - -DECLARE_RTFIMPORT_TEST(testDoDhgt, "do-dhgt.rtf") -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - for (int i = 0; i < xDraws->getCount(); ++i) - { - sal_Int32 nFillColor = getProperty<sal_Int32>(xDraws->getByIndex(i), "FillColor"); - if (nFillColor == 0xc0504d) // red - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); - else if (nFillColor == 0x9bbb59) // green - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); - else if (nFillColor == 0x4f81bd) // blue - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); - } -} - -DECLARE_RTFIMPORT_TEST(testDplinehollow, "dplinehollow.rtf") -{ - uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); - table::BorderLine2 line(getProperty<table::BorderLine2>(xPropertySet, "TopBorder")); - CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, line.LineStyle); -} - -DECLARE_RTFIMPORT_TEST(testLeftmarginDefault, "leftmargin-default.rtf") -{ - // The default left/right margin was incorrect when the top margin was set to zero. - CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Standard"), "LeftMargin")); -} - -DECLARE_RTFIMPORT_TEST(testDppolyline, "dppolyline.rtf") -{ - // This was completely ignored, for now, just make sure we have all 4 lines. - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xDraws->getCount()); -} - DECLARE_RTFIMPORT_TEST(testFdo79319, "fdo79319.rtf") { // the thin horizontal rule was imported as a big fat rectangle @@ -954,26 +347,6 @@ DECLARE_RTFIMPORT_TEST(testFdo79319, "fdo79319.rtf") #endif } -DECLARE_RTFIMPORT_TEST(testFdo56512, "fdo56512.rtf") -{ - uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - OUString aExpected("\xd7\xa2\xd7\x95\xd7\xa1\xd7\xa7 \xd7\x9e\xd7\x95\xd7\xa8\xd7\xa9\xd7\x94 ", 20, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo52989, "fdo52989.rtf") -{ - // Same as n#192129, but for JPEG files. - uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); - OString aMessage("xShape->getSize().Width() = "); - aMessage += OString::number(xShape->getSize().Width); - - // This was 2, should be 423 (or 369?). - CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), xShape->getSize().Width >= 273); -} - DECLARE_RTFIMPORT_TEST(testFdo48442, "fdo48442.rtf") { // The problem was that \pvmrg is the default in RTF, but not in Writer. @@ -1003,43 +376,6 @@ DECLARE_RTFIMPORT_TEST(testFdo57708, "fdo57708.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount()); } -DECLARE_RTFIMPORT_TEST(testFdo54473, "fdo54473.rtf") -{ - // The problem was that character styles were not imported due to a typo. - CPPUNIT_ASSERT_EQUAL(OUString("Anot"), getProperty<OUString>(getRun(getParagraph(1), 1, "Text "), "CharStyleName")); - CPPUNIT_ASSERT_EQUAL(OUString("ForeignTxt"), getProperty<OUString>(getRun(getParagraph(1), 3, "character "), "CharStyleName")); -} - -DECLARE_RTFIMPORT_TEST(testFdo49934, "fdo49934.rtf") -{ - // Column break without columns defined should be a page break, but it was just ignored. - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo57886, "fdo57886.rtf") -{ - // Was 'int from <?> to <?> <?>'. - CPPUNIT_ASSERT_EQUAL(OUString("int from {firstlower} to {firstupper} {firstbody}"), getFormula(getRun(getParagraph(1), 1))); -} - -DECLARE_RTFIMPORT_TEST(testFdo58076, "fdo58076.rtf") -{ - // An additional section was created, so the default page style didn't have the custom margins. - uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2251), getProperty<sal_Int32>(xStyle, "LeftMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1752), getProperty<sal_Int32>(xStyle, "RightMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(635), getProperty<sal_Int32>(xStyle, "TopMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(635), getProperty<sal_Int32>(xStyle, "BottomMargin")); -} - -DECLARE_RTFIMPORT_TEST(testFdo57678, "fdo57678.rtf") -{ - // Paragraphs of the two tables were not converted to tables. - 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()); -} - DECLARE_RTFIMPORT_TEST(testFdo45183, "fdo45183.rtf") { // Was text::WrapTextMode_PARALLEL, i.e. shpfblwtxt didn't send the shape below text. @@ -1051,83 +387,6 @@ DECLARE_RTFIMPORT_TEST(testFdo45183, "fdo45183.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(16237), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); } -DECLARE_RTFIMPORT_TEST(testFdo54612, "fdo54612.rtf") -{ - // \dpptx without a \dppolycount caused a crash. - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(8), xDraws->getCount()); -} - -DECLARE_RTFIMPORT_TEST(testFdo58933, "fdo58933.rtf") -{ - // The problem was that the table had an additional cell in its first line. - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - // This was 4. - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getCellNames().getLength()); -} - -DECLARE_RTFIMPORT_TEST(testFdo44053, "fdo44053.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // The with of the table's A1 and A2 cell should equal. - CPPUNIT_ASSERT_EQUAL(getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position, - getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); -} - -DECLARE_RTFIMPORT_TEST(testFdo48440, "fdo48440.rtf") -{ - // Page break was ignored. - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo58646line, "fdo58646line.rtf") -{ - // \line symbol was ignored - getParagraph(1, "foo\nbar"); -} - -DECLARE_RTFIMPORT_TEST(testFdo78502, "fdo78502.rtf") -{ - // ";" separators were inserted as text - getParagraph(1, "foo"); -} - -DECLARE_RTFIMPORT_TEST(testFdo58646, "fdo58646.rtf") -{ - // Page break was ignored inside a continuous section, on title page. - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo59419, "fdo59419.rtf") -{ - // Junk to be ignored broke import of the table. - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); -} - -DECLARE_RTFIMPORT_TEST(testHexCRLF, "hexcrlf.rtf") -{ - // hex-escaped \r and \n should create a paragraph break - getParagraph(1, "foo"); - getParagraph(2, "bar"); - getParagraph(3, "baz"); - getParagraph(4, ""); - getParagraph(5, "quux"); -} - -DECLARE_RTFIMPORT_TEST(testFdo58076_2, "fdo58076-2.rtf") -{ - // Position of the picture wasn't correct. - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(8345)), getProperty<sal_Int32>(getShape(1), "HoriOrientPosition")); -} - DECLARE_RTFIMPORT_TEST(testFdo59953, "fdo59953.rtf") { uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1138,63 +397,6 @@ DECLARE_RTFIMPORT_TEST(testFdo59953, "fdo59953.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int16(7649), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position); } -DECLARE_RTFIMPORT_TEST(testFdo59638, "fdo59638.rtf") -{ - // The problem was that w:lvlOverride inside w:num was ignores by dmapper. - - 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 == "BulletChar") - { - // Was '*', should be 'o'. - CPPUNIT_ASSERT_EQUAL(OUString("\xEF\x82\xB7", 3, RTL_TEXTENCODING_UTF8), rProp.Value.get<OUString>()); - return; - } - } - CPPUNIT_FAIL("no BulletChar property"); -} - -DECLARE_RTFIMPORT_TEST(testFdo60722, "fdo60722.rtf") -{ - // The problem was that the larger shape was over the smaller one, and not the other way around. - uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(OUString("larger"), getProperty<OUString>(xShape, "Description")); - - xShape.set(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(OUString("smaller"), getProperty<OUString>(xShape, "Description")); - - // Color of the line was blue, and it had zero width. - xShape.set(getShape(3), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), getProperty<sal_uInt32>(xShape, "LineWidth")); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty<sal_uInt32>(xShape, "LineColor")); -} - -DECLARE_RTFIMPORT_TEST(testDoDhgtOld, "do-dhgt-old.rtf") -{ - // The file contains 3 shapes which have the same dhgt (z-order). - // Test that the order is 1) a 2) black rectangle 3) b, and not something else - uno::Reference<text::XText> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(OUString("a"), xShape->getString()); - - xShape.set(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<sal_uInt32>(xShape, "FillColor")); - - xShape.set(getShape(3), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(OUString("b"), xShape->getString()); -} - DECLARE_RTFIMPORT_TEST(testTdf84684, "tdf84684.rtf") { // The ZOrder of the two children of the group shape were swapped. @@ -1207,75 +409,6 @@ DECLARE_RTFIMPORT_TEST(testTdf84684, "tdf84684.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Pie 2"), xChild2->getName()); } -DECLARE_RTFIMPORT_TEST(testFdo61909, "fdo61909.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - // Was the Writer default font. - CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty<OUString>(xTextRange, "CharFontName")); - CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(xTextRange, "CharBackColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo62288, "fdo62288.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); - uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); - uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - // Margins were inherited from the previous cell, even there was a \pard there. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaLeftMargin")); -} - -DECLARE_RTFIMPORT_TEST(testFdo37716, "fdo37716.rtf") -{ - uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xFrames(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - // \nowrap got ignored, so Surround was text::WrapTextMode_PARALLEL - CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(xFrames->getByIndex(0), "Surround")); -} - -DECLARE_RTFIMPORT_TEST(testFdo51916, "fdo51916.rtf") -{ - // Complex nested table caused a crash. -} - -DECLARE_RTFIMPORT_TEST(testFdo63023, "fdo63023.rtf") -{ - uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); - // Back color was black (0) in the header, due to missing color table in the substream. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF99), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xHeaderText), 1), "CharBackColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo42109, "fdo42109.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); - // Make sure the page number is imported as a field in the B1 cell. - CPPUNIT_ASSERT_EQUAL(OUString("TextField"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType")); -} - -DECLARE_RTFIMPORT_TEST(testFdo62977, "fdo62977.rtf") -{ - // The middle character was imported as '?' instead of the proper unicode value. - getRun(getParagraph(1), 1, OUString("\xE5\xB9\xB4\xEF\xBC\x94\xE6\x9C\x88", 9, RTL_TEXTENCODING_UTF8)); -} - -DECLARE_RTFIMPORT_TEST(testN818997, "n818997.rtf") -{ - // \page was ignored between two \shp tokens. - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo64671, "fdo64671.rtf") -{ - // Additional '}' was inserted before the special character. - getRun(getParagraph(1), 1, OUString("\xC5\xBD", 2, RTL_TEXTENCODING_UTF8)); -} - DECLARE_RTFIMPORT_TEST(testFdo81944, "fdo81944.rtf") { // font properties in style were not imported @@ -1289,29 +422,6 @@ DECLARE_RTFIMPORT_TEST(testFdo81944, "fdo81944.rtf") CPPUNIT_ASSERT_EQUAL(11.0f, getProperty<float>(xStyle, "CharHeightComplex")); } -DECLARE_RTFIMPORT_TEST(testFdo62044, "fdo62044.rtf") -{ - // The problem was that RTF import during copy&paste did not ignore existing paragraph styles. - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - paste("fdo62044-paste.rtf", xEnd); - - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(xPropertySet, "CharHeight")); // Was 18, i.e. reset back to original value. -} - -DECLARE_RTFIMPORT_TEST(testFdo70578, "fdo70578.rtf") -{ - // Style without explicit \s0 was not imported as the default style - uno::Reference<beans::XPropertySet> xPropertySet( - getStyles("ParagraphStyles")->getByName("Subtitle"), uno::UNO_QUERY); - uno::Reference<style::XStyle> xStyle(xPropertySet, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Standard"), xStyle->getParentStyle()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaTopMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); -} - DECLARE_RTFIMPORT_TEST(testPoshPosv, "posh-posv.rtf") { CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(1), "HoriOrient")); @@ -1333,39 +443,6 @@ DECLARE_RTFIMPORT_TEST(testTdf96326, "tdf96326.rtf") CPPUNIT_ASSERT_EQUAL(true, xParameters->getByName("Checkbox_Checked").get<bool>()); } -DECLARE_RTFIMPORT_TEST(testN825305, "n825305.rtf") -{ - // The problem was that the textbox wasn't transparent, due to unimplemented fFilled == 0. - uno::Reference<beans::XPropertyState> xPropertyState(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getShape(2), "BackColorTransparency")); - beans::PropertyState ePropertyState = xPropertyState->getPropertyState("BackColorTransparency"); - // Was beans::PropertyState_DEFAULT_VALUE. - CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState); -} - -DECLARE_RTFIMPORT_TEST(testTdf106953, "tdf106953.rtf") -{ - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); - uno::Reference<beans::XPropertyState> xPropertyState(getParagraph(1), uno::UNO_QUERY); - beans::PropertyState ePropertyState = xPropertyState->getPropertyState("ParaLeftMargin"); - // Was beans::PropertyState_DEFAULT_VALUE. - CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState); -} - -DECLARE_RTFIMPORT_TEST(testParaBottomMargin, "para-bottom-margin.rtf") -{ - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(353), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin")); - - // This was 353, i.e. bottom margin of the paragraph was 0.35cm instead of 0. - // The reason why this is 0 despite the default style containing \sa200 - // is that Word will actually interpret \sN (or \pard which apparently - // implies \s0) as "set style N and for every attribute of that style, - // set an attribute with default value on the paragraph" - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin")); -} - DECLARE_RTFIMPORT_TEST(testN823655, "n823655.rtf") { uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(getShape(1), "CustomShapeGeometry"); @@ -1387,27 +464,6 @@ DECLARE_RTFIMPORT_TEST(testN823655, "n823655.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(286), aCoordinates[0].Second.Value.get<sal_Int32>()); } -DECLARE_RTFIMPORT_TEST(testFdo66040, "fdo66040.rtf") -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - // This was 0 (no shapes were imported), we want two textframes. - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount()); - - // The second paragraph of the first shape should be actually a table, with "A" in its A1 cell. - uno::Reference<text::XTextRange> xTextRange(xDraws->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XText> xText = xTextRange->getText(); - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString()); - - // Make sure the second shape has the correct position and size. - uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(14420), getProperty<sal_Int32>(xShape, "HoriOrientPosition")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1032), getProperty<sal_Int32>(xShape, "VertOrientPosition")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(14000), xShape->getSize().Width); - CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), xShape->getSize().Height); -} - DECLARE_RTFIMPORT_TEST(testN823675, "n823675.rtf") { uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); @@ -1427,43 +483,6 @@ DECLARE_RTFIMPORT_TEST(testN823675, "n823675.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Symbol"), aFont.Name); } -DECLARE_RTFIMPORT_TEST(testFdo77996, "fdo77996.rtf") -{ - // all styles were imported as name "0" - uno::Reference<container::XNameAccess> xChars(getStyles("CharacterStyles")); - CPPUNIT_ASSERT(!xChars->hasByName("0")); - CPPUNIT_ASSERT(xChars->hasByName("strong")); - CPPUNIT_ASSERT(xChars->hasByName("author")); - uno::Reference<container::XNameAccess> xParas(getStyles("ParagraphStyles")); - CPPUNIT_ASSERT(!xParas->hasByName("0")); - CPPUNIT_ASSERT(xParas->hasByName("extract2")); - // some document properties were lost - uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<document::XDocumentProperties> xProps(xDocumentPropertiesSupplier->getDocumentProperties()); - CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor()); - OUString aTitle("\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8", 30, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aTitle, xProps->getTitle()); - uno::Reference<beans::XPropertySet> xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("jay"), getProperty<OUString>(xUDProps, "Operator")); - - // fdo#80486 also check that the ftnsep doesn't insert paragraph breaks - getParagraph(1, aTitle); -} - -DECLARE_RTFIMPORT_TEST(testFdo47802, "fdo47802.rtf") -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - // Shape inside table was ignored. - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); -} - -DECLARE_RTFIMPORT_TEST(testFdo39001, "fdo39001.rtf") -{ - // Document was of 4 pages, \sect at the end of the doc wasn't ignored. - CPPUNIT_ASSERT_EQUAL(3, getPages()); -} - DECLARE_RTFIMPORT_TEST(testGroupshape, "groupshape.rtf") { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); @@ -1508,30 +527,6 @@ DECLARE_RTFIMPORT_TEST(testFdo66565, "fdo66565.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int16(304), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); } -DECLARE_RTFIMPORT_TEST(testFdo54900, "fdo54900.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // Paragraph was aligned to left, should be center. - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraphOfText(1, xCell->getText()), "ParaAdjust"))); -} - -DECLARE_RTFIMPORT_TEST(testFdo64637, "fdo64637.rtf") -{ - // The problem was that the custom "Company" property was added twice, the second invocation resulted in an exception. - uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<beans::XPropertySet> xPropertySet(xDocumentPropertiesSupplier->getDocumentProperties()->getUserDefinedProperties(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("bbb"), getProperty<OUString>(xPropertySet, "Company")); -} - -DECLARE_RTFIMPORT_TEST(testN820504, "n820504.rtf") -{ - // The shape was anchored at-page instead of at-character (that's incorrect as Word only supports at-character and as-character). - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); -} - DECLARE_RTFIMPORT_TEST(testFdo67365, "fdo67365.rtf") { uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1547,12 +542,6 @@ DECLARE_RTFIMPORT_TEST(testFdo67365, "fdo67365.rtf") CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_LEFT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraphOfText(1, xCell->getText()), "ParaAdjust"))); } -DECLARE_RTFIMPORT_TEST(testFdo67498, "fdo67498.rtf") -{ - // Left margin of the default page style wasn't set (was 2000). - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(5954)), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Standard"), "LeftMargin")); -} - DECLARE_RTFIMPORT_TEST(testFdo47440, "fdo47440.rtf") { // Vertical and horizontal orientation of the picture wasn't imported (was text::RelOrientation::FRAME). @@ -1571,40 +560,12 @@ DECLARE_RTFIMPORT_TEST(testFdo53556, "fdo53556.rtf") CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), xShapeDescriptor->getShapeType()); } -DECLARE_RTFIMPORT_TEST(testFdo63428, "hello.rtf") -{ - // Pasting content that contained an annotation caused a crash. - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - paste("fdo63428.rtf", xEnd); - - // Additionally, commented range was imported as a normal comment. - CPPUNIT_ASSERT_EQUAL(OUString("Annotation"), getProperty<OUString>(getRun(getParagraph(1), 2), "TextPortionType")); - CPPUNIT_ASSERT_EQUAL(OUString("AnnotationEnd"), getProperty<OUString>(getRun(getParagraph(1), 4), "TextPortionType")); -} - DECLARE_RTFIMPORT_TEST(testGroupshapeRotation, "groupshape-rotation.rtf") { // Rotation on groupshapes wasn't handled correctly, RotateAngle was 4500. CPPUNIT_ASSERT_EQUAL(sal_Int32(315 * 100), getProperty<sal_Int32>(getShape(1), "RotateAngle")); } -DECLARE_RTFIMPORT_TEST(testFdo44715, "fdo44715.rtf") -{ - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // Style information wasn't reset, which caused character height to be 16. - CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(getParagraphOfText(2, xCell->getText()), "CharHeight")); -} - -DECLARE_RTFIMPORT_TEST(testFdo68076, "fdo68076.rtf") -{ - // Encoding of the last char was wrong (more 'o' than 'y'). - OUString aExpected("\xD0\x9E\xD0\xB1\xD1\x8A\xD0\xB5\xD0\xBA\xD1\x82 \xE2\x80\x93 \xD1\x83", 19, RTL_TEXTENCODING_UTF8); - getParagraph(1, aExpected); -} - DECLARE_RTFIMPORT_TEST(testFdo68291, "fdo68291.odt") { uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); @@ -1616,37 +577,6 @@ DECLARE_RTFIMPORT_TEST(testFdo68291, "fdo68291.odt") CPPUNIT_ASSERT_EQUAL(uno::Any(), uno::Reference<beans::XPropertySet>(getParagraph(1), uno::UNO_QUERY)->getPropertyValue("PageDescName")); } -DECLARE_RTFIMPORT_TEST(testFdo69384, "hello.rtf") -{ - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - paste("fdo69384-paste.rtf", xEnd); - - // Import got interrupted in the middle of style sheet table import, - // resulting in missing styles and text. - getStyles("ParagraphStyles")->getByName("Text body justified"); -} - -DECLARE_RTFIMPORT_TEST(testFdo70221, "fdo70221.rtf") -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - // The picture was imported twice. - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); -} - -DECLARE_RTFIMPORT_TEST(testCp1000018, "cp1000018.rtf") -{ - // The problem was that the empty paragraph at the end of the footnote got - // lost during import. - 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); - OUString const aExpected("Footnote first line.\n"); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - class testTdf105511 : public Test { protected: @@ -1683,65 +613,6 @@ public: CPPUNIT_TEST_SUITE_REGISTRATION(testTdf105511); #endif -DECLARE_RTFIMPORT_TEST(testFdo94835, "fdo94835.rtf") -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - // The picture was imported twice. - CPPUNIT_ASSERT_EQUAL(sal_Int32(19), xDraws->getCount()); -} -DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf") -{ - // nested table in second cell was missing - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(1), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); - uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Responsable Commercial:"), xPara->getString()); - xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); - xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); - xParaEnum = xParaEnumAccess->createEnumeration(); - xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); - xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Nom: John Doe"), xPara->getString()); - - // outer table: background color, borders for B1/B2 cell - xTable.set(xTables->getByIndex(2), uno::UNO_QUERY); - xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - table::BorderLine2 fullPtSolid(1, 0, 35, 0, table::BorderLineStyle::SOLID, 35); - CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, - getProperty<table::BorderLine2>(xCell, "RightBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, - getProperty<table::BorderLine2>(xCell, "TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, - getProperty<table::BorderLine2>(xCell, "BottomBorder")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xCC0000), getProperty<sal_Int32>(xCell, "BackColor")); - xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - table::BorderLine2 halfPtSolid(/*0*/1, 0, 18, 0, table::BorderLineStyle::SOLID, 18); - CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff), - getProperty<sal_Int32>(xCell, "BackColor")); - xCell.set(xTable->getCellByName("B2"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, - getProperty<table::BorderLine2>(xCell, "RightBorder")); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff), - getProperty<sal_Int32>(xCell, "BackColor")); - - // \sect at the end resulted in spurious page break - CPPUNIT_ASSERT_EQUAL(1, getPages()); -} - DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf") { uno::Reference<text::XTextRange> xParaSecond = getParagraph(2); @@ -1766,111 +637,6 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf") CPPUNIT_ASSERT_EQUAL(2, getPages()); } -DECLARE_RTFIMPORT_TEST(testFooterPara, "footer-para.rtf") -{ - // check that paragraph properties in footer are imported - uno::Reference<text::XText> xFooterText = - getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("First Page"), "FooterText"); - uno::Reference<text::XTextContent> xParagraph = - getParagraphOrTable(1, xFooterText); - CPPUNIT_ASSERT_EQUAL(OUString("All Rights Reserved."), - uno::Reference<text::XTextRange>(xParagraph, uno::UNO_QUERY)->getString()); - CPPUNIT_ASSERT_EQUAL((sal_Int16)style::ParagraphAdjust_CENTER, - getProperty</*style::ParagraphAdjust*/sal_Int16>(xParagraph, "ParaAdjust")); -} - -DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf") -{ - // The single-line document had a second fake empty para on Windows. - bool bFound = true; - try - { - getParagraph(2); - } - catch (const container::NoSuchElementException&) - { - bFound = false; - } - CPPUNIT_ASSERT_EQUAL(false, bFound); -} - -DECLARE_RTFIMPORT_TEST(testFdo65090, "fdo65090.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // The first row had 3 cells, instead of a horizontally merged one and a normal one (2 -> 1 separator). - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); -} - -DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf") -{ - // table borders without \brdrw were not imported - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - table::BorderLine2 solid(1, 0, 26, 0, table::BorderLineStyle::SOLID, 26); - CPPUNIT_ASSERT_BORDER_EQUAL(solid, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(solid, - getProperty<table::BorderLine2>(xCell, "RightBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(solid, - getProperty<table::BorderLine2>(xCell, "TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(solid, - getProperty<table::BorderLine2>(xCell, "BottomBorder")); - - xTable.set(xTables->getByIndex(1), uno::UNO_QUERY); - xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - table::BorderLine2 dotted(1, 0, 26, 0, table::BorderLineStyle::DOTTED, 26); - CPPUNIT_ASSERT_BORDER_EQUAL(dotted, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(dotted, - getProperty<table::BorderLine2>(xCell, "RightBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(dotted, - getProperty<table::BorderLine2>(xCell, "TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(dotted, - getProperty<table::BorderLine2>(xCell, "BottomBorder")); - - xTable.set(xTables->getByIndex(2), uno::UNO_QUERY); - xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - table::BorderLine2 doubled(1, 26, 26, 26, table::BorderLineStyle::DOUBLE, 79); - CPPUNIT_ASSERT_BORDER_EQUAL(doubled, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(doubled, - getProperty<table::BorderLine2>(xCell, "RightBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(doubled, - getProperty<table::BorderLine2>(xCell, "TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(doubled, - getProperty<table::BorderLine2>(xCell, "BottomBorder")); - - xTable.set(xTables->getByIndex(3), uno::UNO_QUERY); - xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xCell.is()); - table::BorderLine2 thinThickMG(1, 14, 26, 14, table::BorderLineStyle::THINTHICK_MEDIUMGAP, 53); - CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, - getProperty<table::BorderLine2>(xCell, "LeftBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, - getProperty<table::BorderLine2>(xCell, "RightBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, - getProperty<table::BorderLine2>(xCell, "TopBorder")); - CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, - getProperty<table::BorderLine2>(xCell, "BottomBorder")); -} - -DECLARE_RTFIMPORT_TEST(testShpzDhgt, "shpz-dhgt.rtf") -{ - // Test that shpz has priority over dhgt and not the other way around. - // Drawpage is sorted by ZOrder, so first should be red (back). - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(getShape(1), "FillColor")); - // Second (front) should be green. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(2), "FillColor")); -} - DECLARE_RTFIMPORT_TEST(testBackground, "background.rtf") { // The first shape wasn't in the foreground. @@ -1878,58 +644,6 @@ DECLARE_RTFIMPORT_TEST(testBackground, "background.rtf") CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<bool>(getShape(2), "Opaque"))); } -DECLARE_RTFIMPORT_TEST(testLevelfollow, "levelfollow.rtf") -{ - uno::Reference<container::XIndexAccess> xNum1Levels = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(SvxNumberFormat::LISTTAB), comphelper::SequenceAsHashMap(xNum1Levels->getByIndex(0))["LabelFollowedBy"].get<sal_Int16>()); // first level, tab - - uno::Reference<container::XIndexAccess> xNum2Levels = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum2"), "NumberingRules"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(SvxNumberFormat::SPACE), comphelper::SequenceAsHashMap(xNum2Levels->getByIndex(0))["LabelFollowedBy"].get<sal_Int16>()); // first level, space - - uno::Reference<container::XIndexAccess> xNum3Levels = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum3"), "NumberingRules"); - CPPUNIT_ASSERT_EQUAL(sal_Int16(SvxNumberFormat::NOTHING), comphelper::SequenceAsHashMap(xNum3Levels->getByIndex(0))["LabelFollowedBy"].get<sal_Int16>()); // first level, nothing -} - -DECLARE_RTFIMPORT_TEST(testCharColor, "char-color.rtf") -{ - // This was -1: character color wasn't set. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x365F91), getProperty<sal_Int32>(getParagraph(1), "CharColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo69289, "fdo69289.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); - // There were only 2 cells (1 separators) in the table, should be 3 (2 separators). - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); -} - -DECLARE_RTFIMPORT_TEST(testDptxbxRelation, "dptxbx-relation.rtf") -{ - // This was FRAME, not PAGE_FRAME, even if dobxpage is in the document. - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(getShape(1), "HoriOrientRelation")); -} - -DECLARE_RTFIMPORT_TEST(testDprectAnchor, "dprect-anchor.rtf") -{ - // This was at-page, which is not something Word supports, so clearly an import error. - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); -} - -DECLARE_RTFIMPORT_TEST(testFdo76628, "fdo76628.rtf") -{ - OUString aExpected("\xd0\x9e\xd0\x91\xd0\xa0\xd0\x90\xd0\x97\xd0\x95\xd0\xa6", 14, RTL_TEXTENCODING_UTF8); - // Should be 'SAMPLE' in Russian, was garbage. - getParagraph(1, aExpected); - - uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); - OUString aExpectedHeader("\xd0\x9f\xd0\xbe\xd0\xb4\xd0\xb3\xd0\xbe\xd1\x82\xd0\xbe\xd0\xb2\xd0\xbb\xd0\xb5\xd0\xbd\xd0\xbe", 24, RTL_TEXTENCODING_UTF8); - // Should be 'prepared' in Russian, was garbage. - getParagraphOfText(1, xHeaderText, aExpectedHeader); -} - DECLARE_RTFIMPORT_TEST(testFdo74823, "fdo74823.rtf") { uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -1947,46 +661,12 @@ DECLARE_RTFIMPORT_TEST(testFdo74599, "fdo74599.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xPropertySet, "CharColor")); } -DECLARE_RTFIMPORT_TEST(testFdo77267, "fdo77267.rtf") -{ - // Paragraph was aligned to left, should be center. - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); -} - -DECLARE_RTFIMPORT_TEST(testFdo75735, "fdo75735.rtf") -{ - // Number of tabstops in the second paragraph should be 3, was 6. - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<style::TabStop> >(getParagraph(2), "ParaTabStops").getLength()); -} - -DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf") -{ - // This was "Times New Roman". - CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName")); -} - DECLARE_RTFIMPORT_TEST(testColumnBreak, "column-break.rtf") { // Column break at the very start of the document was ignored. CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); } -DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") -{ - // This was 2, page break in table wasn't ignored. - CPPUNIT_ASSERT_EQUAL(1, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testFdo80905, "fdo80905.rtf") -{ - uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); - uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); - xFields->nextElement(); - // The problem was that there was only one field in the document, but there should be true. - CPPUNIT_ASSERT_EQUAL(true, static_cast<bool>(xFields->hasMoreElements())); -} - DECLARE_RTFIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.rtf") { uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); @@ -2008,12 +688,6 @@ DECLARE_RTFIMPORT_TEST(testFdo80742, "fdo80742.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xPropertySet, "OutlineLevel")); } -DECLARE_RTFIMPORT_TEST(testFdo82106, "fdo82106.rtf") -{ - // Tab was missing after footnote not containing a tab. - getParagraph(2, "before\tafter"); -} - DECLARE_RTFIMPORT_TEST(testBehindDoc, "behind-doc.rtf") { // The problem was that "behind doc" didn't result in the shape being in the background, only in being wrapped as "through". @@ -2023,34 +697,6 @@ DECLARE_RTFIMPORT_TEST(testBehindDoc, "behind-doc.rtf") CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xShape, "Opaque")); } -DECLARE_RTFIMPORT_TEST(testFdo74229, "fdo74229.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // This was 0, due to ignoring RTF_TRGAPH. - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(67)), getProperty<sal_Int32>(xCell, "RightBorderDistance")); -} - -DECLARE_RTFIMPORT_TEST(testFdo79959, "fdo79959.rtf") -{ - // This was false, as the style was imported as " Test", i.e. no whitespace stripping. - CPPUNIT_ASSERT_EQUAL(true, static_cast<bool>(getStyles("ParagraphStyles")->hasByName("Test"))); -} - -DECLARE_RTFIMPORT_TEST(testFdo82078, "fdo82078.rtf") -{ - // This was awt::FontWeight::BOLD, i.e. the second run was bold, when it should be normal. - CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(getRun(getParagraph(1), 2), "CharWeight")); -} - -DECLARE_RTFIMPORT_TEST(testCsBold, "cs-bold.rtf") -{ - // This was awt::FontWeight::NORMAL, i.e. the first run was bold, when it should be bold (applied character style without direct formatting). - CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight")); -} - DECLARE_RTFIMPORT_TEST(testFdo82114, "fdo82114.rtf") { uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Converted1"), "HeaderText"); @@ -2070,17 +716,6 @@ DECLARE_RTFIMPORT_TEST(testFdo44984, "fdo44984.rtf") CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStartEnd"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType")); } -DECLARE_RTFIMPORT_TEST(testFdo84679, "fdo84679.rtf") -{ - // The problem was that the paragraph in A1 had some bottom margin, but it should not. - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // This was 282. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); -} - DECLARE_RTFIMPORT_TEST(testFdo82071, "fdo82071.rtf") { // The problem was that in TOC, chapter names were underlined, but they should not be. @@ -2091,15 +726,6 @@ DECLARE_RTFIMPORT_TEST(testFdo82071, "fdo82071.rtf") CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::NONE, getProperty<sal_Int16>(xRun, "CharUnderline")); } -DECLARE_RTFIMPORT_TEST(testFdo83464, "fdo83464.rtf") -{ - // Problem was that the text in the textframe had wrong font. - uno::Reference<text::XTextRange> xFrameText(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xFrameText->getString()); - // This was Times New Roman. - CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), getProperty<OUString>(getRun(getParagraphOfText(1, xFrameText->getText()), 1), "CharFontName")); -} - DECLARE_RTFIMPORT_TEST(testFdo85179, "fdo85179.rtf") { // This was 0, border around the picture was ignored on import. @@ -2107,29 +733,6 @@ DECLARE_RTFIMPORT_TEST(testFdo85179, "fdo85179.rtf") CPPUNIT_ASSERT_EQUAL(sal_uInt32(50800/360), getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineWidth); } -DECLARE_RTFIMPORT_TEST(testFdo86761, "fdo86761.rtf") -{ - // This was 26, even if the picture should have no border, due to fLine=0. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineWidth); -} - -DECLARE_RTFIMPORT_TEST(testFdo82859, "fdo82859.rtf") -{ - // This was 0: "0xffffff" was converted to 0, i.e. the background was black instead of the default. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(getShape(1), "BackColor")); -} - -DECLARE_RTFIMPORT_TEST(testFdo82076, "fdo82076.rtf") -{ - // Footnote position was wrong: should be at the end of the B1 cell. - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY); - // This resulted in container::NoSuchElementException: the footnote was at the start of the A1 cell. - CPPUNIT_ASSERT_EQUAL(OUString("Footnote"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 2), "TextPortionType")); -} - DECLARE_RTFIMPORT_TEST(testFdo82512, "fdo82512.rtf") { // This was style::BreakType_NONE, column break was before the 3rd paragraph, not before the 2nd one. @@ -2163,12 +766,6 @@ DECLARE_RTFIMPORT_TEST(testFdo84685, "fdo84685.rtf") CPPUNIT_ASSERT(xTOCSI->supportsService("com.sun.star.text.ContentIndexMark")); } -DECLARE_RTFIMPORT_TEST(testFdo83204, "fdo83204.rtf") -{ - // This was Standard, \sN was ignored after \bkmkstart and \pard. - CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty<OUString>(getParagraph(1), "ParaStyleName")); -} - // This testcase illustrate leveltext with multibyte strings coded in cp950 ( BIG5 ). DECLARE_RTFIMPORT_TEST(testCp950listleveltext1, "cp950listleveltext1.rtf") { @@ -2269,22 +866,6 @@ DECLARE_RTFIMPORT_TEST(testChtOutlineNumberingRtf, "chtoutline.rtf") CPPUNIT_ASSERT_EQUAL(OUString(aExpectedSuffix,SAL_N_ELEMENTS(aExpectedSuffix)), aSuffix); } -DECLARE_RTFIMPORT_TEST(testFdo85889pc, "fdo85889-pc.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - - OUString aExpected("\xc2\xb1\xe2\x89\xa5\xe2\x89\xa4", 8, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo85889pca, "fdo85889-pca.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - - OUString aExpected("\xc2\xb1\xe2\x80\x97\xc2\xbe", 7, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - DECLARE_RTFIMPORT_TEST(testTdf90046, "tdf90046.rtf") { // this was crashing on importing the footnote @@ -2294,34 +875,6 @@ DECLARE_RTFIMPORT_TEST(testTdf90046, "tdf90046.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Ma"), xTextRange->getString()); } -DECLARE_RTFIMPORT_TEST(testFdo85889mac, "fdo85889-mac.rtf") -{ - uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); - - OUString aExpected("\xc3\x92\xc3\x9a\xc3\x9b", 6, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo72031, "fdo72031.rtf") -{ - OUString aExpected("\xc3\x85", 2, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, getRun(getParagraph(1), 1)->getString()); -} - -DECLARE_RTFIMPORT_TEST(testFdo86750, "fdo86750.rtf") -{ - // This was 'HYPERLINK#anchor', the URL of the hyperlink had the field type as a prefix, leading to broken links. - CPPUNIT_ASSERT_EQUAL(OUString("#anchor"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); -} - -DECLARE_RTFIMPORT_TEST(testTdf88811, "tdf88811.rtf") -{ - // The problem was that shapes anchored to the paragraph that is moved into a textframe were lost, so this was 2. - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xDrawPage->getCount()); -} - DECLARE_RTFIMPORT_TEST(testFdo49893, "fdo49893.rtf") { // Image from shape was not loaded, invalid size of image after load @@ -2331,14 +884,6 @@ DECLARE_RTFIMPORT_TEST(testFdo49893, "fdo49893.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(1296)), xShape->getSize().Width); } -DECLARE_RTFIMPORT_TEST(testFdo49893_2, "fdo49893-2.rtf") -{ - // Ensure that header text exists on each page (especially on second page) - CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[1]/header/txt/text()")); - CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[2]/header/txt/text()")); - CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), parseDump("/root/page[3]/header/txt/text()")); -} - DECLARE_RTFIMPORT_TEST(testFdo49893_3, "fdo49893-3.rtf") { // No artifacts (black lines in left top corner) as shape #3 are expected @@ -2356,31 +901,6 @@ DECLARE_RTFIMPORT_TEST(testFdo49893_3, "fdo49893-3.rtf") CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty<text::WrapTextMode>(getShape(2), "Surround")); } -DECLARE_RTFIMPORT_TEST(testFdo89496, "fdo89496.rtf") -{ - // Just ensure that document is loaded and shape exists - uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xShape.is()); -} - -DECLARE_RTFIMPORT_TEST(testFdo75614, "tdf75614.rtf") -{ - // Text after the footnote was missing, so this resulted in a css::container::NoSuchElementException. - CPPUNIT_ASSERT_EQUAL(OUString("after."), getRun(getParagraph(1), 3)->getString()); -} - -DECLARE_RTFIMPORT_TEST(mathtype, "mathtype.rtf") -{ - OUString aFormula = getFormula(getRun(getParagraph(1), 1)); - CPPUNIT_ASSERT(!aFormula.isEmpty()); -} - -DECLARE_RTFIMPORT_TEST(testTdf86182, "tdf86182.rtf") -{ - // Writing mode was the default, i.e. text::WritingMode2::CONTEXT. - CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(getParagraph(1), "WritingMode")); -} - DECLARE_RTFIMPORT_TEST(testWrapDistance, "wrap-distance.rtf") { // Custom shape, handled directly in RTFSdrImport. @@ -2399,22 +919,6 @@ DECLARE_RTFIMPORT_TEST(testWrapDistance, "wrap-distance.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), getProperty<sal_Int32>(xShape, "RightMargin") / 1000); } -DECLARE_RTFIMPORT_TEST(testTdf91074, "tdf91074.rtf") -{ - // The file failed to load, as the border color was imported using the LineColor UNO property. - uno::Reference<drawing::XShape> xShape = getShape(1); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_LIGHTRED), getProperty<table::BorderLine2>(xShape, "TopBorder").Color); -} - -DECLARE_RTFIMPORT_TEST(testTdf90260Nopar, "hello.rtf") -{ - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - paste("tdf90260-nopar.rtf", xEnd); - CPPUNIT_ASSERT_EQUAL(1, getParagraphs()); -} - DECLARE_RTFIMPORT_TEST(testTdf90260Par, "hello.rtf") { uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); @@ -2424,20 +928,6 @@ DECLARE_RTFIMPORT_TEST(testTdf90260Par, "hello.rtf") CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); } -DECLARE_RTFIMPORT_TEST(testTdf86814, "tdf86814.rtf") -{ - // This was awt::FontWeight::NORMAL, i.e. the first run wasn't bold, when it should be bold (applied paragraph style with direct formatting). - CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight")); -} - -DECLARE_RTFIMPORT_TEST(testTdf108416, "tdf108416.rtf") -{ - uno::Reference<container::XNameAccess> xCharacterStyles(getStyles("CharacterStyles")); - uno::Reference<beans::XPropertySet> xListLabel(xCharacterStyles->getByName("ListLabel 1"), uno::UNO_QUERY); - // This was awt::FontWeight::BOLD, list numbering got an unexpected bold formatting. - CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xListLabel, "CharWeight")); -} - DECLARE_RTFIMPORT_TEST(testTdf90315, "tdf90315.rtf") { uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); @@ -2447,64 +937,12 @@ DECLARE_RTFIMPORT_TEST(testTdf90315, "tdf90315.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(xTextSection->getPropertyValue("TextColumns"), "AutomaticDistance")); } -DECLARE_RTFIMPORT_TEST(testBinSkipping, "bin-skipping.rtf") -{ - // before, it was importing '/nMUST NOT IMPORT' - CPPUNIT_ASSERT_EQUAL(OUString("text"), getRun(getParagraph(1), 1)->getString()); -} - -DECLARE_RTFIMPORT_TEST(testTdf92061, "tdf92061.rtf") -{ - // This was "C", i.e. part of the footnote ended up in the body text. - CPPUNIT_ASSERT_EQUAL(OUString("body-after"), getRun(getParagraph(1), 3)->getString()); -} - -DECLARE_RTFIMPORT_TEST(testTdf92481, "tdf92481.rtf") -{ - // This was 0, RTF_WIDOWCTRL was not imported. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int8>(2), getProperty<sal_Int8>(getParagraph(1), "ParaWidows")); -} - -DECLARE_RTFIMPORT_TEST(testTdf94456, "tdf94456.rtf") -{ - // Paragraph left margin and first line indent wasn't imported correctly. - - // This was 1270. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(762), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); - // This was -635. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-762), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); -} - -DECLARE_RTFIMPORT_TEST(testTdf94435, "tdf94435.rtf") -{ - // This was style::ParagraphAdjust_LEFT, \ltrpar undone the effect of \qc. - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); -} - DECLARE_RTFIMPORT_TEST(testTdf59454, "tdf59454.rtf") { // This was 1, section break was ignored right before a table. CPPUNIT_ASSERT_EQUAL(2, getPages()); } -DECLARE_RTFIMPORT_TEST(testTdf54584, "tdf54584.rtf") -{ - uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); - uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); - // \PAGE was ignored, so no fields were in document -> exception was thrown - CPPUNIT_ASSERT_NO_THROW_MESSAGE("No fields in document found: field \"\\PAGE\" was not properly read", - xFields->nextElement()); -} - -DECLARE_RTFIMPORT_TEST(testTdf96308Deftab, "tdf96308-deftab.rtf") -{ - uno::Reference<lang::XMultiServiceFactory> xTextFactory(mxComponent, uno::UNO_QUERY); - uno::Reference<beans::XPropertySet> xDefaults(xTextFactory->createInstance("com.sun.star.text.Defaults"), uno::UNO_QUERY); - // This was 1270 as \deftab was ignored on import. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(284)), getProperty<sal_Int32>(xDefaults, "TabStopDistance")); -} - DECLARE_RTFIMPORT_TEST(testTdf96308Tabpos, "tdf96308-tabpos.rtf") { // Get the tab stops of the second para in the B1 cell of the first table in the document. @@ -2560,51 +998,6 @@ DECLARE_RTFIMPORT_TEST(testLndscpsxn, "lndscpsxn.rtf") CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStylePage, "IsLandscape")); } -DECLARE_RTFIMPORT_TEST(testLandscape, "landscape.rtf") -{ - // Check landscape flag. - CPPUNIT_ASSERT_EQUAL(3, getPages()); - - // All pages should have flag orientiation - uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles"); - - // get a page cursor - 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); - - // check that the first page has landscape flag - xCursor->jumpToFirstPage(); - OUString pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); - uno::Reference<style::XStyle> xStylePage(pageStyles->getByName(pageStyleName), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, "IsLandscape")); - - // check that the second page has landscape flag - xCursor->jumpToPage(2); - pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); - xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, "IsLandscape")); - - // check that the last page has landscape flag - xCursor->jumpToLastPage(); - pageStyleName = getProperty<OUString>(xCursor, "PageStyleName"); - xStylePage.set(pageStyles->getByName(pageStyleName), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStylePage, "IsLandscape")); -} - -DECLARE_RTFIMPORT_TEST(testTdf97035, "tdf97035.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - - // First cell width of the second row should be 2299 - uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2299), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); -} - DECLARE_RTFIMPORT_TEST(testTdf99498, "tdf99498.rtf") { uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -2615,14 +1008,6 @@ DECLARE_RTFIMPORT_TEST(testTdf99498, "tdf99498.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(7056), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); } - -DECLARE_RTFIMPORT_TEST(testTdf87034, "tdf87034.rtf") -{ - // This was A1BC34D, i.e. the first "super" text portion was mis-imported, - // and was inserted instead right before the second "super" text portion. - CPPUNIT_ASSERT_EQUAL(OUString("A1B3C4D"), getParagraph(1)->getString()); -} - DECLARE_RTFIMPORT_TEST(testClassificatonPaste, "hello.rtf") { uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); @@ -2639,18 +1024,6 @@ DECLARE_RTFIMPORT_TEST(testClassificatonPaste, "hello.rtf") CPPUNIT_ASSERT_EQUAL(aOld, xText->getString()); } -DECLARE_RTFIMPORT_TEST(testClassificatonPasteLevels, "classification-confidential.rtf") -{ - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference<text::XTextRange> xText(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xEnd = xText->getEnd(); - - // Classified source and classified destination, but internal only has a - // higher level than confidential: nothing should happen. - OUString aOld = xText->getString(); - paste("classification-yes.rtf", xEnd); - CPPUNIT_ASSERT_EQUAL(aOld, xText->getString()); -} #if !defined(MACOSX) && !defined(WNT) DECLARE_RTFIMPORT_TEST(testTdf90097, "tdf90097.rtf") @@ -2671,56 +1044,6 @@ DECLARE_RTFIMPORT_TEST(testTdf90097, "tdf90097.rtf") } #endif -DECLARE_RTFIMPORT_TEST(testTdf95707, "tdf95707.rtf") -{ - // Graphic was replaced with a "Read-Error" placeholder. - CPPUNIT_ASSERT(getProperty<OUString>(getShape(1), "GraphicURL") != "vnd.sun.star.GraphicObject:0000000000000000000000000000000000000000"); -} - -DECLARE_RTFIMPORT_TEST(testTdf96275, "tdf96275.rtf") -{ - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(3, xCell->getText()); - // This was text: the shape's frame was part of the 1st paragraph instead of the 3rd one. - CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xParagraph, 1), "TextPortionType")); -} - -DECLARE_RTFIMPORT_TEST(testTdf82073, "tdf82073.rtf") -{ - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // This was -1: the background color was automatic, not black. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xCell, "BackColor")); -} - -DECLARE_RTFIMPORT_TEST(testTdf74795, "tdf74795.rtf") -{ - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // This was 0, \trpaddl was ignored on import. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(635), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); - - xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); - // Make sure that the scope of the default is only one row. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); -} - -DECLARE_RTFIMPORT_TEST(testTdf77349, "tdf77349.rtf") -{ - uno::Reference<container::XNamed> xImage(getShape(1), uno::UNO_QUERY); - // This was empty: imported image wasn't named automatically. - CPPUNIT_ASSERT_EQUAL(OUString("Image1"), xImage->getName()); -} - -DECLARE_RTFIMPORT_TEST(testTdf50821, "tdf50821.rtf") -{ - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - // This was 0, \trpaddfl was mishandled on import. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(191), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); -} - DECLARE_RTFIMPORT_TEST(testTdf91684, "tdf91684.rtf") { // Scaling of the group shape children were incorrect, this was 3203. @@ -2765,95 +1088,6 @@ DECLARE_RTFIMPORT_TEST(testTdf78506, "tdf78506.rtf") } } -DECLARE_RTFIMPORT_TEST(testTdf100507, "tdf100507.rtf") -{ - // This was 0: left margin of the first paragraph was lost on import. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6618), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); -} - -DECLARE_RTFIMPORT_TEST(testTdf44986, "tdf44986.rtf") -{ - // Check that the table at the second paragraph. - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); - uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); - // Check the first row of the table, it should have two cells (one separator). - // This was 0: the first row had no separators, so it had only one cell, which was too wide. - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); -} - -DECLARE_RTFIMPORT_TEST(testTdf90697, "tdf90697.rtf") -{ - // We want section breaks to be seen as section breaks, not as page breaks, - // so this document should have only one page, not three. - CPPUNIT_ASSERT_EQUAL(1, getPages()); -} - -DECLARE_RTFIMPORT_TEST(testTdf104317, "tdf104317.rtf") -{ - // This failed to load, we tried to set CustomShapeGeometry on a line shape. - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xDrawPage->getCount()); -} - -DECLARE_RTFIMPORT_TEST(testTdf104744, "tdf104744.rtf") -{ - // This was 0, as an unexpected "left margin is 0" token was created during - // import. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); -} - -DECLARE_RTFIMPORT_TEST(testTdf105852, "tdf105852.rtf") -{ - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); - uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); - // All rows but last were merged -> there were only 2 rows - CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xTableRows->getCount()); - // The first row must have 4 cells. - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); - // The third row must have 1 merged cell. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(2), "TableColumnSeparators").getLength()); -} - -DECLARE_RTFIMPORT_TEST(testTdf104287, "tdf104287.rtf") -{ - uno::Reference<text::XTextContent> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xShape.is()); - // This failed, the bitmap had no valid anchor. - CPPUNIT_ASSERT(xShape->getAnchor().is()); -} - -DECLARE_RTFIMPORT_TEST(testTdf105729, "tdf105729.rtf") -{ - // This was style::ParagraphAdjust_LEFT, \ltrpar undone the effect of \qc from style. - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust"))); -} - -DECLARE_RTFIMPORT_TEST(testTdf106694, "tdf106694.rtf") -{ - auto aTabs = getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops"); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aTabs.getLength()); - // This was 0, tab position was incorrect, looked like it was missing. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14605), aTabs[0].Position); -} - -DECLARE_RTFIMPORT_TEST(testTdf107116, "tdf107116.rtf") -{ - // This was 0, upper border around text (and its distance) was missing. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(120)), getProperty<sal_Int32>(getParagraph(2), "TopBorderDistance")); -} - -DECLARE_RTFIMPORT_TEST(testTdf106950, "tdf106950.rtf") -{ - uno::Reference<text::XTextRange> xPara(getParagraph(1)); - // This was ParagraphAdjust_LEFT, trying to set CharShadingValue on a - // paragraph style thrown an exception, and remaining properties were not - // set. - CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); -} - DECLARE_RTFIMPORT_TEST(testImportHeaderFooter, "tdf108055.rtf") { // The RTF import sometimes added Header and Footer multiple Times @@ -2914,6 +1148,8 @@ DECLARE_RTFIMPORT_TEST(testWatermark, "watermark.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height); } +// tests should only be added to rtfIMPORT *if* they fail round-tripping in rtfEXPORT + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |