From 06b6a1da4a19108d0988ebe49c680905ae27d721 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 13 Jul 2012 16:25:03 +0200 Subject: sw/qa/extras: rename import tests from *tok to *import odfimport sounds much better as there's no such thing as "odftok" Change-Id: I0a8684377c257f2c40a2e8255f62343d4ff2272a --- sw/CppunitTest_sw_subsequent_odfimport.mk | 97 +++ sw/CppunitTest_sw_subsequent_odftok.mk | 97 --- sw/CppunitTest_sw_subsequent_ooxmlimport.mk | 99 +++ sw/CppunitTest_sw_subsequent_ooxmltok.mk | 99 --- sw/CppunitTest_sw_subsequent_rtfimport.mk | 95 +++ sw/CppunitTest_sw_subsequent_rtftok.mk | 95 --- sw/CppunitTest_sw_subsequent_ww8import.mk | 96 +++ sw/CppunitTest_sw_subsequent_ww8tok.mk | 96 --- sw/Module_sw.mk | 8 +- sw/qa/extras/odfimport/data/hello.odt | Bin 0 -> 8159 bytes sw/qa/extras/odfimport/odfimport.cxx | 71 ++ sw/qa/extras/odftok/data/hello.odt | Bin 8159 -> 0 bytes sw/qa/extras/odftok/odftok.cxx | 71 -- sw/qa/extras/ooxmlimport/data/fdo49940.docx | Bin 0 -> 9909 bytes sw/qa/extras/ooxmlimport/data/n652364.docx | Bin 0 -> 8975 bytes sw/qa/extras/ooxmlimport/data/n693238.docx | Bin 0 -> 9933 bytes sw/qa/extras/ooxmlimport/data/n705956-1.docx | Bin 0 -> 7861 bytes sw/qa/extras/ooxmlimport/data/n705956-2.docx | Bin 0 -> 9363 bytes sw/qa/extras/ooxmlimport/data/n747461.docx | Bin 0 -> 6489 bytes sw/qa/extras/ooxmlimport/data/n750255.docx | Bin 0 -> 10102 bytes sw/qa/extras/ooxmlimport/data/n750935.docx | Bin 0 -> 57750 bytes sw/qa/extras/ooxmlimport/data/n751017.docx | Bin 0 -> 10194 bytes sw/qa/extras/ooxmlimport/data/n751054.docx | Bin 0 -> 13100 bytes sw/qa/extras/ooxmlimport/data/n751077.docx | Bin 0 -> 22131 bytes sw/qa/extras/ooxmlimport/data/n751117.docx | Bin 0 -> 10312 bytes sw/qa/extras/ooxmlimport/data/n757890.docx | Bin 0 -> 11098 bytes sw/qa/extras/ooxmlimport/data/n758883.docx | Bin 0 -> 11896 bytes sw/qa/extras/ooxmlimport/data/n760764.docx | Bin 0 -> 10079 bytes sw/qa/extras/ooxmlimport/data/n764005.docx | Bin 0 -> 13088 bytes .../extras/ooxmlimport/data/n764745-alignment.docx | Bin 0 -> 5635 bytes sw/qa/extras/ooxmlimport/data/n766477.docx | Bin 0 -> 10104 bytes sw/qa/extras/ooxmlimport/data/n766481.docx | Bin 0 -> 10021 bytes sw/qa/extras/ooxmlimport/data/n766487.docx | Bin 0 -> 9273 bytes sw/qa/extras/ooxmlimport/data/numbering1.docx | Bin 0 -> 14346 bytes sw/qa/extras/ooxmlimport/data/smartart.docx | Bin 0 -> 20453 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 743 +++++++++++++++++++ sw/qa/extras/ooxmltok/data/fdo49940.docx | Bin 9909 -> 0 bytes sw/qa/extras/ooxmltok/data/n652364.docx | Bin 8975 -> 0 bytes sw/qa/extras/ooxmltok/data/n693238.docx | Bin 9933 -> 0 bytes sw/qa/extras/ooxmltok/data/n705956-1.docx | Bin 7861 -> 0 bytes sw/qa/extras/ooxmltok/data/n705956-2.docx | Bin 9363 -> 0 bytes sw/qa/extras/ooxmltok/data/n747461.docx | Bin 6489 -> 0 bytes sw/qa/extras/ooxmltok/data/n750255.docx | Bin 10102 -> 0 bytes sw/qa/extras/ooxmltok/data/n750935.docx | Bin 57750 -> 0 bytes sw/qa/extras/ooxmltok/data/n751017.docx | Bin 10194 -> 0 bytes sw/qa/extras/ooxmltok/data/n751054.docx | Bin 13100 -> 0 bytes sw/qa/extras/ooxmltok/data/n751077.docx | Bin 22131 -> 0 bytes sw/qa/extras/ooxmltok/data/n751117.docx | Bin 10312 -> 0 bytes sw/qa/extras/ooxmltok/data/n757890.docx | Bin 11098 -> 0 bytes sw/qa/extras/ooxmltok/data/n758883.docx | Bin 11896 -> 0 bytes sw/qa/extras/ooxmltok/data/n760764.docx | Bin 10079 -> 0 bytes sw/qa/extras/ooxmltok/data/n764005.docx | Bin 13088 -> 0 bytes sw/qa/extras/ooxmltok/data/n764745-alignment.docx | Bin 5635 -> 0 bytes sw/qa/extras/ooxmltok/data/n766477.docx | Bin 10104 -> 0 bytes sw/qa/extras/ooxmltok/data/n766481.docx | Bin 10021 -> 0 bytes sw/qa/extras/ooxmltok/data/n766487.docx | Bin 9273 -> 0 bytes sw/qa/extras/ooxmltok/data/numbering1.docx | Bin 14346 -> 0 bytes sw/qa/extras/ooxmltok/data/smartart.docx | Bin 20453 -> 0 bytes sw/qa/extras/ooxmltok/ooxmltok.cxx | 743 ------------------- sw/qa/extras/rtfimport/data/fdo38786.rtf | 2 + sw/qa/extras/rtfimport/data/fdo39053.rtf | Bin 0 -> 22118 bytes sw/qa/extras/rtfimport/data/fdo42465.rtf | 4 + sw/qa/extras/rtfimport/data/fdo43965.rtf | 16 + sw/qa/extras/rtfimport/data/fdo44176.rtf | 10 + sw/qa/extras/rtfimport/data/fdo44211.rtf | 4 + sw/qa/extras/rtfimport/data/fdo45182.rtf | 11 + sw/qa/extras/rtfimport/data/fdo45187.rtf | 32 + sw/qa/extras/rtfimport/data/fdo45190.rtf | 10 + sw/qa/extras/rtfimport/data/fdo45394.rtf | 19 + sw/qa/extras/rtfimport/data/fdo45543.rtf | 8 + sw/qa/extras/rtfimport/data/fdo45553.rtf | 2 + sw/qa/extras/rtfimport/data/fdo45563.rtf | 5 + sw/qa/extras/rtfimport/data/fdo46662.rtf | 46 ++ sw/qa/extras/rtfimport/data/fdo46955.rtf | 1 + sw/qa/extras/rtfimport/data/fdo46966.rtf | 10 + sw/qa/extras/rtfimport/data/fdo47036.rtf | 73 ++ sw/qa/extras/rtfimport/data/fdo47107.rtf | 21 + sw/qa/extras/rtfimport/data/fdo47326.rtf | 5 + sw/qa/extras/rtfimport/data/fdo47764.rtf | 4 + sw/qa/extras/rtfimport/data/fdo48023.rtf | 8 + sw/qa/extras/rtfimport/data/fdo48037.rtf | 13 + sw/qa/extras/rtfimport/data/fdo48104.rtf | 6 + sw/qa/extras/rtfimport/data/fdo48193.rtf | 10 + sw/qa/extras/rtfimport/data/fdo48356.rtf | 3 + sw/qa/extras/rtfimport/data/fdo48876.rtf | 5 + sw/qa/extras/rtfimport/data/fdo49271.rtf | 3 + sw/qa/extras/rtfimport/data/fdo49501.rtf | 5 + sw/qa/extras/rtfimport/data/fdo49659.rtf | 19 + sw/qa/extras/rtfimport/data/fdo49692.rtf | 17 + sw/qa/extras/rtfimport/data/fdo50539.rtf | 4 + sw/qa/extras/rtfimport/data/fdo50665.rtf | 16 + sw/qa/extras/rtfimport/data/n192129.rtf | 3 + sw/qa/extras/rtfimport/data/n695479.rtf | 14 + sw/qa/extras/rtfimport/data/n750757.rtf | 45 ++ sw/qa/extras/rtfimport/data/n751020.rtf | 8 + sw/qa/extras/rtfimport/data/n757651.rtf | 18 + sw/qa/extras/rtfimport/rtfimport.cxx | 818 +++++++++++++++++++++ sw/qa/extras/rtftok/data/fdo38786.rtf | 2 - sw/qa/extras/rtftok/data/fdo39053.rtf | Bin 22118 -> 0 bytes sw/qa/extras/rtftok/data/fdo42465.rtf | 4 - sw/qa/extras/rtftok/data/fdo43965.rtf | 16 - sw/qa/extras/rtftok/data/fdo44176.rtf | 10 - sw/qa/extras/rtftok/data/fdo44211.rtf | 4 - sw/qa/extras/rtftok/data/fdo45182.rtf | 11 - sw/qa/extras/rtftok/data/fdo45187.rtf | 32 - sw/qa/extras/rtftok/data/fdo45190.rtf | 10 - sw/qa/extras/rtftok/data/fdo45394.rtf | 19 - sw/qa/extras/rtftok/data/fdo45543.rtf | 8 - sw/qa/extras/rtftok/data/fdo45553.rtf | 2 - sw/qa/extras/rtftok/data/fdo45563.rtf | 5 - sw/qa/extras/rtftok/data/fdo46662.rtf | 46 -- sw/qa/extras/rtftok/data/fdo46955.rtf | 1 - sw/qa/extras/rtftok/data/fdo46966.rtf | 10 - sw/qa/extras/rtftok/data/fdo47036.rtf | 73 -- sw/qa/extras/rtftok/data/fdo47107.rtf | 21 - sw/qa/extras/rtftok/data/fdo47326.rtf | 5 - sw/qa/extras/rtftok/data/fdo47764.rtf | 4 - sw/qa/extras/rtftok/data/fdo48023.rtf | 8 - sw/qa/extras/rtftok/data/fdo48037.rtf | 13 - sw/qa/extras/rtftok/data/fdo48104.rtf | 6 - sw/qa/extras/rtftok/data/fdo48193.rtf | 10 - sw/qa/extras/rtftok/data/fdo48356.rtf | 3 - sw/qa/extras/rtftok/data/fdo48876.rtf | 5 - sw/qa/extras/rtftok/data/fdo49271.rtf | 3 - sw/qa/extras/rtftok/data/fdo49501.rtf | 5 - sw/qa/extras/rtftok/data/fdo49659.rtf | 19 - sw/qa/extras/rtftok/data/fdo49692.rtf | 17 - sw/qa/extras/rtftok/data/fdo50539.rtf | 4 - sw/qa/extras/rtftok/data/fdo50665.rtf | 16 - sw/qa/extras/rtftok/data/n192129.rtf | 3 - sw/qa/extras/rtftok/data/n695479.rtf | 14 - sw/qa/extras/rtftok/data/n750757.rtf | 45 -- sw/qa/extras/rtftok/data/n751020.rtf | 8 - sw/qa/extras/rtftok/data/n757651.rtf | 18 - sw/qa/extras/rtftok/rtftok.cxx | 818 --------------------- sw/qa/extras/ww8import/data/n652364.doc | Bin 0 -> 22016 bytes sw/qa/extras/ww8import/data/n750255.doc | Bin 0 -> 22016 bytes sw/qa/extras/ww8import/data/n757118.doc | Bin 0 -> 35840 bytes sw/qa/extras/ww8import/data/n757905.doc | Bin 0 -> 28160 bytes sw/qa/extras/ww8import/data/n757910.doc | Bin 0 -> 22528 bytes sw/qa/extras/ww8import/data/n760294.doc | Bin 0 -> 26112 bytes sw/qa/extras/ww8import/ww8import.cxx | 230 ++++++ sw/qa/extras/ww8tok/data/n652364.doc | Bin 22016 -> 0 bytes sw/qa/extras/ww8tok/data/n750255.doc | Bin 22016 -> 0 bytes sw/qa/extras/ww8tok/data/n757118.doc | Bin 35840 -> 0 bytes sw/qa/extras/ww8tok/data/n757905.doc | Bin 28160 -> 0 bytes sw/qa/extras/ww8tok/data/n757910.doc | Bin 22528 -> 0 bytes sw/qa/extras/ww8tok/data/n760294.doc | Bin 26112 -> 0 bytes sw/qa/extras/ww8tok/ww8tok.cxx | 230 ------ 149 files changed, 2733 insertions(+), 2733 deletions(-) create mode 100644 sw/CppunitTest_sw_subsequent_odfimport.mk delete mode 100644 sw/CppunitTest_sw_subsequent_odftok.mk create mode 100644 sw/CppunitTest_sw_subsequent_ooxmlimport.mk delete mode 100644 sw/CppunitTest_sw_subsequent_ooxmltok.mk create mode 100644 sw/CppunitTest_sw_subsequent_rtfimport.mk delete mode 100644 sw/CppunitTest_sw_subsequent_rtftok.mk create mode 100644 sw/CppunitTest_sw_subsequent_ww8import.mk delete mode 100644 sw/CppunitTest_sw_subsequent_ww8tok.mk create mode 100644 sw/qa/extras/odfimport/data/hello.odt create mode 100644 sw/qa/extras/odfimport/odfimport.cxx delete mode 100644 sw/qa/extras/odftok/data/hello.odt delete mode 100644 sw/qa/extras/odftok/odftok.cxx create mode 100644 sw/qa/extras/ooxmlimport/data/fdo49940.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n652364.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n693238.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n705956-1.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n705956-2.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n747461.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n750255.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n750935.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n751017.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n751054.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n751077.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n751117.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n757890.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n758883.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n760764.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n764005.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n764745-alignment.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n766477.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n766481.docx create mode 100644 sw/qa/extras/ooxmlimport/data/n766487.docx create mode 100644 sw/qa/extras/ooxmlimport/data/numbering1.docx create mode 100644 sw/qa/extras/ooxmlimport/data/smartart.docx create mode 100644 sw/qa/extras/ooxmlimport/ooxmlimport.cxx delete mode 100644 sw/qa/extras/ooxmltok/data/fdo49940.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n652364.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n693238.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n705956-1.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n705956-2.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n747461.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n750255.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n750935.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n751017.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n751054.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n751077.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n751117.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n757890.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n758883.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n760764.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n764005.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n764745-alignment.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n766477.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n766481.docx delete mode 100644 sw/qa/extras/ooxmltok/data/n766487.docx delete mode 100644 sw/qa/extras/ooxmltok/data/numbering1.docx delete mode 100644 sw/qa/extras/ooxmltok/data/smartart.docx delete mode 100644 sw/qa/extras/ooxmltok/ooxmltok.cxx create mode 100644 sw/qa/extras/rtfimport/data/fdo38786.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo39053.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo42465.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo43965.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo44176.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo44211.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45182.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45187.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45190.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45394.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45543.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45553.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo45563.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo46662.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo46955.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo46966.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo47036.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo47107.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo47326.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo47764.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo48023.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo48037.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo48104.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo48193.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo48356.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo48876.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo49271.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo49501.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo49659.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo49692.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo50539.rtf create mode 100644 sw/qa/extras/rtfimport/data/fdo50665.rtf create mode 100644 sw/qa/extras/rtfimport/data/n192129.rtf create mode 100644 sw/qa/extras/rtfimport/data/n695479.rtf create mode 100644 sw/qa/extras/rtfimport/data/n750757.rtf create mode 100644 sw/qa/extras/rtfimport/data/n751020.rtf create mode 100644 sw/qa/extras/rtfimport/data/n757651.rtf create mode 100644 sw/qa/extras/rtfimport/rtfimport.cxx delete mode 100644 sw/qa/extras/rtftok/data/fdo38786.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo39053.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo42465.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo43965.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo44176.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo44211.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45182.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45187.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45190.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45394.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45543.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45553.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo45563.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo46662.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo46955.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo46966.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo47036.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo47107.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo47326.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo47764.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo48023.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo48037.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo48104.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo48193.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo48356.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo48876.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo49271.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo49501.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo49659.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo49692.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo50539.rtf delete mode 100644 sw/qa/extras/rtftok/data/fdo50665.rtf delete mode 100644 sw/qa/extras/rtftok/data/n192129.rtf delete mode 100644 sw/qa/extras/rtftok/data/n695479.rtf delete mode 100644 sw/qa/extras/rtftok/data/n750757.rtf delete mode 100644 sw/qa/extras/rtftok/data/n751020.rtf delete mode 100644 sw/qa/extras/rtftok/data/n757651.rtf delete mode 100644 sw/qa/extras/rtftok/rtftok.cxx create mode 100644 sw/qa/extras/ww8import/data/n652364.doc create mode 100644 sw/qa/extras/ww8import/data/n750255.doc create mode 100644 sw/qa/extras/ww8import/data/n757118.doc create mode 100644 sw/qa/extras/ww8import/data/n757905.doc create mode 100644 sw/qa/extras/ww8import/data/n757910.doc create mode 100644 sw/qa/extras/ww8import/data/n760294.doc create mode 100644 sw/qa/extras/ww8import/ww8import.cxx delete mode 100644 sw/qa/extras/ww8tok/data/n652364.doc delete mode 100644 sw/qa/extras/ww8tok/data/n750255.doc delete mode 100644 sw/qa/extras/ww8tok/data/n757118.doc delete mode 100644 sw/qa/extras/ww8tok/data/n757905.doc delete mode 100644 sw/qa/extras/ww8tok/data/n757910.doc delete mode 100644 sw/qa/extras/ww8tok/data/n760294.doc delete mode 100644 sw/qa/extras/ww8tok/ww8tok.cxx (limited to 'sw') diff --git a/sw/CppunitTest_sw_subsequent_odfimport.mk b/sw/CppunitTest_sw_subsequent_odfimport.mk new file mode 100644 index 000000000000..006610e73964 --- /dev/null +++ b/sw/CppunitTest_sw_subsequent_odfimport.mk @@ -0,0 +1,97 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Miklos Vajna (SUSE, Inc.) +# Portions created by the Initial Developer are Copyright (C) 2012 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_odfimport)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_odfimport, \ + sw/qa/extras/odfimport/odfimport \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_odfimport, \ + cppu \ + cppuhelper \ + sal \ + sw \ + test \ + unotest \ + vcl \ + tl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_odfimport,\ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_subsequent_odfimport,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_subsequent_odfimport,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odfimport)) + +$(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfimport,\ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + fileaccess/source/fileacc \ + filter/source/config/cache/filterconfig1 \ + framework/util/fwk \ + i18npool/util/i18npool \ + package/util/package2 \ + package/source/xstor/xstor \ + sw/util/sw \ + sw/util/swd \ + sax/source/expatwrap/expwrap \ + sfx2/util/sfx \ + svl/source/fsstor/fsstorage \ + svtools/util/svt \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unotools/util/utl \ + unoxml/source/service/unoxml \ + xmlhelp/util/ucpchelp1 \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_odfimport)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_odfimport)) + +$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_odfimport,\ + $(OUTDIR)/unittest/registry \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_odftok.mk b/sw/CppunitTest_sw_subsequent_odftok.mk deleted file mode 100644 index d1e3ad7b518b..000000000000 --- a/sw/CppunitTest_sw_subsequent_odftok.mk +++ /dev/null @@ -1,97 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Initial Developer of the Original Code is -# Miklos Vajna (SUSE, Inc.) -# Portions created by the Initial Developer are Copyright (C) 2012 the -# Initial Developer. All Rights Reserved. -# -# Major Contributor(s): -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. -#************************************************************************* - -$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_odftok)) - -$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_odftok, \ - sw/qa/extras/odftok/odftok \ -)) - -$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_odftok, \ - cppu \ - cppuhelper \ - sal \ - sw \ - test \ - unotest \ - vcl \ - tl \ - $(gb_STDLIBS) \ -)) - -$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_odftok,\ - libxml2 \ -)) - -$(eval $(call gb_CppunitTest_set_include,sw_subsequent_odftok,\ - -I$(SRCDIR)/sw/inc \ - -I$(SRCDIR)/sw/source/core/inc \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_CppunitTest_use_api,sw_subsequent_odftok,\ - offapi \ - udkapi \ -)) - -$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odftok)) - -$(eval $(call gb_CppunitTest_use_components,sw_subsequent_odftok,\ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - fileaccess/source/fileacc \ - filter/source/config/cache/filterconfig1 \ - framework/util/fwk \ - i18npool/util/i18npool \ - package/util/package2 \ - package/source/xstor/xstor \ - sw/util/sw \ - sw/util/swd \ - sax/source/expatwrap/expwrap \ - sfx2/util/sfx \ - svl/source/fsstor/fsstorage \ - svtools/util/svt \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unotools/util/utl \ - unoxml/source/service/unoxml \ - xmlhelp/util/ucpchelp1 \ -)) - -$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_odftok)) - -$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_odftok)) - -$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_odftok,\ - $(OUTDIR)/unittest/registry \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_ooxmlimport.mk b/sw/CppunitTest_sw_subsequent_ooxmlimport.mk new file mode 100644 index 000000000000..8e5e3ef8c530 --- /dev/null +++ b/sw/CppunitTest_sw_subsequent_ooxmlimport.mk @@ -0,0 +1,99 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Miklos Vajna (SUSE, Inc.) +# Portions created by the Initial Developer are Copyright (C) 2012 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_ooxmlimport)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_ooxmlimport, \ + sw/qa/extras/ooxmlimport/ooxmlimport \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_ooxmlimport, \ + cppu \ + cppuhelper \ + sal \ + test \ + unotest \ + sw \ + vcl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_ooxmlimport,\ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_subsequent_ooxmlimport,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_subsequent_ooxmlimport,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ooxmlimport)) + +$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlimport,\ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + fileaccess/source/fileacc \ + filter/source/config/cache/filterconfig1 \ + framework/util/fwk \ + i18npool/util/i18npool \ + oox/util/oox \ + package/source/xstor/xstor \ + package/util/package2 \ + sax/source/expatwrap/expwrap \ + sax/source/fastparser/fastsax \ + sw/util/sw \ + sw/util/swd \ + sw/util/msword \ + sfx2/util/sfx \ + svl/source/fsstor/fsstorage \ + svtools/util/svt \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unotools/util/utl \ + unoxml/source/service/unoxml \ + writerfilter/util/writerfilter \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ooxmlimport)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_ooxmlimport)) + +$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_ooxmlimport,\ + $(OUTDIR)/unittest/registry \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_ooxmltok.mk b/sw/CppunitTest_sw_subsequent_ooxmltok.mk deleted file mode 100644 index a1683c10bceb..000000000000 --- a/sw/CppunitTest_sw_subsequent_ooxmltok.mk +++ /dev/null @@ -1,99 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Initial Developer of the Original Code is -# Miklos Vajna (SUSE, Inc.) -# Portions created by the Initial Developer are Copyright (C) 2012 the -# Initial Developer. All Rights Reserved. -# -# Major Contributor(s): -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. -#************************************************************************* - -$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_ooxmltok)) - -$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_ooxmltok, \ - sw/qa/extras/ooxmltok/ooxmltok \ -)) - -$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_ooxmltok, \ - cppu \ - cppuhelper \ - sal \ - test \ - unotest \ - sw \ - vcl \ - $(gb_STDLIBS) \ -)) - -$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_ooxmltok,\ - libxml2 \ -)) - -$(eval $(call gb_CppunitTest_set_include,sw_subsequent_ooxmltok,\ - -I$(SRCDIR)/sw/inc \ - -I$(SRCDIR)/sw/source/core/inc \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_CppunitTest_use_api,sw_subsequent_ooxmltok,\ - offapi \ - udkapi \ -)) - -$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ooxmltok)) - -$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmltok,\ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - fileaccess/source/fileacc \ - filter/source/config/cache/filterconfig1 \ - framework/util/fwk \ - i18npool/util/i18npool \ - oox/util/oox \ - package/source/xstor/xstor \ - package/util/package2 \ - sax/source/expatwrap/expwrap \ - sax/source/fastparser/fastsax \ - sw/util/sw \ - sw/util/swd \ - sw/util/msword \ - sfx2/util/sfx \ - svl/source/fsstor/fsstorage \ - svtools/util/svt \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unotools/util/utl \ - unoxml/source/service/unoxml \ - writerfilter/util/writerfilter \ -)) - -$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ooxmltok)) - -$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_ooxmltok)) - -$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_ooxmltok,\ - $(OUTDIR)/unittest/registry \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_rtfimport.mk b/sw/CppunitTest_sw_subsequent_rtfimport.mk new file mode 100644 index 000000000000..33b23036f0d7 --- /dev/null +++ b/sw/CppunitTest_sw_subsequent_rtfimport.mk @@ -0,0 +1,95 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Miklos Vajna (SUSE, Inc.) +# Portions created by the Initial Developer are Copyright (C) 2012 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_rtfimport)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_rtfimport, \ + sw/qa/extras/rtfimport/rtfimport \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_rtfimport, \ + cppu \ + cppuhelper \ + sal \ + sw \ + test \ + unotest \ + vcl \ + tl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_rtfimport,\ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_subsequent_rtfimport,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtfimport,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtfimport)) + +$(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfimport,\ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + fileaccess/source/fileacc \ + filter/source/config/cache/filterconfig1 \ + framework/util/fwk \ + i18npool/util/i18npool \ + package/util/package2 \ + sw/util/sw \ + sw/util/swd \ + sfx2/util/sfx \ + svl/source/fsstor/fsstorage \ + svtools/util/svt \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unotools/util/utl \ + unoxml/source/service/unoxml \ + writerfilter/util/writerfilter \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_rtfimport)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_rtfimport)) + +$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_rtfimport,\ + $(OUTDIR)/unittest/registry \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_rtftok.mk b/sw/CppunitTest_sw_subsequent_rtftok.mk deleted file mode 100644 index 15a685178e48..000000000000 --- a/sw/CppunitTest_sw_subsequent_rtftok.mk +++ /dev/null @@ -1,95 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Initial Developer of the Original Code is -# Miklos Vajna (SUSE, Inc.) -# Portions created by the Initial Developer are Copyright (C) 2012 the -# Initial Developer. All Rights Reserved. -# -# Major Contributor(s): -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. -#************************************************************************* - -$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_rtftok)) - -$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_rtftok, \ - sw/qa/extras/rtftok/rtftok \ -)) - -$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_rtftok, \ - cppu \ - cppuhelper \ - sal \ - sw \ - test \ - unotest \ - vcl \ - tl \ - $(gb_STDLIBS) \ -)) - -$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_rtftok,\ - libxml2 \ -)) - -$(eval $(call gb_CppunitTest_set_include,sw_subsequent_rtftok,\ - -I$(SRCDIR)/sw/inc \ - -I$(SRCDIR)/sw/source/core/inc \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtftok,\ - offapi \ - udkapi \ -)) - -$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtftok)) - -$(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtftok,\ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - fileaccess/source/fileacc \ - filter/source/config/cache/filterconfig1 \ - framework/util/fwk \ - i18npool/util/i18npool \ - package/util/package2 \ - sw/util/sw \ - sw/util/swd \ - sfx2/util/sfx \ - svl/source/fsstor/fsstorage \ - svtools/util/svt \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unotools/util/utl \ - unoxml/source/service/unoxml \ - writerfilter/util/writerfilter \ -)) - -$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_rtftok)) - -$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_rtftok)) - -$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_rtftok,\ - $(OUTDIR)/unittest/registry \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_ww8import.mk b/sw/CppunitTest_sw_subsequent_ww8import.mk new file mode 100644 index 000000000000..cb947e4d9833 --- /dev/null +++ b/sw/CppunitTest_sw_subsequent_ww8import.mk @@ -0,0 +1,96 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Miklos Vajna (SUSE, Inc.) +# Portions created by the Initial Developer are Copyright (C) 2012 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_ww8import)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_ww8import, \ + sw/qa/extras/ww8import/ww8import \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_ww8import, \ + cppu \ + cppuhelper \ + sal \ + test \ + unotest \ + sw \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_ww8import,\ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_subsequent_ww8import,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_subsequent_ww8import,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ww8import)) + +$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8import,\ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + dbaccess/util/dba \ + fileaccess/source/fileacc \ + filter/source/config/cache/filterconfig1 \ + forms/util/frm \ + framework/util/fwk \ + i18npool/util/i18npool \ + package/util/package2 \ + sw/util/msword \ + sw/util/sw \ + sw/util/swd \ + sfx2/util/sfx \ + svl/source/fsstor/fsstorage \ + svtools/util/svt \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unoxml/source/service/unoxml \ + $(if $(filter DESKTOP,$(BUILD_TYPE)), \ + xmlhelp/util/ucpchelp1) \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ww8import)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_ww8import)) + +$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_ww8import,\ + $(OUTDIR)/unittest/registry \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_ww8tok.mk b/sw/CppunitTest_sw_subsequent_ww8tok.mk deleted file mode 100644 index d95bfa60a51b..000000000000 --- a/sw/CppunitTest_sw_subsequent_ww8tok.mk +++ /dev/null @@ -1,96 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Initial Developer of the Original Code is -# Miklos Vajna (SUSE, Inc.) -# Portions created by the Initial Developer are Copyright (C) 2012 the -# Initial Developer. All Rights Reserved. -# -# Major Contributor(s): -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. -#************************************************************************* - -$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_ww8tok)) - -$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_ww8tok, \ - sw/qa/extras/ww8tok/ww8tok \ -)) - -$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_ww8tok, \ - cppu \ - cppuhelper \ - sal \ - test \ - unotest \ - sw \ - $(gb_STDLIBS) \ -)) - -$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_ww8tok,\ - libxml2 \ -)) - -$(eval $(call gb_CppunitTest_set_include,sw_subsequent_ww8tok,\ - -I$(SRCDIR)/sw/inc \ - -I$(SRCDIR)/sw/source/core/inc \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_CppunitTest_use_api,sw_subsequent_ww8tok,\ - offapi \ - udkapi \ -)) - -$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ww8tok)) - -$(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8tok,\ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - dbaccess/util/dba \ - fileaccess/source/fileacc \ - filter/source/config/cache/filterconfig1 \ - forms/util/frm \ - framework/util/fwk \ - i18npool/util/i18npool \ - package/util/package2 \ - sw/util/msword \ - sw/util/sw \ - sw/util/swd \ - sfx2/util/sfx \ - svl/source/fsstor/fsstorage \ - svtools/util/svt \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unoxml/source/service/unoxml \ - $(if $(filter DESKTOP,$(BUILD_TYPE)), \ - xmlhelp/util/ucpchelp1) \ -)) - -$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ww8tok)) - -$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_ww8tok)) - -$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_ww8tok,\ - $(OUTDIR)/unittest/registry \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 06cda0a4de3d..0f9d9c523722 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -55,12 +55,12 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_filters_test \ CppunitTest_sw_macros_test \ CppunitTest_sw_subsequent_ooxmlexport \ - CppunitTest_sw_subsequent_ooxmltok \ + CppunitTest_sw_subsequent_ooxmlimport \ CppunitTest_sw_subsequent_ww8export \ - CppunitTest_sw_subsequent_ww8tok \ + CppunitTest_sw_subsequent_ww8import \ CppunitTest_sw_subsequent_rtfexport \ - CppunitTest_sw_subsequent_rtftok \ - CppunitTest_sw_subsequent_odftok \ + CppunitTest_sw_subsequent_rtfimport \ + CppunitTest_sw_subsequent_odfimport \ )) $(eval $(call gb_Module_add_subsequentcheck_targets,sw,\ diff --git a/sw/qa/extras/odfimport/data/hello.odt b/sw/qa/extras/odfimport/data/hello.odt new file mode 100644 index 000000000000..23ce6a4db9af Binary files /dev/null and b/sw/qa/extras/odfimport/data/hello.odt differ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx new file mode 100644 index 000000000000..d4738932d8e2 --- /dev/null +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -0,0 +1,71 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna (SUSE, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2012 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../swmodeltestbase.hxx" + +using rtl::OUString; + +class Test : public SwModelTestBase +{ +public: + void testHello(); + void testEmptySvgFamilyName(); + + CPPUNIT_TEST_SUITE(Test); +#if !defined(MACOSX) && !defined(WNT) + CPPUNIT_TEST(testHello); + CPPUNIT_TEST(testEmptySvgFamilyName); +#endif + CPPUNIT_TEST_SUITE_END(); + +private: + /// Load an ODF file and make the document available via mxComponent. + void load(const OUString& rURL); +}; + +void Test::load(const OUString& rFilename) +{ + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odfimport/data/") + rFilename); +} + +void Test::testHello() +{ + load("hello.odt"); + CPPUNIT_ASSERT_EQUAL(12, getLength()); +} + +void Test::testEmptySvgFamilyName() +{ + // .odt import did crash on the empty font list (which I think is valid according SVG spec) + load( "empty-svg-family-name.odt" ); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/odftok/data/hello.odt b/sw/qa/extras/odftok/data/hello.odt deleted file mode 100644 index 23ce6a4db9af..000000000000 Binary files a/sw/qa/extras/odftok/data/hello.odt and /dev/null differ diff --git a/sw/qa/extras/odftok/odftok.cxx b/sw/qa/extras/odftok/odftok.cxx deleted file mode 100644 index bb62a18c8808..000000000000 --- a/sw/qa/extras/odftok/odftok.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Initial Developer of the Original Code is - * Miklos Vajna (SUSE, Inc.) - * Portions created by the Initial Developer are Copyright (C) 2012 the - * Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include "../swmodeltestbase.hxx" - -using rtl::OUString; - -class Test : public SwModelTestBase -{ -public: - void testHello(); - void testEmptySvgFamilyName(); - - CPPUNIT_TEST_SUITE(Test); -#if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testHello); - CPPUNIT_TEST(testEmptySvgFamilyName); -#endif - CPPUNIT_TEST_SUITE_END(); - -private: - /// Load an ODF file and make the document available via mxComponent. - void load(const OUString& rURL); -}; - -void Test::load(const OUString& rFilename) -{ - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odftok/data/") + rFilename); -} - -void Test::testHello() -{ - load("hello.odt"); - CPPUNIT_ASSERT_EQUAL(12, getLength()); -} - -void Test::testEmptySvgFamilyName() -{ - // .odt import did crash on the empty font list (which I think is valid according SVG spec) - load( "empty-svg-family-name.odt" ); -} - -CPPUNIT_TEST_SUITE_REGISTRATION(Test); - -CPPUNIT_PLUGIN_IMPLEMENT(); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlimport/data/fdo49940.docx b/sw/qa/extras/ooxmlimport/data/fdo49940.docx new file mode 100644 index 000000000000..242284463632 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo49940.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n652364.docx b/sw/qa/extras/ooxmlimport/data/n652364.docx new file mode 100644 index 000000000000..0845509e84b7 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n652364.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n693238.docx b/sw/qa/extras/ooxmlimport/data/n693238.docx new file mode 100644 index 000000000000..5bcda0fff6f7 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n693238.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n705956-1.docx b/sw/qa/extras/ooxmlimport/data/n705956-1.docx new file mode 100644 index 000000000000..edff3bac412c Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n705956-1.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n705956-2.docx b/sw/qa/extras/ooxmlimport/data/n705956-2.docx new file mode 100644 index 000000000000..138818523a92 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n705956-2.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n747461.docx b/sw/qa/extras/ooxmlimport/data/n747461.docx new file mode 100644 index 000000000000..1064e5db060b Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n747461.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n750255.docx b/sw/qa/extras/ooxmlimport/data/n750255.docx new file mode 100644 index 000000000000..a0c7370022b0 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n750255.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n750935.docx b/sw/qa/extras/ooxmlimport/data/n750935.docx new file mode 100644 index 000000000000..0dd01592dd65 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n750935.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n751017.docx b/sw/qa/extras/ooxmlimport/data/n751017.docx new file mode 100644 index 000000000000..cdd81cf84ddb Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n751017.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n751054.docx b/sw/qa/extras/ooxmlimport/data/n751054.docx new file mode 100644 index 000000000000..49d7d6af9cc6 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n751054.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n751077.docx b/sw/qa/extras/ooxmlimport/data/n751077.docx new file mode 100644 index 000000000000..62304e17c277 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n751077.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n751117.docx b/sw/qa/extras/ooxmlimport/data/n751117.docx new file mode 100644 index 000000000000..17cc9c53d1cb Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n751117.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n757890.docx b/sw/qa/extras/ooxmlimport/data/n757890.docx new file mode 100644 index 000000000000..f70368a9423a Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n757890.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n758883.docx b/sw/qa/extras/ooxmlimport/data/n758883.docx new file mode 100644 index 000000000000..1562496e45bf Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n758883.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n760764.docx b/sw/qa/extras/ooxmlimport/data/n760764.docx new file mode 100644 index 000000000000..5e479e2bf31b Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n760764.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n764005.docx b/sw/qa/extras/ooxmlimport/data/n764005.docx new file mode 100644 index 000000000000..1c0dd9d077e9 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n764005.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n764745-alignment.docx b/sw/qa/extras/ooxmlimport/data/n764745-alignment.docx new file mode 100644 index 000000000000..d29e980e51ed Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n764745-alignment.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n766477.docx b/sw/qa/extras/ooxmlimport/data/n766477.docx new file mode 100644 index 000000000000..a144463b7111 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n766477.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n766481.docx b/sw/qa/extras/ooxmlimport/data/n766481.docx new file mode 100644 index 000000000000..e1521ec82f9c Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n766481.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/n766487.docx b/sw/qa/extras/ooxmlimport/data/n766487.docx new file mode 100644 index 000000000000..85eda0e7e381 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n766487.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/numbering1.docx b/sw/qa/extras/ooxmlimport/data/numbering1.docx new file mode 100644 index 000000000000..55b4af3e8584 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/numbering1.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/smartart.docx b/sw/qa/extras/ooxmlimport/data/smartart.docx new file mode 100644 index 000000000000..7a553f425188 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/smartart.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx new file mode 100644 index 000000000000..fab93b127c43 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -0,0 +1,743 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna (SUSE, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2012 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../swmodeltestbase.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) + +using rtl::OString; +using rtl::OUString; +using rtl::OUStringBuffer; + +class Test : public SwModelTestBase +{ +public: + void testN751054(); + void testN751117(); + void testN751017(); + void testN750935(); + void testN757890(); + void testFdo49940(); + void testN751077(); + void testN705956_1(); + void testN705956_2(); + void testN747461(); + void testN750255(); + void testN652364(); + void testN760764(); + void testN764005(); + void testSmartart(); + void testN764745(); + void testN766477(); + void testN758883(); + void testN766481(); + void testN766487(); + void testN693238(); + void testNumbering1(); + + CPPUNIT_TEST_SUITE(Test); +#if !defined(MACOSX) && !defined(WNT) + CPPUNIT_TEST(testN751054); + CPPUNIT_TEST(testN751117); + CPPUNIT_TEST(testN751017); + CPPUNIT_TEST(testN750935); + CPPUNIT_TEST(testN757890); + CPPUNIT_TEST(testFdo49940); + CPPUNIT_TEST(testN751077); + CPPUNIT_TEST(testN705956_1); + CPPUNIT_TEST(testN705956_2); + CPPUNIT_TEST(testN747461); + CPPUNIT_TEST(testN750255); + CPPUNIT_TEST(testN652364); + CPPUNIT_TEST(testN760764); + CPPUNIT_TEST(testN764005); + CPPUNIT_TEST(testSmartart); + CPPUNIT_TEST(testN764745); + CPPUNIT_TEST(testN766477); + CPPUNIT_TEST(testN758883); + CPPUNIT_TEST(testN766481); + CPPUNIT_TEST(testN766487); + CPPUNIT_TEST(testN693238); + CPPUNIT_TEST(testNumbering1); +#endif + CPPUNIT_TEST_SUITE_END(); + +private: + /// Load an OOXML file and make the document available via mxComponent. + void load(const OUString& rURL); +}; + +void Test::load(const OUString& rFilename) +{ + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ooxmlimport/data/") + rFilename); +} + +void Test::testN751054() +{ + load("n751054.docx"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + text::TextContentAnchorType eValue; + xPropertySet->getPropertyValue("AnchorType") >>= eValue; + CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); +} + +void Test::testN751117() +{ + load("n751117.docx"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + + // First shape: the end should be an arrow, should be rotated and should be flipped. + uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + OUString aValue; + xPropertySet->getPropertyValue("LineEndName") >>= aValue; + CPPUNIT_ASSERT(aValue.indexOf("Arrow") != -1); + + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("RotateAngle") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(90 * 100), nValue); + + uno::Reference xShape(xPropertySet, uno::UNO_QUERY); + awt::Size aActualSize(xShape->getSize()); + CPPUNIT_ASSERT(aActualSize.Width < 0); + + // The second shape should be a line + uno::Reference xServiceInfo(xDraws->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape")); +} + +void Test::testN751017() +{ + load("n751017.docx"); + uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xMasters(xTextFieldsSupplier->getTextFieldMasters()); + // Make sure we have a variable named foo. + CPPUNIT_ASSERT(xMasters->hasByName("com.sun.star.text.FieldMaster.SetExpression.foo")); + + uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference xFields(xFieldsAccess->createEnumeration()); + bool bFoundSet(false), bFoundGet(false); + while (xFields->hasMoreElements()) + { + uno::Reference xServiceInfo(xFields->nextElement(), uno::UNO_QUERY); + uno::Reference xPropertySet(xServiceInfo, uno::UNO_QUERY); + sal_Int16 nValue = 0; + OUString aValue; + if (xServiceInfo->supportsService("com.sun.star.text.TextField.SetExpression")) + { + bFoundSet = true; + uno::Reference xDependentTextField(xServiceInfo, uno::UNO_QUERY); + uno::Reference xMasterProps(xDependentTextField->getTextFieldMaster()); + + // First step: did we set foo to "bar"? + xMasterProps->getPropertyValue("Name") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("foo"), aValue); + xPropertySet->getPropertyValue("SubType") >>= nValue; + CPPUNIT_ASSERT_EQUAL(text::SetVariableType::STRING, nValue); + xPropertySet->getPropertyValue("Content") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("bar"), aValue); + } + else if (xServiceInfo->supportsService("com.sun.star.text.TextField.GetExpression")) + { + // Second step: check the value of foo. + bFoundGet = true; + xPropertySet->getPropertyValue("Content") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("foo"), aValue); + xPropertySet->getPropertyValue("SubType") >>= nValue; + CPPUNIT_ASSERT_EQUAL(text::SetVariableType::STRING, nValue); + xPropertySet->getPropertyValue("CurrentPresentation") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("bar"), aValue); + } + } + CPPUNIT_ASSERT(bFoundSet); + CPPUNIT_ASSERT(bFoundGet); +} + +void Test::testN750935() +{ + load("n750935.docx"); + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + // Some page break types were ignores, resulting in less pages. + CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor->getPage()); + + /* + * The problem was that the header and footer was not shared. + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.FooterIsShared + */ + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + sal_Bool bValue = false; + xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue; + CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue); + xPropertySet->getPropertyValue("FooterIsShared") >>= bValue; + CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue); +} + +void Test::testN757890() +{ + load("n757890.docx"); + + // The w:pStyle token affected the text outside the textbox. + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xPara->getPropertyValue("ParaStyleName") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), aValue); + + // This wan't centered + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + sal_Int16 nValue; + xFrame->getPropertyValue("HoriOrient") >>= nValue; + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue); +} + +void Test::testFdo49940() +{ + load("fdo49940.docx"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xPara->getPropertyValue("PageStyleName") >>= aValue; + CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aValue); +} + +void Test::testN751077() +{ + load( "n751077.docx" ); + +/* +enum = ThisComponent.Text.createEnumeration +enum.NextElement +para = enum.NextElement +xray para.String +xray para.PageStyleName +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + // go to 1st paragraph + (void) paraEnum->nextElement(); + // get the 2nd paragraph + uno::Reference paragraph(paraEnum->nextElement(), uno::UNO_QUERY); + // text of the paragraph + uno::Reference text(paragraph, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "TEXT1" ), text->getString()); + // we want to test the paragraph is on the first page (it was put onto another page without the fix), + // use a small trick and instead of checking the page layout, check the page style + uno::Reference paragraphProperties(paragraph, uno::UNO_QUERY); + OUString pageStyle; + paragraphProperties->getPropertyValue( "PageStyleName" ) >>= pageStyle; + CPPUNIT_ASSERT_EQUAL( OUString( "First Page" ), pageStyle ); +} + +void Test::testN705956_1() +{ + load( "n705956-1.docx" ); +/* +Get the first image in the document and check it's the one image in the document. +It should be also anchored inline (as character). +image = ThisComponent.DrawPage.getByIndex(0) +graphic = image.Graphic +xray graphic.Size +xray image.AnchorType +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference drawPage = drawPageSupplier->getDrawPage(); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), drawPage->getCount()); + uno::Reference image; + drawPage->getByIndex(0) >>= image; + uno::Reference imageProperties(image, uno::UNO_QUERY); + uno::Reference graphic; + imageProperties->getPropertyValue( "Graphic" ) >>= graphic; + uno::Reference bitmap(graphic, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( static_cast(120), bitmap->getSize().Width ); + CPPUNIT_ASSERT_EQUAL( static_cast(106), bitmap->getSize().Height ); + text::TextContentAnchorType anchorType; + imageProperties->getPropertyValue( "AnchorType" ) >>= anchorType; + CPPUNIT_ASSERT_EQUAL( text::TextContentAnchorType_AS_CHARACTER, anchorType ); +} + +void Test::testN705956_2() +{ + load( "n705956-2.docx" ); +/* + must be global, reachable even from inside another +image = ThisComponent.DrawPage.getByIndex(0) +xray image.FillColor +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference drawPage = drawPageSupplier->getDrawPage(); + uno::Reference image; + drawPage->getByIndex(0) >>= image; + uno::Reference imageProperties(image, uno::UNO_QUERY); + sal_Int32 fillColor; + imageProperties->getPropertyValue( "FillColor" ) >>= fillColor; + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor ); +} + +void Test::testN747461() +{ + load( "n747461.docx" ); +/* +The document contains 3 images (Red, Black, Green, in this order), with explicit +w:relativeHeight (300, 0, 225763766). Check that they are in the right ZOrder +after they are loaded. +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference drawPage = drawPageSupplier->getDrawPage(); + uno::Reference image1, image2, image3; + drawPage->getByIndex( 0 ) >>= image1; + drawPage->getByIndex( 1 ) >>= image2; + drawPage->getByIndex( 2 ) >>= image3; + sal_Int32 zOrder1, zOrder2, zOrder3; + OUString descr1, descr2, descr3; + uno::Reference imageProperties1(image1, uno::UNO_QUERY); + imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1; + imageProperties1->getPropertyValue( "Description" ) >>= descr1; + uno::Reference imageProperties2(image2, uno::UNO_QUERY); + imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2; + imageProperties2->getPropertyValue( "Description" ) >>= descr2; + uno::Reference imageProperties3(image3, uno::UNO_QUERY); + imageProperties3->getPropertyValue( "ZOrder" ) >>= zOrder3; + imageProperties3->getPropertyValue( "Description" ) >>= descr3; + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), zOrder1 ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), zOrder2 ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 2 ), zOrder3 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Black" ), descr1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 ); +} + +void Test::testN750255() +{ + load( "n750255.docx" ); + +/* +Column break without columns on the page is a page break, so check those paragraphs +are on page 2 (page style 'Converted1') and page 3 (page style 'Converted2') +enum = ThisComponent.Text.createEnumeration +enum.nextElement +para1 = enum.nextElement +xray para1.String +xray para1.PageStyleName +para2 = enum.nextElement +xray para2.String +xray para2.PageStyleName +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + // go to 1st paragraph + (void) paraEnum->nextElement(); + // get the 2nd and 3rd paragraph + uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference text1(paragraph1, uno::UNO_QUERY); + uno::Reference text2(paragraph2, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "one" ), text1->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "two" ), text2->getString()); + uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); + uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); + OUString pageStyle1, pageStyle2; + paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; + paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; + CPPUNIT_ASSERT_EQUAL( OUString( "Converted1" ), pageStyle1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Converted2" ), pageStyle2 ); + +} + +void Test::testN652364() +{ + load( "n652364.docx" ); + +/* +Related to 750255 above, column break with columns on the page however should be a column break. +enum = ThisComponent.Text.createEnumeration +enum.nextElement +para1 = enum.nextElement +xray para1.String +xray para1.PageStyleName +enum.nextElement +para2 = enum.nextElement +xray para2.String +xray para2.PageStyleName +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + // get the 2nd and 4th paragraph + (void) paraEnum->nextElement(); + uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); + (void) paraEnum->nextElement(); + uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference text1(paragraph1, uno::UNO_QUERY); + uno::Reference text2(paragraph2, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "text1" ), text1->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "text2" ), text2->getString()); + uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); + uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); + OUString pageStyle1, pageStyle2; + paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; + paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; + // "Standard" is the style for the first page (2nd is "Converted1"). + CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 ); +} + +void Test::testN760764() +{ + load("n760764.docx"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); + + // Access the second run, which is a textfield + xRunEnum->nextElement(); + uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); + float fValue; + xRun->getPropertyValue("CharHeight") >>= fValue; + // This used to be 11, as character properties were ignored. + CPPUNIT_ASSERT_EQUAL(8.f, fValue); +} + +void Test::testN764005() +{ + load("n764005.docx"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + + // The picture in the header wasn't absolutely positioned and wasn't in the background. + text::TextContentAnchorType eValue; + xPropertySet->getPropertyValue("AnchorType") >>= eValue; + CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); + sal_Bool bValue = sal_True; + xPropertySet->getPropertyValue("Opaque") >>= bValue; + CPPUNIT_ASSERT_EQUAL(sal_False, bValue); +} + +void Test::testSmartart() +{ + load("smartart.docx"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc + + uno::Reference xGroup(xDraws->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xGroup->getCount()); // 3 rectangles and an arrow in the group + + uno::Reference xPropertySet(xGroup->getByIndex(1), uno::UNO_QUERY); + sal_Int32 nValue(0); + xPropertySet->getPropertyValue("FillColor") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK + + uno::Reference xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text + + uno::Reference xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaAdjust") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_CENTER), nValue); // Paragraph properties are imported +} + +void Test::testN764745() +{ + load( "n764745-alignment.docx" ); +/* +shape = ThisComponent.DrawPage.getByIndex(0) +xray shape.AnchorType +xray shape.AnchorPosition.X +xray ThisComponent.StyleFamilies.PageStyles.Default.Width +*/ + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + // The paragraph is right-aligned and the picture does not explicitly specify position, + // so check it's anchored as character and in the right side of the document. + text::TextContentAnchorType anchorType; + xPropertySet->getPropertyValue("AnchorType") >>= anchorType; + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, anchorType); + awt::Point pos; + xPropertySet->getPropertyValue("AnchorPosition") >>= pos; + uno::Reference styleFamiliesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference styleFamilies = styleFamiliesSupplier->getStyleFamilies(); + uno::Reference pageStyles; + styleFamilies->getByName("PageStyles") >>= pageStyles; + uno::Reference defaultStyle; + pageStyles->getByName("Default") >>= defaultStyle; + uno::Reference styleProperties( defaultStyle, uno::UNO_QUERY ); + sal_Int32 width = 0; + styleProperties->getPropertyValue( "Width" ) >>= width; + CPPUNIT_ASSERT( pos.X > width / 2 ); +} + +void Test::testN766477() +{ + /* + * The problem was that the checkbox was not checked. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * xray oRun.Bookmark.Parameters.ElementNames(0) 'Checkbox_Checked + */ + load("n766477.docx"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); + uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xFormField(xRun->getPropertyValue("Bookmark"), uno::UNO_QUERY); + uno::Reference xParameters(xFormField->getParameters()); + uno::Sequence aElementNames(xParameters->getElementNames()); + CPPUNIT_ASSERT_EQUAL(OUString("Checkbox_Checked"), aElementNames[0]); +} + +void Test::testN758883() +{ + load("n758883.docx"); + + /* + * The problem was that direct formatting of the paragraph was not applied + * to the numbering. This is easier to test using a layout dump. + */ + OUString aHeight = parseDump("/root/page/body/txt/Special", "nHeight"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(220), aHeight.toInt32()); // It was 280 + + /* + * Next problem was that the page margin contained the width of the page border as well. + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin + */ + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("LeftMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(794), nValue); + + // No assert for the 3rd problem: see the comment in the test doc. + + /* + * 4th problem: Wrap type of the textwrape was not 'through'. + * + * xray ThisComponent.DrawPage(0).Surround ' was 2, should be 1 + */ + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + xPropertySet.set(xDraws->getByIndex(0), uno::UNO_QUERY); + text::WrapTextMode eValue; + xPropertySet->getPropertyValue("Surround") >>= eValue; + CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_THROUGHT); + + /* + * 5th problem: anchor type of the second textbox was wrong. + * + * xray ThisComponent.DrawPage(1).AnchorType ' was 1, should be 4 + */ + xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY); + text::TextContentAnchorType eAnchorType; + xPropertySet->getPropertyValue("AnchorType") >>= eAnchorType; + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType); + + // 6th problem: xray ThisComponent.DrawPage(2).AnchorType ' was 2, should be 4 + xPropertySet.set(xDraws->getByIndex(2), uno::UNO_QUERY); + xPropertySet->getPropertyValue("AnchorType") >>= eAnchorType; + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType); +} + +void Test::testN766481() +{ + /* + * The problem was that we had an additional paragraph before the pagebreak. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oPara = oParas.nextElement + * xray oParas.hasMoreElements ' should be false + */ + load("n766481.docx"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + for (int i = 0; i < 2; ++i) + xParaEnum->nextElement(); + CPPUNIT_ASSERT_EQUAL(sal_False, xParaEnum->hasMoreElements()); +} + +void Test::testN766487() +{ + /* + * The problem was that 1) the font size of the first para was too large 2) numbering had no first-line-indent. + * + * oParas = ThisComponent.Text.createEnumeration + * oPara = oParas.nextElement + * oRuns = oPara.createEnumeration + * oRun = oRuns.nextElement + * xray oRun.CharHeight ' 12, was larger + * oPara = oParas.nextElement + * xray oPara.ParaFirstLineIndent ' -635, was 0 + */ + load("n766487.docx"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); + uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + float fValue = 0; + xPropertySet->getPropertyValue("CharHeight") >>= fValue; + CPPUNIT_ASSERT_EQUAL(12.f, fValue); + + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-360)), nValue); +} + +void Test::testN693238() +{ + /* + * + * The problem was that a continous section break at the end of the doc caused the margins to be ignored. + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin ' was 2000, should be 635 + */ + load("n693238.docx"); + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("LeftMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nValue); +} + +void Test::testNumbering1() +{ + load( "numbering1.docx" ); +/* in the paragraph itself was overriden by introduced by the paragraph's +enum = ThisComponent.Text.createEnumeration +para = enum.NextElement +xray para.NumberingStyleName +numberingstyle = ThisComponent.NumberingRules.getByIndex(6) +xray numberingstyle.name - should match name above +numbering = numberingstyle.getByIndex(0) +xray numbering(11) - should be 4, arabic +note that the indexes may get off as the implementation evolves, C++ code seaches in loops +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + uno::Reference paragraph(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference text(paragraph, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "Text1." ), text->getString()); + uno::Reference xPropertySet( paragraph, uno::UNO_QUERY ); + OUString numberingStyleName; + xPropertySet->getPropertyValue( "NumberingStyleName" ) >>= numberingStyleName; + uno::Reference xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference numberingRules(xNumberingRulesSupplier->getNumberingRules(), uno::UNO_QUERY); + uno::Reference numberingRule; + for( int i = 0; + i < numberingRules->getCount(); + ++i ) + { + xPropertySet.set( numberingRules->getByIndex( i ), uno::UNO_QUERY ); + OUString name; + xPropertySet->getPropertyValue( "Name" ) >>= name; + if( name == numberingStyleName ) + { + numberingRule.set( numberingRules->getByIndex( i ), uno::UNO_QUERY ); + break; + } + } + CPPUNIT_ASSERT( numberingRule.is()); + uno::Sequence< beans::PropertyValue > numbering; + numberingRule->getByIndex( 0 ) >>= numbering; + sal_Int16 numberingType = style::NumberingType::NUMBER_NONE; + for( int i = 0; + i < numbering.getLength(); + ++i ) + { + if( numbering[ i ].Name == "NumberingType" ) + { + numbering[ i ].Value >>= numberingType; + break; + } + } + CPPUNIT_ASSERT_EQUAL( style::NumberingType::ARABIC, numberingType ); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmltok/data/fdo49940.docx b/sw/qa/extras/ooxmltok/data/fdo49940.docx deleted file mode 100644 index 242284463632..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/fdo49940.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n652364.docx b/sw/qa/extras/ooxmltok/data/n652364.docx deleted file mode 100644 index 0845509e84b7..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n652364.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n693238.docx b/sw/qa/extras/ooxmltok/data/n693238.docx deleted file mode 100644 index 5bcda0fff6f7..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n693238.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n705956-1.docx b/sw/qa/extras/ooxmltok/data/n705956-1.docx deleted file mode 100644 index edff3bac412c..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n705956-1.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n705956-2.docx b/sw/qa/extras/ooxmltok/data/n705956-2.docx deleted file mode 100644 index 138818523a92..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n705956-2.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n747461.docx b/sw/qa/extras/ooxmltok/data/n747461.docx deleted file mode 100644 index 1064e5db060b..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n747461.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n750255.docx b/sw/qa/extras/ooxmltok/data/n750255.docx deleted file mode 100644 index a0c7370022b0..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n750255.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n750935.docx b/sw/qa/extras/ooxmltok/data/n750935.docx deleted file mode 100644 index 0dd01592dd65..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n750935.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n751017.docx b/sw/qa/extras/ooxmltok/data/n751017.docx deleted file mode 100644 index cdd81cf84ddb..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n751017.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n751054.docx b/sw/qa/extras/ooxmltok/data/n751054.docx deleted file mode 100644 index 49d7d6af9cc6..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n751054.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n751077.docx b/sw/qa/extras/ooxmltok/data/n751077.docx deleted file mode 100644 index 62304e17c277..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n751077.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n751117.docx b/sw/qa/extras/ooxmltok/data/n751117.docx deleted file mode 100644 index 17cc9c53d1cb..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n751117.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n757890.docx b/sw/qa/extras/ooxmltok/data/n757890.docx deleted file mode 100644 index f70368a9423a..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n757890.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n758883.docx b/sw/qa/extras/ooxmltok/data/n758883.docx deleted file mode 100644 index 1562496e45bf..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n758883.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n760764.docx b/sw/qa/extras/ooxmltok/data/n760764.docx deleted file mode 100644 index 5e479e2bf31b..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n760764.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n764005.docx b/sw/qa/extras/ooxmltok/data/n764005.docx deleted file mode 100644 index 1c0dd9d077e9..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n764005.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n764745-alignment.docx b/sw/qa/extras/ooxmltok/data/n764745-alignment.docx deleted file mode 100644 index d29e980e51ed..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n764745-alignment.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n766477.docx b/sw/qa/extras/ooxmltok/data/n766477.docx deleted file mode 100644 index a144463b7111..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n766477.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n766481.docx b/sw/qa/extras/ooxmltok/data/n766481.docx deleted file mode 100644 index e1521ec82f9c..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n766481.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/n766487.docx b/sw/qa/extras/ooxmltok/data/n766487.docx deleted file mode 100644 index 85eda0e7e381..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/n766487.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/numbering1.docx b/sw/qa/extras/ooxmltok/data/numbering1.docx deleted file mode 100644 index 55b4af3e8584..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/numbering1.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/data/smartart.docx b/sw/qa/extras/ooxmltok/data/smartart.docx deleted file mode 100644 index 7a553f425188..000000000000 Binary files a/sw/qa/extras/ooxmltok/data/smartart.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx deleted file mode 100644 index 28f8dfb483a6..000000000000 --- a/sw/qa/extras/ooxmltok/ooxmltok.cxx +++ /dev/null @@ -1,743 +0,0 @@ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Initial Developer of the Original Code is - * Miklos Vajna (SUSE, Inc.) - * Portions created by the Initial Developer are Copyright (C) 2012 the - * Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include "../swmodeltestbase.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) - -using rtl::OString; -using rtl::OUString; -using rtl::OUStringBuffer; - -class Test : public SwModelTestBase -{ -public: - void testN751054(); - void testN751117(); - void testN751017(); - void testN750935(); - void testN757890(); - void testFdo49940(); - void testN751077(); - void testN705956_1(); - void testN705956_2(); - void testN747461(); - void testN750255(); - void testN652364(); - void testN760764(); - void testN764005(); - void testSmartart(); - void testN764745(); - void testN766477(); - void testN758883(); - void testN766481(); - void testN766487(); - void testN693238(); - void testNumbering1(); - - CPPUNIT_TEST_SUITE(Test); -#if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testN751054); - CPPUNIT_TEST(testN751117); - CPPUNIT_TEST(testN751017); - CPPUNIT_TEST(testN750935); - CPPUNIT_TEST(testN757890); - CPPUNIT_TEST(testFdo49940); - CPPUNIT_TEST(testN751077); - CPPUNIT_TEST(testN705956_1); - CPPUNIT_TEST(testN705956_2); - CPPUNIT_TEST(testN747461); - CPPUNIT_TEST(testN750255); - CPPUNIT_TEST(testN652364); - CPPUNIT_TEST(testN760764); - CPPUNIT_TEST(testN764005); - CPPUNIT_TEST(testSmartart); - CPPUNIT_TEST(testN764745); - CPPUNIT_TEST(testN766477); - CPPUNIT_TEST(testN758883); - CPPUNIT_TEST(testN766481); - CPPUNIT_TEST(testN766487); - CPPUNIT_TEST(testN693238); - CPPUNIT_TEST(testNumbering1); -#endif - CPPUNIT_TEST_SUITE_END(); - -private: - /// Load an OOXML file and make the document available via mxComponent. - void load(const OUString& rURL); -}; - -void Test::load(const OUString& rFilename) -{ - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ooxmltok/data/") + rFilename); -} - -void Test::testN751054() -{ - load("n751054.docx"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); - text::TextContentAnchorType eValue; - xPropertySet->getPropertyValue("AnchorType") >>= eValue; - CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); -} - -void Test::testN751117() -{ - load("n751117.docx"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - - // First shape: the end should be an arrow, should be rotated and should be flipped. - uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); - OUString aValue; - xPropertySet->getPropertyValue("LineEndName") >>= aValue; - CPPUNIT_ASSERT(aValue.indexOf("Arrow") != -1); - - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("RotateAngle") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(90 * 100), nValue); - - uno::Reference xShape(xPropertySet, uno::UNO_QUERY); - awt::Size aActualSize(xShape->getSize()); - CPPUNIT_ASSERT(aActualSize.Width < 0); - - // The second shape should be a line - uno::Reference xServiceInfo(xDraws->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape")); -} - -void Test::testN751017() -{ - load("n751017.docx"); - uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xMasters(xTextFieldsSupplier->getTextFieldMasters()); - // Make sure we have a variable named foo. - CPPUNIT_ASSERT(xMasters->hasByName("com.sun.star.text.FieldMaster.SetExpression.foo")); - - uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); - uno::Reference xFields(xFieldsAccess->createEnumeration()); - bool bFoundSet(false), bFoundGet(false); - while (xFields->hasMoreElements()) - { - uno::Reference xServiceInfo(xFields->nextElement(), uno::UNO_QUERY); - uno::Reference xPropertySet(xServiceInfo, uno::UNO_QUERY); - sal_Int16 nValue = 0; - OUString aValue; - if (xServiceInfo->supportsService("com.sun.star.text.TextField.SetExpression")) - { - bFoundSet = true; - uno::Reference xDependentTextField(xServiceInfo, uno::UNO_QUERY); - uno::Reference xMasterProps(xDependentTextField->getTextFieldMaster()); - - // First step: did we set foo to "bar"? - xMasterProps->getPropertyValue("Name") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("foo"), aValue); - xPropertySet->getPropertyValue("SubType") >>= nValue; - CPPUNIT_ASSERT_EQUAL(text::SetVariableType::STRING, nValue); - xPropertySet->getPropertyValue("Content") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("bar"), aValue); - } - else if (xServiceInfo->supportsService("com.sun.star.text.TextField.GetExpression")) - { - // Second step: check the value of foo. - bFoundGet = true; - xPropertySet->getPropertyValue("Content") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("foo"), aValue); - xPropertySet->getPropertyValue("SubType") >>= nValue; - CPPUNIT_ASSERT_EQUAL(text::SetVariableType::STRING, nValue); - xPropertySet->getPropertyValue("CurrentPresentation") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("bar"), aValue); - } - } - CPPUNIT_ASSERT(bFoundSet); - CPPUNIT_ASSERT(bFoundGet); -} - -void Test::testN750935() -{ - load("n750935.docx"); - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - // Some page break types were ignores, resulting in less pages. - CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor->getPage()); - - /* - * The problem was that the header and footer was not shared. - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.FooterIsShared - */ - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); - sal_Bool bValue = false; - xPropertySet->getPropertyValue("HeaderIsShared") >>= bValue; - CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue); - xPropertySet->getPropertyValue("FooterIsShared") >>= bValue; - CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue); -} - -void Test::testN757890() -{ - load("n757890.docx"); - - // The w:pStyle token affected the text outside the textbox. - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - OUString aValue; - xPara->getPropertyValue("ParaStyleName") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), aValue); - - // This wan't centered - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - sal_Int16 nValue; - xFrame->getPropertyValue("HoriOrient") >>= nValue; - CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue); -} - -void Test::testFdo49940() -{ - load("fdo49940.docx"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); - OUString aValue; - xPara->getPropertyValue("PageStyleName") >>= aValue; - CPPUNIT_ASSERT_EQUAL(OUString("First Page"), aValue); -} - -void Test::testN751077() -{ - load( "n751077.docx" ); - -/* -enum = ThisComponent.Text.createEnumeration -enum.NextElement -para = enum.NextElement -xray para.String -xray para.PageStyleName -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference paraEnum = paraEnumAccess->createEnumeration(); - // go to 1st paragraph - (void) paraEnum->nextElement(); - // get the 2nd paragraph - uno::Reference paragraph(paraEnum->nextElement(), uno::UNO_QUERY); - // text of the paragraph - uno::Reference text(paragraph, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "TEXT1" ), text->getString()); - // we want to test the paragraph is on the first page (it was put onto another page without the fix), - // use a small trick and instead of checking the page layout, check the page style - uno::Reference paragraphProperties(paragraph, uno::UNO_QUERY); - OUString pageStyle; - paragraphProperties->getPropertyValue( "PageStyleName" ) >>= pageStyle; - CPPUNIT_ASSERT_EQUAL( OUString( "First Page" ), pageStyle ); -} - -void Test::testN705956_1() -{ - load( "n705956-1.docx" ); -/* -Get the first image in the document and check it's the one image in the document. -It should be also anchored inline (as character). -image = ThisComponent.DrawPage.getByIndex(0) -graphic = image.Graphic -xray graphic.Size -xray image.AnchorType -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); - uno::Reference drawPage = drawPageSupplier->getDrawPage(); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), drawPage->getCount()); - uno::Reference image; - drawPage->getByIndex(0) >>= image; - uno::Reference imageProperties(image, uno::UNO_QUERY); - uno::Reference graphic; - imageProperties->getPropertyValue( "Graphic" ) >>= graphic; - uno::Reference bitmap(graphic, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( static_cast(120), bitmap->getSize().Width ); - CPPUNIT_ASSERT_EQUAL( static_cast(106), bitmap->getSize().Height ); - text::TextContentAnchorType anchorType; - imageProperties->getPropertyValue( "AnchorType" ) >>= anchorType; - CPPUNIT_ASSERT_EQUAL( text::TextContentAnchorType_AS_CHARACTER, anchorType ); -} - -void Test::testN705956_2() -{ - load( "n705956-2.docx" ); -/* - must be global, reachable even from inside another -image = ThisComponent.DrawPage.getByIndex(0) -xray image.FillColor -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); - uno::Reference drawPage = drawPageSupplier->getDrawPage(); - uno::Reference image; - drawPage->getByIndex(0) >>= image; - uno::Reference imageProperties(image, uno::UNO_QUERY); - sal_Int32 fillColor; - imageProperties->getPropertyValue( "FillColor" ) >>= fillColor; - CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor ); -} - -void Test::testN747461() -{ - load( "n747461.docx" ); -/* -The document contains 3 images (Red, Black, Green, in this order), with explicit -w:relativeHeight (300, 0, 225763766). Check that they are in the right ZOrder -after they are loaded. -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); - uno::Reference drawPage = drawPageSupplier->getDrawPage(); - uno::Reference image1, image2, image3; - drawPage->getByIndex( 0 ) >>= image1; - drawPage->getByIndex( 1 ) >>= image2; - drawPage->getByIndex( 2 ) >>= image3; - sal_Int32 zOrder1, zOrder2, zOrder3; - OUString descr1, descr2, descr3; - uno::Reference imageProperties1(image1, uno::UNO_QUERY); - imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1; - imageProperties1->getPropertyValue( "Description" ) >>= descr1; - uno::Reference imageProperties2(image2, uno::UNO_QUERY); - imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2; - imageProperties2->getPropertyValue( "Description" ) >>= descr2; - uno::Reference imageProperties3(image3, uno::UNO_QUERY); - imageProperties3->getPropertyValue( "ZOrder" ) >>= zOrder3; - imageProperties3->getPropertyValue( "Description" ) >>= descr3; - CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), zOrder1 ); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), zOrder2 ); - CPPUNIT_ASSERT_EQUAL( sal_Int32( 2 ), zOrder3 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Black" ), descr1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 ); -} - -void Test::testN750255() -{ - load( "n750255.docx" ); - -/* -Column break without columns on the page is a page break, so check those paragraphs -are on page 2 (page style 'Converted1') and page 3 (page style 'Converted2') -enum = ThisComponent.Text.createEnumeration -enum.nextElement -para1 = enum.nextElement -xray para1.String -xray para1.PageStyleName -para2 = enum.nextElement -xray para2.String -xray para2.PageStyleName -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference paraEnum = paraEnumAccess->createEnumeration(); - // go to 1st paragraph - (void) paraEnum->nextElement(); - // get the 2nd and 3rd paragraph - uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference text1(paragraph1, uno::UNO_QUERY); - uno::Reference text2(paragraph2, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "one" ), text1->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "two" ), text2->getString()); - uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); - uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); - OUString pageStyle1, pageStyle2; - paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; - paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; - CPPUNIT_ASSERT_EQUAL( OUString( "Converted1" ), pageStyle1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Converted2" ), pageStyle2 ); - -} - -void Test::testN652364() -{ - load( "n652364.docx" ); - -/* -Related to 750255 above, column break with columns on the page however should be a column break. -enum = ThisComponent.Text.createEnumeration -enum.nextElement -para1 = enum.nextElement -xray para1.String -xray para1.PageStyleName -enum.nextElement -para2 = enum.nextElement -xray para2.String -xray para2.PageStyleName -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference paraEnum = paraEnumAccess->createEnumeration(); - // get the 2nd and 4th paragraph - (void) paraEnum->nextElement(); - uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); - (void) paraEnum->nextElement(); - uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference text1(paragraph1, uno::UNO_QUERY); - uno::Reference text2(paragraph2, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "text1" ), text1->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "text2" ), text2->getString()); - uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); - uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); - OUString pageStyle1, pageStyle2; - paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; - paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; - // "Standard" is the style for the first page (2nd is "Converted1"). - CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 ); -} - -void Test::testN760764() -{ - load("n760764.docx"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); - - // Access the second run, which is a textfield - xRunEnum->nextElement(); - uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); - float fValue; - xRun->getPropertyValue("CharHeight") >>= fValue; - // This used to be 11, as character properties were ignored. - CPPUNIT_ASSERT_EQUAL(8.f, fValue); -} - -void Test::testN764005() -{ - load("n764005.docx"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); - - // The picture in the header wasn't absolutely positioned and wasn't in the background. - text::TextContentAnchorType eValue; - xPropertySet->getPropertyValue("AnchorType") >>= eValue; - CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER); - sal_Bool bValue = sal_True; - xPropertySet->getPropertyValue("Opaque") >>= bValue; - CPPUNIT_ASSERT_EQUAL(sal_False, bValue); -} - -void Test::testSmartart() -{ - load("smartart.docx"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc - - uno::Reference xGroup(xDraws->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xGroup->getCount()); // 3 rectangles and an arrow in the group - - uno::Reference xPropertySet(xGroup->getByIndex(1), uno::UNO_QUERY); - sal_Int32 nValue(0); - xPropertySet->getPropertyValue("FillColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK - - uno::Reference xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text - - uno::Reference xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - xPropertySet->getPropertyValue("ParaAdjust") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_CENTER), nValue); // Paragraph properties are imported -} - -void Test::testN764745() -{ - load( "n764745-alignment.docx" ); -/* -shape = ThisComponent.DrawPage.getByIndex(0) -xray shape.AnchorType -xray shape.AnchorPosition.X -xray ThisComponent.StyleFamilies.PageStyles.Default.Width -*/ - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); - // The paragraph is right-aligned and the picture does not explicitly specify position, - // so check it's anchored as character and in the right side of the document. - text::TextContentAnchorType anchorType; - xPropertySet->getPropertyValue("AnchorType") >>= anchorType; - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, anchorType); - awt::Point pos; - xPropertySet->getPropertyValue("AnchorPosition") >>= pos; - uno::Reference styleFamiliesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference styleFamilies = styleFamiliesSupplier->getStyleFamilies(); - uno::Reference pageStyles; - styleFamilies->getByName("PageStyles") >>= pageStyles; - uno::Reference defaultStyle; - pageStyles->getByName("Default") >>= defaultStyle; - uno::Reference styleProperties( defaultStyle, uno::UNO_QUERY ); - sal_Int32 width = 0; - styleProperties->getPropertyValue( "Width" ) >>= width; - CPPUNIT_ASSERT( pos.X > width / 2 ); -} - -void Test::testN766477() -{ - /* - * The problem was that the checkbox was not checked. - * - * oParas = ThisComponent.Text.createEnumeration - * oPara = oParas.nextElement - * oRuns = oPara.createEnumeration - * oRun = oRuns.nextElement - * xray oRun.Bookmark.Parameters.ElementNames(0) 'Checkbox_Checked - */ - load("n766477.docx"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); - uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xFormField(xRun->getPropertyValue("Bookmark"), uno::UNO_QUERY); - uno::Reference xParameters(xFormField->getParameters()); - uno::Sequence aElementNames(xParameters->getElementNames()); - CPPUNIT_ASSERT_EQUAL(OUString("Checkbox_Checked"), aElementNames[0]); -} - -void Test::testN758883() -{ - load("n758883.docx"); - - /* - * The problem was that direct formatting of the paragraph was not applied - * to the numbering. This is easier to test using a layout dump. - */ - OUString aHeight = parseDump("/root/page/body/txt/Special", "nHeight"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(220), aHeight.toInt32()); // It was 280 - - /* - * Next problem was that the page margin contained the width of the page border as well. - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin - */ - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("LeftMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(794), nValue); - - // No assert for the 3rd problem: see the comment in the test doc. - - /* - * 4th problem: Wrap type of the textwrape was not 'through'. - * - * xray ThisComponent.DrawPage(0).Surround ' was 2, should be 1 - */ - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - xPropertySet.set(xDraws->getByIndex(0), uno::UNO_QUERY); - text::WrapTextMode eValue; - xPropertySet->getPropertyValue("Surround") >>= eValue; - CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_THROUGHT); - - /* - * 5th problem: anchor type of the second textbox was wrong. - * - * xray ThisComponent.DrawPage(1).AnchorType ' was 1, should be 4 - */ - xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY); - text::TextContentAnchorType eAnchorType; - xPropertySet->getPropertyValue("AnchorType") >>= eAnchorType; - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType); - - // 6th problem: xray ThisComponent.DrawPage(2).AnchorType ' was 2, should be 4 - xPropertySet.set(xDraws->getByIndex(2), uno::UNO_QUERY); - xPropertySet->getPropertyValue("AnchorType") >>= eAnchorType; - CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType); -} - -void Test::testN766481() -{ - /* - * The problem was that we had an additional paragraph before the pagebreak. - * - * oParas = ThisComponent.Text.createEnumeration - * oPara = oParas.nextElement - * oPara = oParas.nextElement - * xray oParas.hasMoreElements ' should be false - */ - load("n766481.docx"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - for (int i = 0; i < 2; ++i) - xParaEnum->nextElement(); - CPPUNIT_ASSERT_EQUAL(sal_False, xParaEnum->hasMoreElements()); -} - -void Test::testN766487() -{ - /* - * The problem was that 1) the font size of the first para was too large 2) numbering had no first-line-indent. - * - * oParas = ThisComponent.Text.createEnumeration - * oPara = oParas.nextElement - * oRuns = oPara.createEnumeration - * oRun = oRuns.nextElement - * xray oRun.CharHeight ' 12, was larger - * oPara = oParas.nextElement - * xray oPara.ParaFirstLineIndent ' -635, was 0 - */ - load("n766487.docx"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - - uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); - uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); - float fValue = 0; - xPropertySet->getPropertyValue("CharHeight") >>= fValue; - CPPUNIT_ASSERT_EQUAL(12.f, fValue); - - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-360)), nValue); -} - -void Test::testN693238() -{ - /* - * - * The problem was that a continous section break at the end of the doc caused the margins to be ignored. - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin ' was 2000, should be 635 - */ - load("n693238.docx"); - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("LeftMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(635), nValue); -} - -void Test::testNumbering1() -{ - load( "numbering1.docx" ); -/* in the paragraph itself was overriden by introduced by the paragraph's -enum = ThisComponent.Text.createEnumeration -para = enum.NextElement -xray para.NumberingStyleName -numberingstyle = ThisComponent.NumberingRules.getByIndex(6) -xray numberingstyle.name - should match name above -numbering = numberingstyle.getByIndex(0) -xray numbering(11) - should be 4, arabic -note that the indexes may get off as the implementation evolves, C++ code seaches in loops -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference paraEnum = paraEnumAccess->createEnumeration(); - uno::Reference paragraph(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference text(paragraph, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "Text1." ), text->getString()); - uno::Reference xPropertySet( paragraph, uno::UNO_QUERY ); - OUString numberingStyleName; - xPropertySet->getPropertyValue( "NumberingStyleName" ) >>= numberingStyleName; - uno::Reference xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference numberingRules(xNumberingRulesSupplier->getNumberingRules(), uno::UNO_QUERY); - uno::Reference numberingRule; - for( int i = 0; - i < numberingRules->getCount(); - ++i ) - { - xPropertySet.set( numberingRules->getByIndex( i ), uno::UNO_QUERY ); - OUString name; - xPropertySet->getPropertyValue( "Name" ) >>= name; - if( name == numberingStyleName ) - { - numberingRule.set( numberingRules->getByIndex( i ), uno::UNO_QUERY ); - break; - } - } - CPPUNIT_ASSERT( numberingRule.is()); - uno::Sequence< beans::PropertyValue > numbering; - numberingRule->getByIndex( 0 ) >>= numbering; - sal_Int16 numberingType = style::NumberingType::NUMBER_NONE; - for( int i = 0; - i < numbering.getLength(); - ++i ) - { - if( numbering[ i ].Name == "NumberingType" ) - { - numbering[ i ].Value >>= numberingType; - break; - } - } - CPPUNIT_ASSERT_EQUAL( style::NumberingType::ARABIC, numberingType ); -} - -CPPUNIT_TEST_SUITE_REGISTRATION(Test); - -CPPUNIT_PLUGIN_IMPLEMENT(); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfimport/data/fdo38786.rtf b/sw/qa/extras/rtfimport/data/fdo38786.rtf new file mode 100644 index 000000000000..6397cee7a670 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo38786.rtf @@ -0,0 +1,2 @@ +{\rtf1\chpgn +\par} diff --git a/sw/qa/extras/rtfimport/data/fdo39053.rtf b/sw/qa/extras/rtfimport/data/fdo39053.rtf new file mode 100644 index 000000000000..71d26916fc99 Binary files /dev/null and b/sw/qa/extras/rtfimport/data/fdo39053.rtf differ diff --git a/sw/qa/extras/rtfimport/data/fdo42465.rtf b/sw/qa/extras/rtfimport/data/fdo42465.rtf new file mode 100644 index 000000000000..06c29d42022c --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo42465.rtf @@ -0,0 +1,4 @@ +{\rtf1 +{\langfe1038\dbch\af14\afs24\alang1025\rtlch \ltrch\loch\fs24\lang1038\loch\f7 +k\uc2 \u243\'c3\'b3d\uc1 } +\par } diff --git a/sw/qa/extras/rtfimport/data/fdo43965.rtf b/sw/qa/extras/rtfimport/data/fdo43965.rtf new file mode 100644 index 000000000000..968fe77e2782 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo43965.rtf @@ -0,0 +1,16 @@ +{\rtf1\ansi\ansicpg1252 +{\fonttbl \f0\froman\fcharset0 Times;\f1\fswiss\fcharset0 Helvetica;} +{\info{\subject Test file for LibreOffice 3.5}} +\margl1440\margr1440\margt1440\margb1440\deftab720\viewkind1\viewscale100 +\pard\pardeftab720\ql\qnatural +\f0\fs36 +{ +{\fs22\up8 2} +}\ +{\box\brdrs Box +}\ +Page feeds:\ + This is on the first page.\ +\page + This is on the second page.\ +} diff --git a/sw/qa/extras/rtfimport/data/fdo44176.rtf b/sw/qa/extras/rtfimport/data/fdo44176.rtf new file mode 100644 index 000000000000..c1754afced77 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo44176.rtf @@ -0,0 +1,10 @@ +{\rtf1 +{\header foo +\par } +\titlepg +First page has no header. +\par +\pagebb +Second page has a header. +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo44211.rtf b/sw/qa/extras/rtfimport/data/fdo44211.rtf new file mode 100644 index 000000000000..699ce73e280f --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo44211.rtf @@ -0,0 +1,4 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0 Helvetica;}} +\pard\f0\fs20\'e0\'e8\'e6 +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo45182.rtf b/sw/qa/extras/rtfimport/data/fdo45182.rtf new file mode 100644 index 000000000000..b076106162b7 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45182.rtf @@ -0,0 +1,11 @@ +{\rtf1\deff0 +{\fonttbl +{\f0\fcharset238 +Times New Roman;} +} +a\chftn +{\footnote +\ltrpar \pard\plain\'9eivnost\'ed +\par +} +} diff --git a/sw/qa/extras/rtfimport/data/fdo45187.rtf b/sw/qa/extras/rtfimport/data/fdo45187.rtf new file mode 100644 index 000000000000..61b71ade8082 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45187.rtf @@ -0,0 +1,32 @@ +{\rtf1 +{\field +{\*\fldinst SHAPE } +{\fldrslt +{\shp +{\*\shpinst\shpleft1000\shptop1000\shpright2000\shpbottom2000 +{\sp +{\sn shapeType} +{\sv 1} +} +} +} +} +} +first +\par +{\field +{\*\fldinst SHAPE } +{\fldrslt +{\shp +{\*\shpinst\shpleft1000\shptop3000\shpright2000\shpbottom4000 +{\sp +{\sn shapeType} +{\sv 3} +} +} +} +} +} +second +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo45190.rtf b/sw/qa/extras/rtfimport/data/fdo45190.rtf new file mode 100644 index 000000000000..613a283150f1 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45190.rtf @@ -0,0 +1,10 @@ +{\rtf1 +{\stylesheet +{\s1 \fi-100 style;} +} +\s1\li0 first +\par +\pard +\s1\fi-100\li0 second +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo45394.rtf b/sw/qa/extras/rtfimport/data/fdo45394.rtf new file mode 100644 index 000000000000..6d02f50602ce --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45394.rtf @@ -0,0 +1,19 @@ +{\rtf1 +{\fonttbl +{\f37\fswiss\fcharset204\fprq2 +Verdana;} +} +{\headerr +\f37 \'cf\'ca \'d0\'c8\'ca\par +} +\trowd \cellx4498\cellx9104 +\pard\plain\intbl +\cell \cell +\row +\trowd \cellx4498\cellx9104 +\pard\plain\intbl +c\cell d\cell +\row +\pard\plain +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo45543.rtf b/sw/qa/extras/rtfimport/data/fdo45543.rtf new file mode 100644 index 000000000000..43a8c892cff0 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45543.rtf @@ -0,0 +1,8 @@ +{\rtf1 +{\fonttbl +{\fdbminor\f31505\fbidi \froman\fcharset128\fprq1\'82\'6c\'82\'72 \'96\'be\'92\'a9;} +} +\pard\plain +\f31505 \'82\'b1\'82\'cc\'95\'b6\'8f\'91\'82\'cd +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo45553.rtf b/sw/qa/extras/rtfimport/data/fdo45553.rtf new file mode 100644 index 000000000000..38b9d36e64df --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45553.rtf @@ -0,0 +1,2 @@ +{\rtf1 \sa240 space-after\par\pard +\sb120 space-before\par} diff --git a/sw/qa/extras/rtfimport/data/fdo45563.rtf b/sw/qa/extras/rtfimport/data/fdo45563.rtf new file mode 100644 index 000000000000..3dd3fd0b9956 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo45563.rtf @@ -0,0 +1,5 @@ +{\rtf1 +only n\ +only r\ both r and n\ +last\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo46662.rtf b/sw/qa/extras/rtfimport/data/fdo46662.rtf new file mode 100644 index 000000000000..db93c9c1eadc --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo46662.rtf @@ -0,0 +1,46 @@ +{\rtf1 +{\*\listtable +{\list\listtemplateid3 +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'01\'00;} +{\levelnumbers\'01;} +\fi-360\li720\lin720 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'03\'00.\'01;} +{\levelnumbers\'01\'03;} +\fi-360\li1080\lin1080 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'05\'00.\'01.\'02;} +{\levelnumbers\'01\'03\'05;} +\fi-360\li1440\lin1440 +} +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'07\'00.\'01.\'02.\'03;} +{\levelnumbers\'01\'03\'05\'07;} +\fi-360\li1800\lin1800 } +\listid3} +} +{\*\listoverridetable +{\listoverride\listid3\listoverridecount0\ls3} +} +\pard\ls3 +{numbering with all sublevels: test 1 +\par +} +\pard\ls3\ilvl1 +{test 1.1 +\par +} +\pard\ls3\ilvl2 +{test 1.1.1 +\par +} +\pard\ls3\ilvl3 +{test 1.1.1.1 +\par +} +\pard\ls3 +{test 2 +\par +} +} diff --git a/sw/qa/extras/rtfimport/data/fdo46955.rtf b/sw/qa/extras/rtfimport/data/fdo46955.rtf new file mode 100644 index 000000000000..4e3ddda79935 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo46955.rtf @@ -0,0 +1 @@ +{\rtf1 \caps caps\par} diff --git a/sw/qa/extras/rtfimport/data/fdo46966.rtf b/sw/qa/extras/rtfimport/data/fdo46966.rtf new file mode 100644 index 000000000000..de0f7dff9c2f --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo46966.rtf @@ -0,0 +1,10 @@ +{\rtf1\ansi +{\fonttbl{\f0 Times New Roman;}} +{\stylesheet{\s0\snext0\f0\fs24 Normal;}} + +\margl720\margr1440\margt720\margb1440 +\sectd +\marglsxn720\margrsxn1440\margtsxn720\margbsxn1440 +{\header Header} +Text +\par } diff --git a/sw/qa/extras/rtfimport/data/fdo47036.rtf b/sw/qa/extras/rtfimport/data/fdo47036.rtf new file mode 100644 index 000000000000..cc988f1eac0d --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo47036.rtf @@ -0,0 +1,73 @@ +{\rtf1 +\paperw11904\paperh16836\margl864\margr288\margt360\margb360\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\donotembedsysfont0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120 +\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot15426039 \fet0 +\ilfomacatclnup0\ltrpar \sectd \ltrsect\sbknone\linex0\sectdefaultcl\sftnbj +\pard\plain \ltrpar\qc \li0\ri0\nowidctlpar +\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\tx9360\tx9720\pvpg\phpg\posx939 +\posy2714\absh-450\absw10080\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1775824 +{\shp +{\*\shpinst\shpleft1074\shptop528\shpright11487\shpbottom1945\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz3\shplid1029 +{\sp +{\sn shapeType} +{\sv 75} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn pib} +{\sv +{\pict\picscalex92\picscaley92\piccropl0\piccropr0\piccropt0\piccropb0 +\picw20032\pich2725\picwgoal11357\pichgoal1545\pngblip\bliptag-1891142031 +{\*\blipuid 8f477671d3377e167ce61bb2e9de72f7} +47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b +} +} +} +{\sp +{\sn posrelh} +{\sv 1} +} +{\sp +{\sn posrelv} +{\sv 1} +} +{\sp +{\sn fLayoutInCell} +{\sv 0} +} +{\sp +{\sn fBehindDocument} +{\sv 1} +} +{\sp +{\sn fLayoutInCell} +{\sv 0} +} +} +} +} +{\rtlch\fcs1 \ab\af1\afs33 \ltrch\fcs0 +\b\f1\fs33\cf1\insrsid15426039 Booking Advice} +{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid15426039 +\par } +\pard \pvpg\phpg\posx1914\posy4761\absh-2400\absw7674\wrapdefault +\faauto\rin0\lin0\itap0 +{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf1\insrsid15426039 foo \tab \tab \tab \tab \tab \tab } +{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid15426039 +\par } +{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf1\insrsid15426039 x\tab +\par +\par } +{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf6\insrsid16139741 y} +{\rtlch\fcs1 \af1 \ltrch\fcs0 +\f1\cf6\insrsid15426039\charrsid15426039 +\par } +} diff --git a/sw/qa/extras/rtfimport/data/fdo47107.rtf b/sw/qa/extras/rtfimport/data/fdo47107.rtf new file mode 100644 index 000000000000..74371cd57471 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo47107.rtf @@ -0,0 +1,21 @@ +{\rtf1 +{\fonttbl +{\f1 Symbol;} +} +\pard \fi-283\li283 +{\*\pn \pnlvlbody\pndec\pnstart1 +{\pntxta .} +} +{Alpha +\par +Beta +\par } +\pard \fi-283\li283 +{\*\pn \pnlvlblt\pnf1\pnstart1 +{\pntxtb \'b7} +} +{Alpha +\par +Beta +\par } +} diff --git a/sw/qa/extras/rtfimport/data/fdo47326.rtf b/sw/qa/extras/rtfimport/data/fdo47326.rtf new file mode 100644 index 000000000000..264e719127b7 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo47326.rtf @@ -0,0 +1,5 @@ +{\rtf1 +Windows\super\'ae\nosupersub XP: +\pard + Cartes:\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo47764.rtf b/sw/qa/extras/rtfimport/data/fdo47764.rtf new file mode 100644 index 000000000000..2a9d367b5aff --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo47764.rtf @@ -0,0 +1,4 @@ +{\rtf1 +\cbpat0\cf0 +bug +} diff --git a/sw/qa/extras/rtfimport/data/fdo48023.rtf b/sw/qa/extras/rtfimport/data/fdo48023.rtf new file mode 100644 index 000000000000..6d6a0d9b551e --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48023.rtf @@ -0,0 +1,8 @@ +{\rtf +{\fonttbl +{\f1 Arial;} +} +\pard +\f1 +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo48037.rtf b/sw/qa/extras/rtfimport/data/fdo48037.rtf new file mode 100644 index 000000000000..af7217e49428 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48037.rtf @@ -0,0 +1,13 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff0 +\pard\plain \lang1036 +{\f31 VINCENNES, LE } +{\field +{\*\fldinst +DATE \\@ "d MMMM yyyy" \\* MERGEFORMAT +} +{\fldrslt +xxx +} +} +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo48104.rtf b/sw/qa/extras/rtfimport/data/fdo48104.rtf new file mode 100644 index 000000000000..64d5e5979e4f --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48104.rtf @@ -0,0 +1,6 @@ +{\rtf1 +first page\par +\page +{second page first line\par} +second page second line\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo48193.rtf b/sw/qa/extras/rtfimport/data/fdo48193.rtf new file mode 100644 index 000000000000..ca585496eaf4 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48193.rtf @@ -0,0 +1,10 @@ +{\rtf1 +\pard\plain +foo +{\field +{\*\fldinst +{\f8\fs16\f8 PAGE } +} +} +bar +\par } diff --git a/sw/qa/extras/rtfimport/data/fdo48356.rtf b/sw/qa/extras/rtfimport/data/fdo48356.rtf new file mode 100644 index 000000000000..59d6cb021d5f --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48356.rtf @@ -0,0 +1,3 @@ +{\rtf1 +Ma\u269\'0dek +\par } diff --git a/sw/qa/extras/rtfimport/data/fdo48876.rtf b/sw/qa/extras/rtfimport/data/fdo48876.rtf new file mode 100644 index 000000000000..49a6eb0bf6a9 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48876.rtf @@ -0,0 +1,5 @@ +{\rtf +\sl54 +C +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo49271.rtf b/sw/qa/extras/rtfimport/data/fdo49271.rtf new file mode 100644 index 000000000000..4f3a48c6e9e8 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49271.rtf @@ -0,0 +1,3 @@ +{\rtf1 +\fs50 one \par \par two \par +} diff --git a/sw/qa/extras/rtfimport/data/fdo49501.rtf b/sw/qa/extras/rtfimport/data/fdo49501.rtf new file mode 100644 index 000000000000..47bd691b8e62 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49501.rtf @@ -0,0 +1,5 @@ +{\rtf +\landscape \paperw15309 \paperh11907 \margl567 \margr567 \margt567 \margb567 +Department +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo49659.rtf b/sw/qa/extras/rtfimport/data/fdo49659.rtf new file mode 100644 index 000000000000..c908826a1015 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49659.rtf @@ -0,0 +1,19 @@ +{\rtf1 +\sectd +{\header +{\trowd\cellx4000\cellx9500\pard\plain\intbl +{\pict{\pngblip\picwgoal2340\pichgoal1000\picscalex50\picscaley50\piccropl0\piccropr0\piccropt0\piccropb0}89504e470d0a1a0a0000000d49484452000000750000003201000000004a22a9c50000009249444154789c63fccf800c7e3231a00216065dd33fc10f155b2c52 +5905fdf303d1e547f9a37c6af219d1d2230b03c3df94f4d058bfeb9785e63c6060606260f87be4b4ee8ad3559ff90da0fa2518db2412db1812a0e631ff3539ef +f08581e10b030303030b030333c399957baf21ecfbf5eb3fafc3110686170c0c0c0c0cffffff293ec6a1c0c420785efeffff1fe8f60300fbbc2d919818ba7900 +00000049454e44ae426082} +header1 +\cell\pard\plain\intbl +header2 +\cell\row} +} +{\trowd\cellx4000\cellx9500\pard\plain\intbl +body1 +\cell\pard\plain\intbl +body2 +\cell\row} +} diff --git a/sw/qa/extras/rtfimport/data/fdo49692.rtf b/sw/qa/extras/rtfimport/data/fdo49692.rtf new file mode 100644 index 000000000000..bcd7004e627d --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49692.rtf @@ -0,0 +1,17 @@ +{\rtf1 +{\*\listtable +{\list\listtemplateid1 +{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0 +{\leveltext \'00;} +{\levelnumbers;} +\fi0\li0} +\listid1} +} +{\listoverridetable +{\listoverride\listid1\listoverridecount0\ls1} +} +\ilvl0 +\ls1 +EULA +\par +} diff --git a/sw/qa/extras/rtfimport/data/fdo50539.rtf b/sw/qa/extras/rtfimport/data/fdo50539.rtf new file mode 100644 index 000000000000..c8a13012f0b0 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo50539.rtf @@ -0,0 +1,4 @@ +{\rtf1 +\chcbpat0\cf0 +bug +} diff --git a/sw/qa/extras/rtfimport/data/fdo50665.rtf b/sw/qa/extras/rtfimport/data/fdo50665.rtf new file mode 100644 index 000000000000..2536eb0df66e --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo50665.rtf @@ -0,0 +1,16 @@ +{\rtf1\ansi\deff6 +{\fonttbl +{\f1\fnil\fprq0\fcharset0 Times New Roman;} +{\f4\fmodern\fprq1\fcharset0 Cumberland +{\*\falt Courier New} +;} +{\f6\froman\fprq2\fcharset1 Book Antiqua +{\*\falt Times New Roman} +;} +} +\sectd\sbknone\pgwsxn11909\pghsxn16834\marglsxn1080\margrsxn1080\margtsxn2437\margbsxn1080\headery1080 +\pard\plain \s7\cf0\tqr\tx9990\tqr\tx9900 +{\loch\f6\fs24\lang1033\i0\b +Page : \chpgn\par +} +} diff --git a/sw/qa/extras/rtfimport/data/n192129.rtf b/sw/qa/extras/rtfimport/data/n192129.rtf new file mode 100644 index 000000000000..1451b367823a --- /dev/null +++ b/sw/qa/extras/rtfimport/data/n192129.rtf @@ -0,0 +1,3 @@ +{\rtf1 +{\pict \pngblip \picw-64 \pich-1061137057 \picwgoal0 \pichgoal0 47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b} +\par } diff --git a/sw/qa/extras/rtfimport/data/n695479.rtf b/sw/qa/extras/rtfimport/data/n695479.rtf new file mode 100644 index 000000000000..5fe7e4519c91 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/n695479.rtf @@ -0,0 +1,14 @@ +{\rtf1 +\paperw12240\paperh15840\margl360\margr360\margt360\margb302\gutter0\ltrsect +\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\pvpg\posx116\posy2167\absh-300\absw5134\overlay\faauto\rin0\lin0\itap0 +\brdrb\brdrdb\brdrw15\brsp20 +\rtlch\fcs1 \af0\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1038\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp1038 +{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\cf1\lang1038\langfe1038\langnp1038\insrsid10974703 +\hich\af0\dbch\af31505\loch\f0 first +\par } +\pard \ltrpar\ql \li0\ri0\nowidctlpar\pvpg\posx5562\posy5417\absh-226\absw5946\overlay\faauto\rin0\lin0\itap0\pararsid15926738 +{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \cf1\lang1038\langfe1038\langnp1038\insrsid10974703 +second\par } +{\*\do\dobxmargin\dobypage\dodhgt0\dpline\dpx81\dpy4923\dpxsize11438\dpysize1\dplinecor0\dplinecog0\dplinecob0} +\pard plain\par +} diff --git a/sw/qa/extras/rtfimport/data/n750757.rtf b/sw/qa/extras/rtfimport/data/n750757.rtf new file mode 100644 index 000000000000..04d78b615a62 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/n750757.rtf @@ -0,0 +1,45 @@ +{\rtf1 +{\stylesheet +{\s15\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 +\sbasedon0 \snext15 \sqformat \spriority34 \styrsid13858768 List Paragraph;} +} +{\*\listtable +{\list\listtemplateid188802200\listhybrid +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\leveltemplateid68026383 +\'02\'00.;} +{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li720\lin720 } +{\listname ;} +\listid983924569} +} +{\*\listoverridetable +{\listoverride\listid983924569\listoverridecount0\ls4} +} +\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 before +\par +{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 \hich\af31506\dbch\af31506\loch\f31506 1.\tab} +} +\pard\plain \ltrpar +\s15\ql \fi-360\li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid13858768\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num} +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 1 +\par +{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 \hich\af31506\dbch\af31506\loch\f31506 2.\tab} +} +{\rtlch\fcs1 \af31507 \ltrch\fcs0 +\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num} +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 2 +\par +{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\insrsid420015 \hich\af31506\dbch\af31506\loch\f31506 3.\tab} +} +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid420015 num 3 +\par } +\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 +{ +\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 after +\par } +} diff --git a/sw/qa/extras/rtfimport/data/n751020.rtf b/sw/qa/extras/rtfimport/data/n751020.rtf new file mode 100644 index 000000000000..66175cf8b901 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/n751020.rtf @@ -0,0 +1,8 @@ +{\rtf1 +{\stylesheet +{Normal;} +} +\linkstyles +first\par +second\par +} diff --git a/sw/qa/extras/rtfimport/data/n757651.rtf b/sw/qa/extras/rtfimport/data/n757651.rtf new file mode 100644 index 000000000000..dfd49a8cda4b --- /dev/null +++ b/sw/qa/extras/rtfimport/data/n757651.rtf @@ -0,0 +1,18 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl +{\f0\froman\fprq2\fcharset0 Times New Roman;} +} +\sectd\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1260\margbsxn432 +\pard\plain\f0\fs24\sl480\slmult1 +________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par +\pard\plain\f0\fs24\sl480\slmult1 +________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par +\pard\plain\f0\fs24\sl480\slmult1 +________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par +\pard\plain\f0\fs24\sl480\slmult1 +________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par +\pard\plain\f0\fs24\sl480\slmult1 +________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par +\pard\plain\f0\fs24\sl480\slmult1 +________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx new file mode 100644 index 000000000000..cb5a584503e0 --- /dev/null +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -0,0 +1,818 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna (SUSE, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2012 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../swmodeltestbase.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) + +using rtl::OString; +using rtl::OUString; +using rtl::OUStringBuffer; + +class Test : public SwModelTestBase +{ +public: + void testFdo45553(); + void testN192129(); + void testFdo45543(); + void testN695479(); + void testFdo42465(); + void testFdo45187(); + void testFdo46662(); + void testN750757(); + void testFdo45563(); + void testFdo43965(); + void testN751020(); + void testFdo47326(); + void testFdo47036(); + void testFdo46955(); + void testFdo45394(); + void testFdo48104(); + void testFdo47107(); + void testFdo45182(); + void testFdo44176(); + void testFdo39053(); + void testFdo48356(); + void testFdo48023(); + void testFdo48876(); + void testFdo48193(); + void testFdo44211(); + void testFdo48037(); + void testFdo47764(); + void testFdo38786(); + void testN757651(); + void testFdo49501(); + void testFdo49271(); + void testFdo49692(); + void testFdo45190(); + void testFdo50539(); + void testFdo50665(); + void testFdo49659(); + void testFdo46966(); + + CPPUNIT_TEST_SUITE(Test); +#if !defined(MACOSX) && !defined(WNT) + CPPUNIT_TEST(testFdo45553); + CPPUNIT_TEST(testN192129); + CPPUNIT_TEST(testFdo45543); + CPPUNIT_TEST(testN695479); + CPPUNIT_TEST(testFdo42465); + CPPUNIT_TEST(testFdo45187); + CPPUNIT_TEST(testFdo46662); + CPPUNIT_TEST(testN750757); + CPPUNIT_TEST(testFdo45563); + CPPUNIT_TEST(testFdo43965); + CPPUNIT_TEST(testN751020); + CPPUNIT_TEST(testFdo47326); + CPPUNIT_TEST(testFdo47036); + CPPUNIT_TEST(testFdo46955); + CPPUNIT_TEST(testFdo45394); + CPPUNIT_TEST(testFdo48104); + CPPUNIT_TEST(testFdo47107); + CPPUNIT_TEST(testFdo45182); + CPPUNIT_TEST(testFdo44176); + CPPUNIT_TEST(testFdo39053); + CPPUNIT_TEST(testFdo48356); + CPPUNIT_TEST(testFdo48023); + CPPUNIT_TEST(testFdo48876); + CPPUNIT_TEST(testFdo48193); + CPPUNIT_TEST(testFdo44211); + CPPUNIT_TEST(testFdo48037); + CPPUNIT_TEST(testFdo47764); + CPPUNIT_TEST(testFdo38786); + CPPUNIT_TEST(testN757651); + CPPUNIT_TEST(testFdo49501); + CPPUNIT_TEST(testFdo49271); + CPPUNIT_TEST(testFdo49692); + CPPUNIT_TEST(testFdo45190); + CPPUNIT_TEST(testFdo50539); + CPPUNIT_TEST(testFdo50665); + CPPUNIT_TEST(testFdo49659); + CPPUNIT_TEST(testFdo46966); +#endif + CPPUNIT_TEST_SUITE_END(); + +private: + /// Load an RTF file and make the document available via mxComponent. + void load(const OUString& rURL); + /// Get page count. + int getPages(); +}; + +void Test::load(const OUString& rFilename) +{ + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + rFilename); +} + +int Test::getPages() +{ + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + return xCursor->getPage(); +} + +void Test::testFdo45553() +{ + load("fdo45553.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + while (xParaEnum->hasMoreElements()) + { + uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); + while (xRangeEnum->hasMoreElements()) + { + uno::Reference xRange(xRangeEnum->nextElement(), uno::UNO_QUERY); + OUString aStr = xRange->getString(); + if ( aStr == "space-before" ) + { + sal_Int32 nMargin = 0; + uno::Reference xPropertySet(xRange, uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaTopMargin") >>= nMargin; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(120)), nMargin); + } + else if ( aStr == "space-after" ) + { + sal_Int32 nMargin = 0; + uno::Reference xPropertySet(xRange, uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaBottomMargin") >>= nMargin; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(240)), nMargin); + } + } + } +} + +void Test::testN192129() +{ + load("n192129.rtf"); + + // We expect that the result will be 16x16px. + Size aExpectedSize(16, 16); + MapMode aMap(MAP_100TH_MM); + aExpectedSize = Application::GetDefaultDevice()->PixelToLogic( aExpectedSize, aMap ); + + uno::Reference xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY); + uno::Reference xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + awt::Size aActualSize(xShape->getSize()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height); +} + +void Test::testFdo45543() +{ + load("fdo45543.rtf"); + CPPUNIT_ASSERT_EQUAL(5, getLength()); +} + +void Test::testN695479() +{ + load("n695479.rtf"); + + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + + // Negative ABSH should mean fixed size. + sal_Int16 nSizeType = 0; + xPropertySet->getPropertyValue("SizeType") >>= nSizeType; + CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, nSizeType); + sal_Int32 nHeight = 0; + xPropertySet->getPropertyValue("Height") >>= nHeight; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(300)), nHeight); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + bool bFrameFound = false, bDrawFound = false; + for (int i = 0; i < xDraws->getCount(); ++i) + { + uno::Reference xServiceInfo(xDraws->getByIndex(i), uno::UNO_QUERY); + if (xServiceInfo->supportsService("com.sun.star.text.TextFrame")) + { + // Both frames should be anchored to the first paragraph. + bFrameFound = true; + uno::Reference xTextContent(xServiceInfo, uno::UNO_QUERY); + uno::Reference xRange(xTextContent->getAnchor(), uno::UNO_QUERY); + uno::Reference xText(xRange->getText(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("plain"), xText->getString()); + + if (i == 0) + { + // Additonally, the frist frame should have double border at the bottom. + table::BorderLine2 aBorder; + xPropertySet->getPropertyValue("BottomBorder") >>= aBorder; + CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::DOUBLE, aBorder.LineStyle); + } + } + else if (xServiceInfo->supportsService("com.sun.star.drawing.LineShape")) + { + // The older "drawing objects" syntax should be recognized. + bDrawFound = true; + xPropertySet.set(xServiceInfo, uno::UNO_QUERY); + sal_Int16 nHori = 0; + xPropertySet->getPropertyValue("HoriOrientRelation") >>= nHori; + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, nHori); + sal_Int16 nVert = 0; + xPropertySet->getPropertyValue("VertOrientRelation") >>= nVert; + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, nVert); + } + } + CPPUNIT_ASSERT(bFrameFound); + CPPUNIT_ASSERT(bDrawFound); +} + +void Test::testFdo42465() +{ + load("fdo42465.rtf"); + CPPUNIT_ASSERT_EQUAL(3, getLength()); +} + +void Test::testFdo45187() +{ + load("fdo45187.rtf"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference 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 xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + awt::Point aFirstPoint; + xPropertySet->getPropertyValue("AnchorPosition") >>= aFirstPoint; + xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY); + awt::Point aSecondPoint; + xPropertySet->getPropertyValue("AnchorPosition") >>= aSecondPoint; + CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y); +} + +void Test::testFdo46662() +{ + load("fdo46662.rtf"); + + uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum3"), uno::UNO_QUERY); + uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence aProps; + xLevels->getByIndex(1) >>= aProps; // 2nd level + + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + + if ( rProp.Name == "ParentNumbering" ) + { + sal_Int16 nValue; + rProp.Value >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nValue); + } + else if ( rProp.Name == "Suffix" ) + { + rtl::OUString sValue; + rProp.Value >>= sValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength()); + } + } +} + +void Test::testN750757() +{ + load("n750757.rtf"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Bool bValue; + xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue; + CPPUNIT_ASSERT_EQUAL(sal_Bool(false), bValue); + + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue; + CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue); +} + +void Test::testFdo45563() +{ + load("fdo45563.rtf"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + int i = 0; + while (xParaEnum->hasMoreElements()) + { + xParaEnum->nextElement(); + i++; + } + CPPUNIT_ASSERT_EQUAL(4, i); +} + +void Test::testFdo43965() +{ + load("fdo43965.rtf"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + + // First paragraph: the parameter of \up was ignored + uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); + uno::Reference xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue; + xPropertySet->getPropertyValue("CharEscapement") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(58), nValue); + xPropertySet->getPropertyValue("CharEscapementHeight") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue); + + // Second paragraph: Word vs Writer border default problem + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + table::BorderLine2 aBorder; + xPropertySet->getPropertyValue("TopBorder") >>= aBorder; + CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth); + + // Finally, make sure that we have two pages + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +void Test::testN751020() +{ + load("n751020.rtf"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + CPPUNIT_ASSERT(xParaEnum->hasMoreElements()); + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("ParaBottomMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue); +} + +void Test::testFdo47326() +{ + load("fdo47326.rtf"); + // This was 15 only, as \super buffered text, then the contents of it got lost. + CPPUNIT_ASSERT_EQUAL(19, getLength()); +} + +void Test::testFdo47036() +{ + load("fdo47036.rtf"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + int nAtCharacter = 0; + for (int i = 0; i < xDraws->getCount(); ++i) + { + uno::Reference xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY); + text::TextContentAnchorType eValue; + xPropertySet->getPropertyValue("AnchorType") >>= eValue; + if (eValue == text::TextContentAnchorType_AT_CHARACTER) + nAtCharacter++; + } + // The image at the document start was ignored. + CPPUNIT_ASSERT_EQUAL(1, nAtCharacter); + + // There should be 2 textboxes, not 4 + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); +} + +void Test::testFdo46955() +{ + load("fdo46955.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + while (xParaEnum->hasMoreElements()) + { + uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); + while (xRangeEnum->hasMoreElements()) + { + uno::Reference xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY); + sal_Int16 nValue; + xPropertySet->getPropertyValue("CharCaseMap") >>= nValue; + CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, nValue); + } + } +} + +void Test::testFdo45394() +{ + load("fdo45394.rtf"); + + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + uno::Reference xHeaderText(xPropertySet->getPropertyValue("HeaderText"), uno::UNO_QUERY); + OUString aActual = xHeaderText->getString(); + // Encoding in the header was wrong. + OUString aExpected("ПК РИК", 11, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, aActual); + + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); +} + +void Test::testFdo48104() +{ + load("fdo48104.rtf"); + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + +void Test::testFdo47107() +{ + load("fdo47107.rtf"); + + uno::Reference xNumberingStyles(getStyles("NumberingStyles")); + // Make sure numbered and bullet legacy syntax is recognized, this used to throw a NoSuchElementException + xNumberingStyles->getByName("WWNum1"); + xNumberingStyles->getByName("WWNum2"); +} + +void Test::testFdo45182() +{ + load("fdo45182.rtf"); + + uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); + uno::Reference xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); + // Encoding in the footnote was wrong. + OUString aExpected("živností", 10, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +void Test::testFdo44176() +{ + load("fdo44176.rtf"); + + uno::Reference xPageStyles(getStyles("PageStyles")); + uno::Reference xFirstPage(xPageStyles->getByName("First Page"), uno::UNO_QUERY); + uno::Reference xDefault(xPageStyles->getByName("Default"), uno::UNO_QUERY); + sal_Int32 nFirstTop = 0, nDefaultTop = 0, nDefaultHeader = 0; + xFirstPage->getPropertyValue("TopMargin") >>= nFirstTop; + xDefault->getPropertyValue("TopMargin") >>= nDefaultTop; + xDefault->getPropertyValue("HeaderHeight") >>= nDefaultHeader; + CPPUNIT_ASSERT_EQUAL(nFirstTop, nDefaultTop + nDefaultHeader); +} + +void Test::testFdo39053() +{ + load("fdo39053.rtf"); + + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + int nAsCharacter = 0; + for (int i = 0; i < xDraws->getCount(); ++i) + { + uno::Reference xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY); + text::TextContentAnchorType eValue; + xPropertySet->getPropertyValue("AnchorType") >>= eValue; + if (eValue == text::TextContentAnchorType_AS_CHARACTER) + nAsCharacter++; + } + // The image in binary format was ignored. + CPPUNIT_ASSERT_EQUAL(1, nAsCharacter); +} + +void Test::testFdo48356() +{ + load("fdo48356.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + OUStringBuffer aBuf; + int i = 0; + while (xParaEnum->hasMoreElements()) + { + xParaEnum->nextElement(); + i++; + } + // The document used to be imported as two paragraphs. + CPPUNIT_ASSERT_EQUAL(1, i); +} + +void Test::testFdo48023() +{ + lang::Locale aLocale; + aLocale.Language = "ru"; + AllSettings aSettings(Application::GetSettings()); + AllSettings aSavedSettings(aSettings); + aSettings.SetLocale(aLocale); + Application::SetSettings(aSettings); + load("fdo48023.rtf"); + Application::SetSettings(aSavedSettings); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); + uno::Reference xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY); + + // Implicit encoding detection based on locale was missing + OUString aExpected("Программист", 22, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +void Test::testFdo48876() +{ + load("fdo48876.rtf"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + CPPUNIT_ASSERT(xParaEnum->hasMoreElements()); + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + style::LineSpacing aSpacing; + xPropertySet->getPropertyValue("ParaLineSpacing") >>= aSpacing; + CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, aSpacing.Mode); +} + +void Test::testFdo48193() +{ + load("fdo48193.rtf"); + CPPUNIT_ASSERT_EQUAL(7, getLength()); +} + +void Test::testFdo44211() +{ + lang::Locale aLocale; + aLocale.Language = "lt"; + AllSettings aSettings(Application::GetSettings()); + AllSettings aSavedSettings(aSettings); + aSettings.SetLocale(aLocale); + Application::SetSettings(aSettings); + load("fdo44211.rtf"); + Application::SetSettings(aSavedSettings); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); + uno::Reference xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY); + + OUString aExpected("ąčę", 6, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +void Test::testFdo48037() +{ + load("fdo48037.rtf"); + + uno::Reference 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 xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference xFields(xFieldsAccess->createEnumeration()); + uno::Reference xPropertySet(xFields->nextElement(), uno::UNO_QUERY); + sal_Int32 nActual = 0; + xPropertySet->getPropertyValue("NumberFormat") >>= nActual; + + CPPUNIT_ASSERT_EQUAL(nExpected, nActual); +} + +void Test::testFdo47764() +{ + load("fdo47764.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + // \cbpat with zero argument should mean the auto (-1) color, not a default color (black) + xPropertySet->getPropertyValue("ParaBackColor") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue); +} + +void Test::testFdo38786() +{ + load("fdo38786.rtf"); + + uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference xFields(xFieldsAccess->createEnumeration()); + // \chpgn was ignored, so exception was thrown + xFields->nextElement(); +} + +void Test::testN757651() +{ + load("n757651.rtf"); + + // The bug was that due to buggy layout the text expanded to two pages. + if (Application::GetDefaultDevice()->IsFontAvailable(OUString("Times New Roman"))) + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + +void Test::testFdo49501() +{ + load("fdo49501.rtf"); + + uno::Reference xStyle(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + + sal_Bool bIsLandscape = sal_False; + xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape; + CPPUNIT_ASSERT_EQUAL(sal_True, bIsLandscape); + sal_Int32 nExpected(TWIP_TO_MM100(567)); + sal_Int32 nValue = 0; + xStyle->getPropertyValue("LeftMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); + xStyle->getPropertyValue("RightMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); + xStyle->getPropertyValue("TopMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); + xStyle->getPropertyValue("BottomMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(nExpected, nValue); +} + +void Test::testFdo49271() +{ + load("fdo49271.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + xParaEnum->nextElement(); + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + float fValue = 0; + xPropertySet->getPropertyValue("CharHeight") >>= fValue; + + CPPUNIT_ASSERT_EQUAL(25.f, fValue); +} + +void Test::testFdo49692() +{ + load("fdo49692.rtf"); + + uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); + uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence aProps; + xLevels->getByIndex(0) >>= aProps; // 1st level + + for (int i = 0; i < aProps.getLength(); ++i) + { + const beans::PropertyValue& rProp = aProps[i]; + + if (rProp.Name == "Suffix") + { + rtl::OUString sValue; + rProp.Value >>= sValue; + + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength()); + } + } +} + +void Test::testFdo45190() +{ + load("fdo45190.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + + // inherited \fi should be reset + uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue); + + // but direct one not + xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), nValue); +} + +void Test::testFdo50539() +{ + load("fdo50539.rtf"); + + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum = xRunEnumAccess->createEnumeration(); + uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); + sal_Int32 nValue = 0; + // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black) + xPropertySet->getPropertyValue("CharBackColor") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue); +} + +void Test::testFdo50665() +{ + load("fdo50665.rtf"); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); + uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); + uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); + + // Access the second run, which is a textfield + xRunEnum->nextElement(); + uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); + OUString aValue; + xRun->getPropertyValue("CharFontName") >>= aValue; + // This used to be the default, as character properties were ignored. + CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), aValue); +} + +void Test::testFdo49659() +{ + load("fdo49659.rtf"); + + // Both tables were ignored: 1) was in the header, 2) was ignored due to missing empty par at the end of the doc + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); + + // The graphic was also empty + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + uno::Reference xGraphic; + xPropertySet->getPropertyValue("Graphic") >>= xGraphic; + sal_Int8 nValue = 0; + xGraphic->getPropertyValue("GraphicType") >>= nValue; + CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, nValue); +} + +void Test::testFdo46966() +{ + /* + * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch). + * + * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin + */ + load("fdo46966.rtf"); + + uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("TopMargin") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), nValue); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtftok/data/fdo38786.rtf b/sw/qa/extras/rtftok/data/fdo38786.rtf deleted file mode 100644 index 6397cee7a670..000000000000 --- a/sw/qa/extras/rtftok/data/fdo38786.rtf +++ /dev/null @@ -1,2 +0,0 @@ -{\rtf1\chpgn -\par} diff --git a/sw/qa/extras/rtftok/data/fdo39053.rtf b/sw/qa/extras/rtftok/data/fdo39053.rtf deleted file mode 100644 index 71d26916fc99..000000000000 Binary files a/sw/qa/extras/rtftok/data/fdo39053.rtf and /dev/null differ diff --git a/sw/qa/extras/rtftok/data/fdo42465.rtf b/sw/qa/extras/rtftok/data/fdo42465.rtf deleted file mode 100644 index 06c29d42022c..000000000000 --- a/sw/qa/extras/rtftok/data/fdo42465.rtf +++ /dev/null @@ -1,4 +0,0 @@ -{\rtf1 -{\langfe1038\dbch\af14\afs24\alang1025\rtlch \ltrch\loch\fs24\lang1038\loch\f7 -k\uc2 \u243\'c3\'b3d\uc1 } -\par } diff --git a/sw/qa/extras/rtftok/data/fdo43965.rtf b/sw/qa/extras/rtftok/data/fdo43965.rtf deleted file mode 100644 index 968fe77e2782..000000000000 --- a/sw/qa/extras/rtftok/data/fdo43965.rtf +++ /dev/null @@ -1,16 +0,0 @@ -{\rtf1\ansi\ansicpg1252 -{\fonttbl \f0\froman\fcharset0 Times;\f1\fswiss\fcharset0 Helvetica;} -{\info{\subject Test file for LibreOffice 3.5}} -\margl1440\margr1440\margt1440\margb1440\deftab720\viewkind1\viewscale100 -\pard\pardeftab720\ql\qnatural -\f0\fs36 -{ -{\fs22\up8 2} -}\ -{\box\brdrs Box -}\ -Page feeds:\ - This is on the first page.\ -\page - This is on the second page.\ -} diff --git a/sw/qa/extras/rtftok/data/fdo44176.rtf b/sw/qa/extras/rtftok/data/fdo44176.rtf deleted file mode 100644 index c1754afced77..000000000000 --- a/sw/qa/extras/rtftok/data/fdo44176.rtf +++ /dev/null @@ -1,10 +0,0 @@ -{\rtf1 -{\header foo -\par } -\titlepg -First page has no header. -\par -\pagebb -Second page has a header. -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo44211.rtf b/sw/qa/extras/rtftok/data/fdo44211.rtf deleted file mode 100644 index 699ce73e280f..000000000000 --- a/sw/qa/extras/rtftok/data/fdo44211.rtf +++ /dev/null @@ -1,4 +0,0 @@ -{\rtf1\ansi\deff0{\fonttbl{\f0 Helvetica;}} -\pard\f0\fs20\'e0\'e8\'e6 -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo45182.rtf b/sw/qa/extras/rtftok/data/fdo45182.rtf deleted file mode 100644 index b076106162b7..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45182.rtf +++ /dev/null @@ -1,11 +0,0 @@ -{\rtf1\deff0 -{\fonttbl -{\f0\fcharset238 -Times New Roman;} -} -a\chftn -{\footnote -\ltrpar \pard\plain\'9eivnost\'ed -\par -} -} diff --git a/sw/qa/extras/rtftok/data/fdo45187.rtf b/sw/qa/extras/rtftok/data/fdo45187.rtf deleted file mode 100644 index 61b71ade8082..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45187.rtf +++ /dev/null @@ -1,32 +0,0 @@ -{\rtf1 -{\field -{\*\fldinst SHAPE } -{\fldrslt -{\shp -{\*\shpinst\shpleft1000\shptop1000\shpright2000\shpbottom2000 -{\sp -{\sn shapeType} -{\sv 1} -} -} -} -} -} -first -\par -{\field -{\*\fldinst SHAPE } -{\fldrslt -{\shp -{\*\shpinst\shpleft1000\shptop3000\shpright2000\shpbottom4000 -{\sp -{\sn shapeType} -{\sv 3} -} -} -} -} -} -second -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo45190.rtf b/sw/qa/extras/rtftok/data/fdo45190.rtf deleted file mode 100644 index 613a283150f1..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45190.rtf +++ /dev/null @@ -1,10 +0,0 @@ -{\rtf1 -{\stylesheet -{\s1 \fi-100 style;} -} -\s1\li0 first -\par -\pard -\s1\fi-100\li0 second -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo45394.rtf b/sw/qa/extras/rtftok/data/fdo45394.rtf deleted file mode 100644 index 6d02f50602ce..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45394.rtf +++ /dev/null @@ -1,19 +0,0 @@ -{\rtf1 -{\fonttbl -{\f37\fswiss\fcharset204\fprq2 -Verdana;} -} -{\headerr -\f37 \'cf\'ca \'d0\'c8\'ca\par -} -\trowd \cellx4498\cellx9104 -\pard\plain\intbl -\cell \cell -\row -\trowd \cellx4498\cellx9104 -\pard\plain\intbl -c\cell d\cell -\row -\pard\plain -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo45543.rtf b/sw/qa/extras/rtftok/data/fdo45543.rtf deleted file mode 100644 index 43a8c892cff0..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45543.rtf +++ /dev/null @@ -1,8 +0,0 @@ -{\rtf1 -{\fonttbl -{\fdbminor\f31505\fbidi \froman\fcharset128\fprq1\'82\'6c\'82\'72 \'96\'be\'92\'a9;} -} -\pard\plain -\f31505 \'82\'b1\'82\'cc\'95\'b6\'8f\'91\'82\'cd -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo45553.rtf b/sw/qa/extras/rtftok/data/fdo45553.rtf deleted file mode 100644 index 38b9d36e64df..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45553.rtf +++ /dev/null @@ -1,2 +0,0 @@ -{\rtf1 \sa240 space-after\par\pard -\sb120 space-before\par} diff --git a/sw/qa/extras/rtftok/data/fdo45563.rtf b/sw/qa/extras/rtftok/data/fdo45563.rtf deleted file mode 100644 index 3dd3fd0b9956..000000000000 --- a/sw/qa/extras/rtftok/data/fdo45563.rtf +++ /dev/null @@ -1,5 +0,0 @@ -{\rtf1 -only n\ -only r\ both r and n\ -last\par -} diff --git a/sw/qa/extras/rtftok/data/fdo46662.rtf b/sw/qa/extras/rtftok/data/fdo46662.rtf deleted file mode 100644 index db93c9c1eadc..000000000000 --- a/sw/qa/extras/rtftok/data/fdo46662.rtf +++ /dev/null @@ -1,46 +0,0 @@ -{\rtf1 -{\*\listtable -{\list\listtemplateid3 -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'01\'00;} -{\levelnumbers\'01;} -\fi-360\li720\lin720 } -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'03\'00.\'01;} -{\levelnumbers\'01\'03;} -\fi-360\li1080\lin1080 } -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'05\'00.\'01.\'02;} -{\levelnumbers\'01\'03\'05;} -\fi-360\li1440\lin1440 -} -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'07\'00.\'01.\'02.\'03;} -{\levelnumbers\'01\'03\'05\'07;} -\fi-360\li1800\lin1800 } -\listid3} -} -{\*\listoverridetable -{\listoverride\listid3\listoverridecount0\ls3} -} -\pard\ls3 -{numbering with all sublevels: test 1 -\par -} -\pard\ls3\ilvl1 -{test 1.1 -\par -} -\pard\ls3\ilvl2 -{test 1.1.1 -\par -} -\pard\ls3\ilvl3 -{test 1.1.1.1 -\par -} -\pard\ls3 -{test 2 -\par -} -} diff --git a/sw/qa/extras/rtftok/data/fdo46955.rtf b/sw/qa/extras/rtftok/data/fdo46955.rtf deleted file mode 100644 index 4e3ddda79935..000000000000 --- a/sw/qa/extras/rtftok/data/fdo46955.rtf +++ /dev/null @@ -1 +0,0 @@ -{\rtf1 \caps caps\par} diff --git a/sw/qa/extras/rtftok/data/fdo46966.rtf b/sw/qa/extras/rtftok/data/fdo46966.rtf deleted file mode 100644 index de0f7dff9c2f..000000000000 --- a/sw/qa/extras/rtftok/data/fdo46966.rtf +++ /dev/null @@ -1,10 +0,0 @@ -{\rtf1\ansi -{\fonttbl{\f0 Times New Roman;}} -{\stylesheet{\s0\snext0\f0\fs24 Normal;}} - -\margl720\margr1440\margt720\margb1440 -\sectd -\marglsxn720\margrsxn1440\margtsxn720\margbsxn1440 -{\header Header} -Text -\par } diff --git a/sw/qa/extras/rtftok/data/fdo47036.rtf b/sw/qa/extras/rtftok/data/fdo47036.rtf deleted file mode 100644 index cc988f1eac0d..000000000000 --- a/sw/qa/extras/rtftok/data/fdo47036.rtf +++ /dev/null @@ -1,73 +0,0 @@ -{\rtf1 -\paperw11904\paperh16836\margl864\margr288\margt360\margb360\gutter0\ltrsect -\widowctrl\ftnbj\aenddoc\donotembedsysfont0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120 -\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot15426039 \fet0 -\ilfomacatclnup0\ltrpar \sectd \ltrsect\sbknone\linex0\sectdefaultcl\sftnbj -\pard\plain \ltrpar\qc \li0\ri0\nowidctlpar -\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\tx6120\tx6480\tx6840\tx7200\tx7560\tx7920\tx8280\tx8640\tx9000\tx9360\tx9720\pvpg\phpg\posx939 -\posy2714\absh-450\absw10080\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid1775824 -{\shp -{\*\shpinst\shpleft1074\shptop528\shpright11487\shpbottom1945\shpfhdr0\shpbxpage\shpbxignore\shpbypage\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz3\shplid1029 -{\sp -{\sn shapeType} -{\sv 75} -} -{\sp -{\sn fFlipH} -{\sv 0} -} -{\sp -{\sn fFlipV} -{\sv 0} -} -{\sp -{\sn pib} -{\sv -{\pict\picscalex92\picscaley92\piccropl0\piccropr0\piccropt0\piccropb0 -\picw20032\pich2725\picwgoal11357\pichgoal1545\pngblip\bliptag-1891142031 -{\*\blipuid 8f477671d3377e167ce61bb2e9de72f7} -47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b -} -} -} -{\sp -{\sn posrelh} -{\sv 1} -} -{\sp -{\sn posrelv} -{\sv 1} -} -{\sp -{\sn fLayoutInCell} -{\sv 0} -} -{\sp -{\sn fBehindDocument} -{\sv 1} -} -{\sp -{\sn fLayoutInCell} -{\sv 0} -} -} -} -} -{\rtlch\fcs1 \ab\af1\afs33 \ltrch\fcs0 -\b\f1\fs33\cf1\insrsid15426039 Booking Advice} -{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid15426039 -\par } -\pard \pvpg\phpg\posx1914\posy4761\absh-2400\absw7674\wrapdefault -\faauto\rin0\lin0\itap0 -{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf1\insrsid15426039 foo \tab \tab \tab \tab \tab \tab } -{\rtlch\fcs1 \af1 \ltrch\fcs0 \f1\insrsid15426039 -\par } -{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf1\insrsid15426039 x\tab -\par -\par } -{\rtlch\fcs1 \af1\afs19 \ltrch\fcs0 \f1\fs19\cf6\insrsid16139741 y} -{\rtlch\fcs1 \af1 \ltrch\fcs0 -\f1\cf6\insrsid15426039\charrsid15426039 -\par } -} diff --git a/sw/qa/extras/rtftok/data/fdo47107.rtf b/sw/qa/extras/rtftok/data/fdo47107.rtf deleted file mode 100644 index 74371cd57471..000000000000 --- a/sw/qa/extras/rtftok/data/fdo47107.rtf +++ /dev/null @@ -1,21 +0,0 @@ -{\rtf1 -{\fonttbl -{\f1 Symbol;} -} -\pard \fi-283\li283 -{\*\pn \pnlvlbody\pndec\pnstart1 -{\pntxta .} -} -{Alpha -\par -Beta -\par } -\pard \fi-283\li283 -{\*\pn \pnlvlblt\pnf1\pnstart1 -{\pntxtb \'b7} -} -{Alpha -\par -Beta -\par } -} diff --git a/sw/qa/extras/rtftok/data/fdo47326.rtf b/sw/qa/extras/rtftok/data/fdo47326.rtf deleted file mode 100644 index 264e719127b7..000000000000 --- a/sw/qa/extras/rtftok/data/fdo47326.rtf +++ /dev/null @@ -1,5 +0,0 @@ -{\rtf1 -Windows\super\'ae\nosupersub XP: -\pard - Cartes:\par -} diff --git a/sw/qa/extras/rtftok/data/fdo47764.rtf b/sw/qa/extras/rtftok/data/fdo47764.rtf deleted file mode 100644 index 2a9d367b5aff..000000000000 --- a/sw/qa/extras/rtftok/data/fdo47764.rtf +++ /dev/null @@ -1,4 +0,0 @@ -{\rtf1 -\cbpat0\cf0 -bug -} diff --git a/sw/qa/extras/rtftok/data/fdo48023.rtf b/sw/qa/extras/rtftok/data/fdo48023.rtf deleted file mode 100644 index 6d6a0d9b551e..000000000000 --- a/sw/qa/extras/rtftok/data/fdo48023.rtf +++ /dev/null @@ -1,8 +0,0 @@ -{\rtf -{\fonttbl -{\f1 Arial;} -} -\pard -\f1 -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo48037.rtf b/sw/qa/extras/rtftok/data/fdo48037.rtf deleted file mode 100644 index af7217e49428..000000000000 --- a/sw/qa/extras/rtftok/data/fdo48037.rtf +++ /dev/null @@ -1,13 +0,0 @@ -{\rtf1\ansi\ansicpg1252\uc1 \deff0 -\pard\plain \lang1036 -{\f31 VINCENNES, LE } -{\field -{\*\fldinst -DATE \\@ "d MMMM yyyy" \\* MERGEFORMAT -} -{\fldrslt -xxx -} -} -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo48104.rtf b/sw/qa/extras/rtftok/data/fdo48104.rtf deleted file mode 100644 index 64d5e5979e4f..000000000000 --- a/sw/qa/extras/rtftok/data/fdo48104.rtf +++ /dev/null @@ -1,6 +0,0 @@ -{\rtf1 -first page\par -\page -{second page first line\par} -second page second line\par -} diff --git a/sw/qa/extras/rtftok/data/fdo48193.rtf b/sw/qa/extras/rtftok/data/fdo48193.rtf deleted file mode 100644 index ca585496eaf4..000000000000 --- a/sw/qa/extras/rtftok/data/fdo48193.rtf +++ /dev/null @@ -1,10 +0,0 @@ -{\rtf1 -\pard\plain -foo -{\field -{\*\fldinst -{\f8\fs16\f8 PAGE } -} -} -bar -\par } diff --git a/sw/qa/extras/rtftok/data/fdo48356.rtf b/sw/qa/extras/rtftok/data/fdo48356.rtf deleted file mode 100644 index 59d6cb021d5f..000000000000 --- a/sw/qa/extras/rtftok/data/fdo48356.rtf +++ /dev/null @@ -1,3 +0,0 @@ -{\rtf1 -Ma\u269\'0dek -\par } diff --git a/sw/qa/extras/rtftok/data/fdo48876.rtf b/sw/qa/extras/rtftok/data/fdo48876.rtf deleted file mode 100644 index 49a6eb0bf6a9..000000000000 --- a/sw/qa/extras/rtftok/data/fdo48876.rtf +++ /dev/null @@ -1,5 +0,0 @@ -{\rtf -\sl54 -C -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo49271.rtf b/sw/qa/extras/rtftok/data/fdo49271.rtf deleted file mode 100644 index 4f3a48c6e9e8..000000000000 --- a/sw/qa/extras/rtftok/data/fdo49271.rtf +++ /dev/null @@ -1,3 +0,0 @@ -{\rtf1 -\fs50 one \par \par two \par -} diff --git a/sw/qa/extras/rtftok/data/fdo49501.rtf b/sw/qa/extras/rtftok/data/fdo49501.rtf deleted file mode 100644 index 47bd691b8e62..000000000000 --- a/sw/qa/extras/rtftok/data/fdo49501.rtf +++ /dev/null @@ -1,5 +0,0 @@ -{\rtf -\landscape \paperw15309 \paperh11907 \margl567 \margr567 \margt567 \margb567 -Department -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo49659.rtf b/sw/qa/extras/rtftok/data/fdo49659.rtf deleted file mode 100644 index c908826a1015..000000000000 --- a/sw/qa/extras/rtftok/data/fdo49659.rtf +++ /dev/null @@ -1,19 +0,0 @@ -{\rtf1 -\sectd -{\header -{\trowd\cellx4000\cellx9500\pard\plain\intbl -{\pict{\pngblip\picwgoal2340\pichgoal1000\picscalex50\picscaley50\piccropl0\piccropr0\piccropt0\piccropb0}89504e470d0a1a0a0000000d49484452000000750000003201000000004a22a9c50000009249444154789c63fccf800c7e3231a00216065dd33fc10f155b2c52 -5905fdf303d1e547f9a37c6af219d1d2230b03c3df94f4d058bfeb9785e63c6060606260f87be4b4ee8ad3559ff90da0fa2518db2412db1812a0e631ff3539ef -f08581e10b030303030b030333c399957baf21ecfbf5eb3fafc3110686170c0c0c0c0cffffff293ec6a1c0c420785efeffff1fe8f60300fbbc2d919818ba7900 -00000049454e44ae426082} -header1 -\cell\pard\plain\intbl -header2 -\cell\row} -} -{\trowd\cellx4000\cellx9500\pard\plain\intbl -body1 -\cell\pard\plain\intbl -body2 -\cell\row} -} diff --git a/sw/qa/extras/rtftok/data/fdo49692.rtf b/sw/qa/extras/rtftok/data/fdo49692.rtf deleted file mode 100644 index bcd7004e627d..000000000000 --- a/sw/qa/extras/rtftok/data/fdo49692.rtf +++ /dev/null @@ -1,17 +0,0 @@ -{\rtf1 -{\*\listtable -{\list\listtemplateid1 -{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0 -{\leveltext \'00;} -{\levelnumbers;} -\fi0\li0} -\listid1} -} -{\listoverridetable -{\listoverride\listid1\listoverridecount0\ls1} -} -\ilvl0 -\ls1 -EULA -\par -} diff --git a/sw/qa/extras/rtftok/data/fdo50539.rtf b/sw/qa/extras/rtftok/data/fdo50539.rtf deleted file mode 100644 index c8a13012f0b0..000000000000 --- a/sw/qa/extras/rtftok/data/fdo50539.rtf +++ /dev/null @@ -1,4 +0,0 @@ -{\rtf1 -\chcbpat0\cf0 -bug -} diff --git a/sw/qa/extras/rtftok/data/fdo50665.rtf b/sw/qa/extras/rtftok/data/fdo50665.rtf deleted file mode 100644 index 2536eb0df66e..000000000000 --- a/sw/qa/extras/rtftok/data/fdo50665.rtf +++ /dev/null @@ -1,16 +0,0 @@ -{\rtf1\ansi\deff6 -{\fonttbl -{\f1\fnil\fprq0\fcharset0 Times New Roman;} -{\f4\fmodern\fprq1\fcharset0 Cumberland -{\*\falt Courier New} -;} -{\f6\froman\fprq2\fcharset1 Book Antiqua -{\*\falt Times New Roman} -;} -} -\sectd\sbknone\pgwsxn11909\pghsxn16834\marglsxn1080\margrsxn1080\margtsxn2437\margbsxn1080\headery1080 -\pard\plain \s7\cf0\tqr\tx9990\tqr\tx9900 -{\loch\f6\fs24\lang1033\i0\b -Page : \chpgn\par -} -} diff --git a/sw/qa/extras/rtftok/data/n192129.rtf b/sw/qa/extras/rtftok/data/n192129.rtf deleted file mode 100644 index 1451b367823a..000000000000 --- a/sw/qa/extras/rtftok/data/n192129.rtf +++ /dev/null @@ -1,3 +0,0 @@ -{\rtf1 -{\pict \pngblip \picw-64 \pich-1061137057 \picwgoal0 \pichgoal0 47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b} -\par } diff --git a/sw/qa/extras/rtftok/data/n695479.rtf b/sw/qa/extras/rtftok/data/n695479.rtf deleted file mode 100644 index 5fe7e4519c91..000000000000 --- a/sw/qa/extras/rtftok/data/n695479.rtf +++ /dev/null @@ -1,14 +0,0 @@ -{\rtf1 -\paperw12240\paperh15840\margl360\margr360\margt360\margb302\gutter0\ltrsect -\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\pvpg\posx116\posy2167\absh-300\absw5134\overlay\faauto\rin0\lin0\itap0 -\brdrb\brdrdb\brdrw15\brsp20 -\rtlch\fcs1 \af0\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1038\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp1038 -{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\cf1\lang1038\langfe1038\langnp1038\insrsid10974703 -\hich\af0\dbch\af31505\loch\f0 first -\par } -\pard \ltrpar\ql \li0\ri0\nowidctlpar\pvpg\posx5562\posy5417\absh-226\absw5946\overlay\faauto\rin0\lin0\itap0\pararsid15926738 -{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \cf1\lang1038\langfe1038\langnp1038\insrsid10974703 -second\par } -{\*\do\dobxmargin\dobypage\dodhgt0\dpline\dpx81\dpy4923\dpxsize11438\dpysize1\dplinecor0\dplinecog0\dplinecob0} -\pard plain\par -} diff --git a/sw/qa/extras/rtftok/data/n750757.rtf b/sw/qa/extras/rtftok/data/n750757.rtf deleted file mode 100644 index 04d78b615a62..000000000000 --- a/sw/qa/extras/rtftok/data/n750757.rtf +++ /dev/null @@ -1,45 +0,0 @@ -{\rtf1 -{\stylesheet -{\s15\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 -\sbasedon0 \snext15 \sqformat \spriority34 \styrsid13858768 List Paragraph;} -} -{\*\listtable -{\list\listtemplateid188802200\listhybrid -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\leveltemplateid68026383 -\'02\'00.;} -{\levelnumbers\'01;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li720\lin720 } -{\listname ;} -\listid983924569} -} -{\*\listoverridetable -{\listoverride\listid983924569\listoverridecount0\ls4} -} -\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 -\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 -{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 before -\par -{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 \hich\af31506\dbch\af31506\loch\f31506 1.\tab} -} -\pard\plain \ltrpar -\s15\ql \fi-360\li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid13858768\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 -\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 -{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num} -{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 1 -\par -{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 \hich\af31506\dbch\af31506\loch\f31506 2.\tab} -} -{\rtlch\fcs1 \af31507 \ltrch\fcs0 -\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num} -{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 2 -\par -{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\insrsid420015 \hich\af31506\dbch\af31506\loch\f31506 3.\tab} -} -{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid420015 num 3 -\par } -\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 -{ -\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 after -\par } -} diff --git a/sw/qa/extras/rtftok/data/n751020.rtf b/sw/qa/extras/rtftok/data/n751020.rtf deleted file mode 100644 index 66175cf8b901..000000000000 --- a/sw/qa/extras/rtftok/data/n751020.rtf +++ /dev/null @@ -1,8 +0,0 @@ -{\rtf1 -{\stylesheet -{Normal;} -} -\linkstyles -first\par -second\par -} diff --git a/sw/qa/extras/rtftok/data/n757651.rtf b/sw/qa/extras/rtftok/data/n757651.rtf deleted file mode 100644 index dfd49a8cda4b..000000000000 --- a/sw/qa/extras/rtftok/data/n757651.rtf +++ /dev/null @@ -1,18 +0,0 @@ -{\rtf1\ansi\deff3\adeflang1025 -{\fonttbl -{\f0\froman\fprq2\fcharset0 Times New Roman;} -} -\sectd\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1260\margbsxn432 -\pard\plain\f0\fs24\sl480\slmult1 -________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par -\pard\plain\f0\fs24\sl480\slmult1 -________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par -\pard\plain\f0\fs24\sl480\slmult1 -________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par -\pard\plain\f0\fs24\sl480\slmult1 -________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par -\pard\plain\f0\fs24\sl480\slmult1 -________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par -\pard\plain\f0\fs24\sl480\slmult1 -________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________\par -} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx deleted file mode 100644 index fef82e2f19fa..000000000000 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ /dev/null @@ -1,818 +0,0 @@ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Initial Developer of the Original Code is - * Miklos Vajna (SUSE, Inc.) - * Portions created by the Initial Developer are Copyright (C) 2012 the - * Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include "../swmodeltestbase.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) - -using rtl::OString; -using rtl::OUString; -using rtl::OUStringBuffer; - -class Test : public SwModelTestBase -{ -public: - void testFdo45553(); - void testN192129(); - void testFdo45543(); - void testN695479(); - void testFdo42465(); - void testFdo45187(); - void testFdo46662(); - void testN750757(); - void testFdo45563(); - void testFdo43965(); - void testN751020(); - void testFdo47326(); - void testFdo47036(); - void testFdo46955(); - void testFdo45394(); - void testFdo48104(); - void testFdo47107(); - void testFdo45182(); - void testFdo44176(); - void testFdo39053(); - void testFdo48356(); - void testFdo48023(); - void testFdo48876(); - void testFdo48193(); - void testFdo44211(); - void testFdo48037(); - void testFdo47764(); - void testFdo38786(); - void testN757651(); - void testFdo49501(); - void testFdo49271(); - void testFdo49692(); - void testFdo45190(); - void testFdo50539(); - void testFdo50665(); - void testFdo49659(); - void testFdo46966(); - - CPPUNIT_TEST_SUITE(Test); -#if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testFdo45553); - CPPUNIT_TEST(testN192129); - CPPUNIT_TEST(testFdo45543); - CPPUNIT_TEST(testN695479); - CPPUNIT_TEST(testFdo42465); - CPPUNIT_TEST(testFdo45187); - CPPUNIT_TEST(testFdo46662); - CPPUNIT_TEST(testN750757); - CPPUNIT_TEST(testFdo45563); - CPPUNIT_TEST(testFdo43965); - CPPUNIT_TEST(testN751020); - CPPUNIT_TEST(testFdo47326); - CPPUNIT_TEST(testFdo47036); - CPPUNIT_TEST(testFdo46955); - CPPUNIT_TEST(testFdo45394); - CPPUNIT_TEST(testFdo48104); - CPPUNIT_TEST(testFdo47107); - CPPUNIT_TEST(testFdo45182); - CPPUNIT_TEST(testFdo44176); - CPPUNIT_TEST(testFdo39053); - CPPUNIT_TEST(testFdo48356); - CPPUNIT_TEST(testFdo48023); - CPPUNIT_TEST(testFdo48876); - CPPUNIT_TEST(testFdo48193); - CPPUNIT_TEST(testFdo44211); - CPPUNIT_TEST(testFdo48037); - CPPUNIT_TEST(testFdo47764); - CPPUNIT_TEST(testFdo38786); - CPPUNIT_TEST(testN757651); - CPPUNIT_TEST(testFdo49501); - CPPUNIT_TEST(testFdo49271); - CPPUNIT_TEST(testFdo49692); - CPPUNIT_TEST(testFdo45190); - CPPUNIT_TEST(testFdo50539); - CPPUNIT_TEST(testFdo50665); - CPPUNIT_TEST(testFdo49659); - CPPUNIT_TEST(testFdo46966); -#endif - CPPUNIT_TEST_SUITE_END(); - -private: - /// Load an RTF file and make the document available via mxComponent. - void load(const OUString& rURL); - /// Get page count. - int getPages(); -}; - -void Test::load(const OUString& rFilename) -{ - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtftok/data/") + rFilename); -} - -int Test::getPages() -{ - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - return xCursor->getPage(); -} - -void Test::testFdo45553() -{ - load("fdo45553.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - while (xParaEnum->hasMoreElements()) - { - uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); - while (xRangeEnum->hasMoreElements()) - { - uno::Reference xRange(xRangeEnum->nextElement(), uno::UNO_QUERY); - OUString aStr = xRange->getString(); - if ( aStr == "space-before" ) - { - sal_Int32 nMargin = 0; - uno::Reference xPropertySet(xRange, uno::UNO_QUERY); - xPropertySet->getPropertyValue("ParaTopMargin") >>= nMargin; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(120)), nMargin); - } - else if ( aStr == "space-after" ) - { - sal_Int32 nMargin = 0; - uno::Reference xPropertySet(xRange, uno::UNO_QUERY); - xPropertySet->getPropertyValue("ParaBottomMargin") >>= nMargin; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(240)), nMargin); - } - } - } -} - -void Test::testN192129() -{ - load("n192129.rtf"); - - // We expect that the result will be 16x16px. - Size aExpectedSize(16, 16); - MapMode aMap(MAP_100TH_MM); - aExpectedSize = Application::GetDefaultDevice()->PixelToLogic( aExpectedSize, aMap ); - - uno::Reference xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY); - uno::Reference xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - awt::Size aActualSize(xShape->getSize()); - - CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Width()), aActualSize.Width); - CPPUNIT_ASSERT_EQUAL(sal_Int32(aExpectedSize.Height()), aActualSize.Height); -} - -void Test::testFdo45543() -{ - load("fdo45543.rtf"); - CPPUNIT_ASSERT_EQUAL(5, getLength()); -} - -void Test::testN695479() -{ - load("n695479.rtf"); - - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - - // Negative ABSH should mean fixed size. - sal_Int16 nSizeType = 0; - xPropertySet->getPropertyValue("SizeType") >>= nSizeType; - CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, nSizeType); - sal_Int32 nHeight = 0; - xPropertySet->getPropertyValue("Height") >>= nHeight; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(300)), nHeight); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - bool bFrameFound = false, bDrawFound = false; - for (int i = 0; i < xDraws->getCount(); ++i) - { - uno::Reference xServiceInfo(xDraws->getByIndex(i), uno::UNO_QUERY); - if (xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - { - // Both frames should be anchored to the first paragraph. - bFrameFound = true; - uno::Reference xTextContent(xServiceInfo, uno::UNO_QUERY); - uno::Reference xRange(xTextContent->getAnchor(), uno::UNO_QUERY); - uno::Reference xText(xRange->getText(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("plain"), xText->getString()); - - if (i == 0) - { - // Additonally, the frist frame should have double border at the bottom. - table::BorderLine2 aBorder; - xPropertySet->getPropertyValue("BottomBorder") >>= aBorder; - CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::DOUBLE, aBorder.LineStyle); - } - } - else if (xServiceInfo->supportsService("com.sun.star.drawing.LineShape")) - { - // The older "drawing objects" syntax should be recognized. - bDrawFound = true; - xPropertySet.set(xServiceInfo, uno::UNO_QUERY); - sal_Int16 nHori = 0; - xPropertySet->getPropertyValue("HoriOrientRelation") >>= nHori; - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, nHori); - sal_Int16 nVert = 0; - xPropertySet->getPropertyValue("VertOrientRelation") >>= nVert; - CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, nVert); - } - } - CPPUNIT_ASSERT(bFrameFound); - CPPUNIT_ASSERT(bDrawFound); -} - -void Test::testFdo42465() -{ - load("fdo42465.rtf"); - CPPUNIT_ASSERT_EQUAL(3, getLength()); -} - -void Test::testFdo45187() -{ - load("fdo45187.rtf"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference 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 xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); - awt::Point aFirstPoint; - xPropertySet->getPropertyValue("AnchorPosition") >>= aFirstPoint; - xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY); - awt::Point aSecondPoint; - xPropertySet->getPropertyValue("AnchorPosition") >>= aSecondPoint; - CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y); -} - -void Test::testFdo46662() -{ - load("fdo46662.rtf"); - - uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum3"), uno::UNO_QUERY); - uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); - uno::Sequence aProps; - xLevels->getByIndex(1) >>= aProps; // 2nd level - - for (int i = 0; i < aProps.getLength(); ++i) - { - const beans::PropertyValue& rProp = aProps[i]; - - if ( rProp.Name == "ParentNumbering" ) - { - sal_Int16 nValue; - rProp.Value >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nValue); - } - else if ( rProp.Name == "Suffix" ) - { - rtl::OUString sValue; - rProp.Value >>= sValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength()); - } - } -} - -void Test::testN750757() -{ - load("n750757.rtf"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - - uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); - sal_Bool bValue; - xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue; - CPPUNIT_ASSERT_EQUAL(sal_Bool(false), bValue); - - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - xPropertySet->getPropertyValue("ParaContextMargin") >>= bValue; - CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue); -} - -void Test::testFdo45563() -{ - load("fdo45563.rtf"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - int i = 0; - while (xParaEnum->hasMoreElements()) - { - xParaEnum->nextElement(); - i++; - } - CPPUNIT_ASSERT_EQUAL(4, i); -} - -void Test::testFdo43965() -{ - load("fdo43965.rtf"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - - // First paragraph: the parameter of \up was ignored - uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); - uno::Reference xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue; - xPropertySet->getPropertyValue("CharEscapement") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(58), nValue); - xPropertySet->getPropertyValue("CharEscapementHeight") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue); - - // Second paragraph: Word vs Writer border default problem - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - table::BorderLine2 aBorder; - xPropertySet->getPropertyValue("TopBorder") >>= aBorder; - CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth); - - // Finally, make sure that we have two pages - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -void Test::testN751020() -{ - load("n751020.rtf"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - CPPUNIT_ASSERT(xParaEnum->hasMoreElements()); - uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("ParaBottomMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue); -} - -void Test::testFdo47326() -{ - load("fdo47326.rtf"); - // This was 15 only, as \super buffered text, then the contents of it got lost. - CPPUNIT_ASSERT_EQUAL(19, getLength()); -} - -void Test::testFdo47036() -{ - load("fdo47036.rtf"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - int nAtCharacter = 0; - for (int i = 0; i < xDraws->getCount(); ++i) - { - uno::Reference xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY); - text::TextContentAnchorType eValue; - xPropertySet->getPropertyValue("AnchorType") >>= eValue; - if (eValue == text::TextContentAnchorType_AT_CHARACTER) - nAtCharacter++; - } - // The image at the document start was ignored. - CPPUNIT_ASSERT_EQUAL(1, nAtCharacter); - - // There should be 2 textboxes, not 4 - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); -} - -void Test::testFdo46955() -{ - load("fdo46955.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - while (xParaEnum->hasMoreElements()) - { - uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); - while (xRangeEnum->hasMoreElements()) - { - uno::Reference xPropertySet(xRangeEnum->nextElement(), uno::UNO_QUERY); - sal_Int16 nValue; - xPropertySet->getPropertyValue("CharCaseMap") >>= nValue; - CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, nValue); - } - } -} - -void Test::testFdo45394() -{ - load("fdo45394.rtf"); - - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); - uno::Reference xHeaderText(xPropertySet->getPropertyValue("HeaderText"), uno::UNO_QUERY); - OUString aActual = xHeaderText->getString(); - // Encoding in the header was wrong. - OUString aExpected("ПК РИК", 11, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, aActual); - - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); -} - -void Test::testFdo48104() -{ - load("fdo48104.rtf"); - CPPUNIT_ASSERT_EQUAL(2, getPages()); -} - -void Test::testFdo47107() -{ - load("fdo47107.rtf"); - - uno::Reference xNumberingStyles(getStyles("NumberingStyles")); - // Make sure numbered and bullet legacy syntax is recognized, this used to throw a NoSuchElementException - xNumberingStyles->getByName("WWNum1"); - xNumberingStyles->getByName("WWNum2"); -} - -void Test::testFdo45182() -{ - load("fdo45182.rtf"); - - uno::Reference xFootnotesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); - uno::Reference xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); - // Encoding in the footnote was wrong. - OUString aExpected("živností", 10, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -void Test::testFdo44176() -{ - load("fdo44176.rtf"); - - uno::Reference xPageStyles(getStyles("PageStyles")); - uno::Reference xFirstPage(xPageStyles->getByName("First Page"), uno::UNO_QUERY); - uno::Reference xDefault(xPageStyles->getByName("Default"), uno::UNO_QUERY); - sal_Int32 nFirstTop = 0, nDefaultTop = 0, nDefaultHeader = 0; - xFirstPage->getPropertyValue("TopMargin") >>= nFirstTop; - xDefault->getPropertyValue("TopMargin") >>= nDefaultTop; - xDefault->getPropertyValue("HeaderHeight") >>= nDefaultHeader; - CPPUNIT_ASSERT_EQUAL(nFirstTop, nDefaultTop + nDefaultHeader); -} - -void Test::testFdo39053() -{ - load("fdo39053.rtf"); - - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - int nAsCharacter = 0; - for (int i = 0; i < xDraws->getCount(); ++i) - { - uno::Reference xPropertySet(xDraws->getByIndex(i), uno::UNO_QUERY); - text::TextContentAnchorType eValue; - xPropertySet->getPropertyValue("AnchorType") >>= eValue; - if (eValue == text::TextContentAnchorType_AS_CHARACTER) - nAsCharacter++; - } - // The image in binary format was ignored. - CPPUNIT_ASSERT_EQUAL(1, nAsCharacter); -} - -void Test::testFdo48356() -{ - load("fdo48356.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - OUStringBuffer aBuf; - int i = 0; - while (xParaEnum->hasMoreElements()) - { - xParaEnum->nextElement(); - i++; - } - // The document used to be imported as two paragraphs. - CPPUNIT_ASSERT_EQUAL(1, i); -} - -void Test::testFdo48023() -{ - lang::Locale aLocale; - aLocale.Language = "ru"; - AllSettings aSettings(Application::GetSettings()); - AllSettings aSavedSettings(aSettings); - aSettings.SetLocale(aLocale); - Application::SetSettings(aSettings); - load("fdo48023.rtf"); - Application::SetSettings(aSavedSettings); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); - uno::Reference xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY); - - // Implicit encoding detection based on locale was missing - OUString aExpected("Программист", 22, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -void Test::testFdo48876() -{ - load("fdo48876.rtf"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - CPPUNIT_ASSERT(xParaEnum->hasMoreElements()); - uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); - style::LineSpacing aSpacing; - xPropertySet->getPropertyValue("ParaLineSpacing") >>= aSpacing; - CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, aSpacing.Mode); -} - -void Test::testFdo48193() -{ - load("fdo48193.rtf"); - CPPUNIT_ASSERT_EQUAL(7, getLength()); -} - -void Test::testFdo44211() -{ - lang::Locale aLocale; - aLocale.Language = "lt"; - AllSettings aSettings(Application::GetSettings()); - AllSettings aSavedSettings(aSettings); - aSettings.SetLocale(aLocale); - Application::SetSettings(aSettings); - load("fdo44211.rtf"); - Application::SetSettings(aSavedSettings); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xRangeEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRangeEnum = xRangeEnumAccess->createEnumeration(); - uno::Reference xTextRange(xRangeEnum->nextElement(), uno::UNO_QUERY); - - OUString aExpected("ąčę", 6, RTL_TEXTENCODING_UTF8); - CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); -} - -void Test::testFdo48037() -{ - load("fdo48037.rtf"); - - uno::Reference 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 xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); - uno::Reference xFields(xFieldsAccess->createEnumeration()); - uno::Reference xPropertySet(xFields->nextElement(), uno::UNO_QUERY); - sal_Int32 nActual = 0; - xPropertySet->getPropertyValue("NumberFormat") >>= nActual; - - CPPUNIT_ASSERT_EQUAL(nExpected, nActual); -} - -void Test::testFdo47764() -{ - load("fdo47764.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue = 0; - // \cbpat with zero argument should mean the auto (-1) color, not a default color (black) - xPropertySet->getPropertyValue("ParaBackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue); -} - -void Test::testFdo38786() -{ - load("fdo38786.rtf"); - - uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); - uno::Reference xFields(xFieldsAccess->createEnumeration()); - // \chpgn was ignored, so exception was thrown - xFields->nextElement(); -} - -void Test::testN757651() -{ - load("n757651.rtf"); - - // The bug was that due to buggy layout the text expanded to two pages. - if (Application::GetDefaultDevice()->IsFontAvailable(OUString("Times New Roman"))) - CPPUNIT_ASSERT_EQUAL(1, getPages()); -} - -void Test::testFdo49501() -{ - load("fdo49501.rtf"); - - uno::Reference xStyle(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); - - sal_Bool bIsLandscape = sal_False; - xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape; - CPPUNIT_ASSERT_EQUAL(sal_True, bIsLandscape); - sal_Int32 nExpected(TWIP_TO_MM100(567)); - sal_Int32 nValue = 0; - xStyle->getPropertyValue("LeftMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(nExpected, nValue); - xStyle->getPropertyValue("RightMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(nExpected, nValue); - xStyle->getPropertyValue("TopMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(nExpected, nValue); - xStyle->getPropertyValue("BottomMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(nExpected, nValue); -} - -void Test::testFdo49271() -{ - load("fdo49271.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - xParaEnum->nextElement(); - uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); - float fValue = 0; - xPropertySet->getPropertyValue("CharHeight") >>= fValue; - - CPPUNIT_ASSERT_EQUAL(25.f, fValue); -} - -void Test::testFdo49692() -{ - load("fdo49692.rtf"); - - uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); - uno::Reference xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); - uno::Sequence aProps; - xLevels->getByIndex(0) >>= aProps; // 1st level - - for (int i = 0; i < aProps.getLength(); ++i) - { - const beans::PropertyValue& rProp = aProps[i]; - - if (rProp.Name == "Suffix") - { - rtl::OUString sValue; - rProp.Value >>= sValue; - - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength()); - } - } -} - -void Test::testFdo45190() -{ - load("fdo45190.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - - // inherited \fi should be reset - uno::Reference xPropertySet(xParaEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValue); - - // but direct one not - xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY); - xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), nValue); -} - -void Test::testFdo50539() -{ - load("fdo50539.rtf"); - - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); - uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRunEnum = xRunEnumAccess->createEnumeration(); - uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); - sal_Int32 nValue = 0; - // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black) - xPropertySet->getPropertyValue("CharBackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), nValue); -} - -void Test::testFdo50665() -{ - load("fdo50665.rtf"); - uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); - uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); - uno::Reference xParaEnum(xParaEnumAccess->createEnumeration()); - uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); - uno::Reference xRunEnum(xRunEnumAccess->createEnumeration()); - - // Access the second run, which is a textfield - xRunEnum->nextElement(); - uno::Reference xRun(xRunEnum->nextElement(), uno::UNO_QUERY); - OUString aValue; - xRun->getPropertyValue("CharFontName") >>= aValue; - // This used to be the default, as character properties were ignored. - CPPUNIT_ASSERT_EQUAL(OUString("Book Antiqua"), aValue); -} - -void Test::testFdo49659() -{ - load("fdo49659.rtf"); - - // Both tables were ignored: 1) was in the header, 2) was ignored due to missing empty par at the end of the doc - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount()); - - // The graphic was also empty - uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - uno::Reference xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); - uno::Reference xGraphic; - xPropertySet->getPropertyValue("Graphic") >>= xGraphic; - sal_Int8 nValue = 0; - xGraphic->getPropertyValue("GraphicType") >>= nValue; - CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, nValue); -} - -void Test::testFdo46966() -{ - /* - * The problem was the top margin was 1440 (1 inch), but it should be 720 (0.5 inch). - * - * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin - */ - load("fdo46966.rtf"); - - uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("TopMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), nValue); -} - -CPPUNIT_TEST_SUITE_REGISTRATION(Test); - -CPPUNIT_PLUGIN_IMPLEMENT(); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8import/data/n652364.doc b/sw/qa/extras/ww8import/data/n652364.doc new file mode 100644 index 000000000000..f7a0fe0d57d7 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n652364.doc differ diff --git a/sw/qa/extras/ww8import/data/n750255.doc b/sw/qa/extras/ww8import/data/n750255.doc new file mode 100644 index 000000000000..c0475c4ede26 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n750255.doc differ diff --git a/sw/qa/extras/ww8import/data/n757118.doc b/sw/qa/extras/ww8import/data/n757118.doc new file mode 100644 index 000000000000..2c69485212a1 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n757118.doc differ diff --git a/sw/qa/extras/ww8import/data/n757905.doc b/sw/qa/extras/ww8import/data/n757905.doc new file mode 100644 index 000000000000..0fb7b097cd00 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n757905.doc differ diff --git a/sw/qa/extras/ww8import/data/n757910.doc b/sw/qa/extras/ww8import/data/n757910.doc new file mode 100644 index 000000000000..49a0e59f8440 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n757910.doc differ diff --git a/sw/qa/extras/ww8import/data/n760294.doc b/sw/qa/extras/ww8import/data/n760294.doc new file mode 100644 index 000000000000..04960d060b15 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n760294.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx new file mode 100644 index 000000000000..a3bdb978dba6 --- /dev/null +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -0,0 +1,230 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna (SUSE, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2012 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../swmodeltestbase.hxx" + +#include +#include +#include +#include +#include +#include + +#include + +using rtl::OString; +using rtl::OUString; +using rtl::OUStringBuffer; + +class Test : public SwModelTestBase +{ +public: + void testN757910(); + void testN760294(); + void testN750255(); + void testN652364(); + void testN757118(); + void testN757905(); + + CPPUNIT_TEST_SUITE(Test); +#if !defined(MACOSX) && !defined(WNT) + CPPUNIT_TEST(testN757910); + CPPUNIT_TEST(testN760294); + CPPUNIT_TEST(testN750255); + CPPUNIT_TEST(testN652364); + CPPUNIT_TEST(testN757118); + CPPUNIT_TEST(testN757905); +#endif + CPPUNIT_TEST_SUITE_END(); + +private: + /// Load a WW8 file and make the document available via mxComponent. + void load(const OUString& rURL); +}; + +void Test::load(const OUString& rFilename) +{ + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ww8import/data/") + rFilename); +} + +void Test::testN757910() +{ + load("n757910.doc"); + + // The internal margin was larger than 0.28cm + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + sal_Int32 nValue = 0; + xPropertySet->getPropertyValue("LeftBorderDistance") >>= nValue; + CPPUNIT_ASSERT_EQUAL(sal_Int32(280), nValue); + + // The border width was zero + table::BorderLine2 aBorder; + xPropertySet->getPropertyValue("LeftBorder") >>= aBorder; + CPPUNIT_ASSERT(aBorder.LineWidth > 0); +} + +void Test::testN760294() +{ + load("n760294.doc"); + + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + table::TableBorder aTableBorder; + xTable->getPropertyValue("TableBorder") >>= aTableBorder; + CPPUNIT_ASSERT_EQUAL(aTableBorder.TopLine.InnerLineWidth, aTableBorder.TopLine.OuterLineWidth); + CPPUNIT_ASSERT_EQUAL(aTableBorder.TopLine.InnerLineWidth, aTableBorder.TopLine.LineDistance); +} + +void Test::testN750255() +{ + load( "n750255.doc" ); + +/* +Column break without columns on the page is a page break, so check those paragraphs +are on page 2 (page style 'Convert 1') and page 3 (page style 'Convert 2') +enum = ThisComponent.Text.createEnumeration +enum.nextElement +para1 = enum.nextElement +xray para1.String +xray para1.PageStyleName +para2 = enum.nextElement +xray para2.String +xray para2.PageStyleName +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + // go to 1st paragraph + (void) paraEnum->nextElement(); + // get the 2nd and 3rd paragraph + uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference text1(paragraph1, uno::UNO_QUERY); + uno::Reference text2(paragraph2, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "one" ), text1->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "two" ), text2->getString()); + uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); + uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); + OUString pageStyle1, pageStyle2; + paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; + paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; + CPPUNIT_ASSERT_EQUAL( OUString( "Convert 1" ), pageStyle1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Convert 2" ), pageStyle2 ); + +} + +void Test::testN652364() +{ + load( "n652364.doc" ); + +/* +Related to 750255 above, column break with columns on the page however should be a column break. +enum = ThisComponent.Text.createEnumeration +enum.nextElement +para1 = enum.nextElement +xray para1.String +xray para1.PageStyleName +enum.nextElement +para2 = enum.nextElement +xray para2.String +xray para2.PageStyleName +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference paraEnum = paraEnumAccess->createEnumeration(); + // get the 2nd and 4th paragraph + (void) paraEnum->nextElement(); + uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); + (void) paraEnum->nextElement(); + uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); + uno::Reference text1(paragraph1, uno::UNO_QUERY); + uno::Reference text2(paragraph2, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( OUString( "text1" ), text1->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "text2" ), text2->getString()); + uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); + uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); + OUString pageStyle1, pageStyle2; + paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; + paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; + // "Standard" is the style for the first page (2nd is "Convert 1"). + CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 ); +} + +void Test::testN757118() +{ + load( "n757118.doc" ); +/* +Two pairs of horizontal rules (one absolute width, one relative width) +have the same width (full page width, half page width). +xray ThisComponent.DrawPage.getByIndex(0).BoundRect +*/ + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference drawPage = drawPageSupplier->getDrawPage(); + uno::Reference rule1, rule2, rule3, rule4; + drawPage->getByIndex(0) >>= rule1; + drawPage->getByIndex(1) >>= rule2; + drawPage->getByIndex(2) >>= rule3; + drawPage->getByIndex(3) >>= rule4; + uno::Reference ruleProperties1(rule1, uno::UNO_QUERY); + uno::Reference ruleProperties2(rule2, uno::UNO_QUERY); + uno::Reference ruleProperties3(rule3, uno::UNO_QUERY); + uno::Reference ruleProperties4(rule4, uno::UNO_QUERY); + awt::Rectangle boundRect1, boundRect2, boundRect3, boundRect4; + ruleProperties1->getPropertyValue( "BoundRect" ) >>= boundRect1; + ruleProperties2->getPropertyValue( "BoundRect" ) >>= boundRect2; + ruleProperties3->getPropertyValue( "BoundRect" ) >>= boundRect3; + ruleProperties4->getPropertyValue( "BoundRect" ) >>= boundRect4; + // compare, allow for < 5 differences because of rounding errors + CPPUNIT_ASSERT( abs( boundRect1.Width - boundRect3.Width ) < 5 ); + CPPUNIT_ASSERT( abs( boundRect2.Width - boundRect4.Width ) < 5 ); +} + +void Test::testN757905() +{ + // The problem was that the paragraph had only a single fly + // (as-character-anchored), and the height of that was smallar than the + // paragraph height. When in Word-compat mode, we should take the max of + // the two, not just the height of the fly. + + load("n757905.doc"); + + OUString aHeight = parseDump("/root/page/body/txt/infos/bounds", "height"); + CPPUNIT_ASSERT(sal_Int32(31) < aHeight.toInt32()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8tok/data/n652364.doc b/sw/qa/extras/ww8tok/data/n652364.doc deleted file mode 100644 index f7a0fe0d57d7..000000000000 Binary files a/sw/qa/extras/ww8tok/data/n652364.doc and /dev/null differ diff --git a/sw/qa/extras/ww8tok/data/n750255.doc b/sw/qa/extras/ww8tok/data/n750255.doc deleted file mode 100644 index c0475c4ede26..000000000000 Binary files a/sw/qa/extras/ww8tok/data/n750255.doc and /dev/null differ diff --git a/sw/qa/extras/ww8tok/data/n757118.doc b/sw/qa/extras/ww8tok/data/n757118.doc deleted file mode 100644 index 2c69485212a1..000000000000 Binary files a/sw/qa/extras/ww8tok/data/n757118.doc and /dev/null differ diff --git a/sw/qa/extras/ww8tok/data/n757905.doc b/sw/qa/extras/ww8tok/data/n757905.doc deleted file mode 100644 index 0fb7b097cd00..000000000000 Binary files a/sw/qa/extras/ww8tok/data/n757905.doc and /dev/null differ diff --git a/sw/qa/extras/ww8tok/data/n757910.doc b/sw/qa/extras/ww8tok/data/n757910.doc deleted file mode 100644 index 49a0e59f8440..000000000000 Binary files a/sw/qa/extras/ww8tok/data/n757910.doc and /dev/null differ diff --git a/sw/qa/extras/ww8tok/data/n760294.doc b/sw/qa/extras/ww8tok/data/n760294.doc deleted file mode 100644 index 04960d060b15..000000000000 Binary files a/sw/qa/extras/ww8tok/data/n760294.doc and /dev/null differ diff --git a/sw/qa/extras/ww8tok/ww8tok.cxx b/sw/qa/extras/ww8tok/ww8tok.cxx deleted file mode 100644 index 53f90301e157..000000000000 --- a/sw/qa/extras/ww8tok/ww8tok.cxx +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Initial Developer of the Original Code is - * Miklos Vajna (SUSE, Inc.) - * Portions created by the Initial Developer are Copyright (C) 2012 the - * Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#include "../swmodeltestbase.hxx" - -#include -#include -#include -#include -#include -#include - -#include - -using rtl::OString; -using rtl::OUString; -using rtl::OUStringBuffer; - -class Test : public SwModelTestBase -{ -public: - void testN757910(); - void testN760294(); - void testN750255(); - void testN652364(); - void testN757118(); - void testN757905(); - - CPPUNIT_TEST_SUITE(Test); -#if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testN757910); - CPPUNIT_TEST(testN760294); - CPPUNIT_TEST(testN750255); - CPPUNIT_TEST(testN652364); - CPPUNIT_TEST(testN757118); - CPPUNIT_TEST(testN757905); -#endif - CPPUNIT_TEST_SUITE_END(); - -private: - /// Load a WW8 file and make the document available via mxComponent. - void load(const OUString& rURL); -}; - -void Test::load(const OUString& rFilename) -{ - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ww8tok/data/") + rFilename); -} - -void Test::testN757910() -{ - load("n757910.doc"); - - // The internal margin was larger than 0.28cm - uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - sal_Int32 nValue = 0; - xPropertySet->getPropertyValue("LeftBorderDistance") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(280), nValue); - - // The border width was zero - table::BorderLine2 aBorder; - xPropertySet->getPropertyValue("LeftBorder") >>= aBorder; - CPPUNIT_ASSERT(aBorder.LineWidth > 0); -} - -void Test::testN760294() -{ - load("n760294.doc"); - - uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - table::TableBorder aTableBorder; - xTable->getPropertyValue("TableBorder") >>= aTableBorder; - CPPUNIT_ASSERT_EQUAL(aTableBorder.TopLine.InnerLineWidth, aTableBorder.TopLine.OuterLineWidth); - CPPUNIT_ASSERT_EQUAL(aTableBorder.TopLine.InnerLineWidth, aTableBorder.TopLine.LineDistance); -} - -void Test::testN750255() -{ - load( "n750255.doc" ); - -/* -Column break without columns on the page is a page break, so check those paragraphs -are on page 2 (page style 'Convert 1') and page 3 (page style 'Convert 2') -enum = ThisComponent.Text.createEnumeration -enum.nextElement -para1 = enum.nextElement -xray para1.String -xray para1.PageStyleName -para2 = enum.nextElement -xray para2.String -xray para2.PageStyleName -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference paraEnum = paraEnumAccess->createEnumeration(); - // go to 1st paragraph - (void) paraEnum->nextElement(); - // get the 2nd and 3rd paragraph - uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference text1(paragraph1, uno::UNO_QUERY); - uno::Reference text2(paragraph2, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "one" ), text1->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "two" ), text2->getString()); - uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); - uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); - OUString pageStyle1, pageStyle2; - paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; - paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; - CPPUNIT_ASSERT_EQUAL( OUString( "Convert 1" ), pageStyle1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Convert 2" ), pageStyle2 ); - -} - -void Test::testN652364() -{ - load( "n652364.doc" ); - -/* -Related to 750255 above, column break with columns on the page however should be a column break. -enum = ThisComponent.Text.createEnumeration -enum.nextElement -para1 = enum.nextElement -xray para1.String -xray para1.PageStyleName -enum.nextElement -para2 = enum.nextElement -xray para2.String -xray para2.PageStyleName -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); - // list of paragraphs - uno::Reference paraEnum = paraEnumAccess->createEnumeration(); - // get the 2nd and 4th paragraph - (void) paraEnum->nextElement(); - uno::Reference paragraph1(paraEnum->nextElement(), uno::UNO_QUERY); - (void) paraEnum->nextElement(); - uno::Reference paragraph2(paraEnum->nextElement(), uno::UNO_QUERY); - uno::Reference text1(paragraph1, uno::UNO_QUERY); - uno::Reference text2(paragraph2, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( OUString( "text1" ), text1->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "text2" ), text2->getString()); - uno::Reference paragraphProperties1(paragraph1, uno::UNO_QUERY); - uno::Reference paragraphProperties2(paragraph2, uno::UNO_QUERY); - OUString pageStyle1, pageStyle2; - paragraphProperties1->getPropertyValue( "PageStyleName" ) >>= pageStyle1; - paragraphProperties2->getPropertyValue( "PageStyleName" ) >>= pageStyle2; - // "Standard" is the style for the first page (2nd is "Convert 1"). - CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle1 ); - CPPUNIT_ASSERT_EQUAL( OUString( "Standard" ), pageStyle2 ); -} - -void Test::testN757118() -{ - load( "n757118.doc" ); -/* -Two pairs of horizontal rules (one absolute width, one relative width) -have the same width (full page width, half page width). -xray ThisComponent.DrawPage.getByIndex(0).BoundRect -*/ - uno::Reference textDocument(mxComponent, uno::UNO_QUERY); - uno::Reference drawPageSupplier(textDocument, uno::UNO_QUERY); - uno::Reference drawPage = drawPageSupplier->getDrawPage(); - uno::Reference rule1, rule2, rule3, rule4; - drawPage->getByIndex(0) >>= rule1; - drawPage->getByIndex(1) >>= rule2; - drawPage->getByIndex(2) >>= rule3; - drawPage->getByIndex(3) >>= rule4; - uno::Reference ruleProperties1(rule1, uno::UNO_QUERY); - uno::Reference ruleProperties2(rule2, uno::UNO_QUERY); - uno::Reference ruleProperties3(rule3, uno::UNO_QUERY); - uno::Reference ruleProperties4(rule4, uno::UNO_QUERY); - awt::Rectangle boundRect1, boundRect2, boundRect3, boundRect4; - ruleProperties1->getPropertyValue( "BoundRect" ) >>= boundRect1; - ruleProperties2->getPropertyValue( "BoundRect" ) >>= boundRect2; - ruleProperties3->getPropertyValue( "BoundRect" ) >>= boundRect3; - ruleProperties4->getPropertyValue( "BoundRect" ) >>= boundRect4; - // compare, allow for < 5 differences because of rounding errors - CPPUNIT_ASSERT( abs( boundRect1.Width - boundRect3.Width ) < 5 ); - CPPUNIT_ASSERT( abs( boundRect2.Width - boundRect4.Width ) < 5 ); -} - -void Test::testN757905() -{ - // The problem was that the paragraph had only a single fly - // (as-character-anchored), and the height of that was smallar than the - // paragraph height. When in Word-compat mode, we should take the max of - // the two, not just the height of the fly. - - load("n757905.doc"); - - OUString aHeight = parseDump("/root/page/body/txt/infos/bounds", "height"); - CPPUNIT_ASSERT(sal_Int32(31) < aHeight.toInt32()); -} - -CPPUNIT_TEST_SUITE_REGISTRATION(Test); - -CPPUNIT_PLUGIN_IMPLEMENT(); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit