[Libreoffice-commits] .: sw/CppunitTest_sw_subsequent_odfimport.mk sw/CppunitTest_sw_subsequent_odftok.mk sw/CppunitTest_sw_subsequent_ooxmlimport.mk sw/CppunitTest_sw_subsequent_ooxmltok.mk sw/CppunitTest_sw_subsequent_rtfimport.mk sw/CppunitTest_sw_subsequent_rtftok.mk sw/CppunitTest_sw_subsequent_ww8import.mk sw/CppunitTest_sw_subsequent_ww8tok.mk sw/Module_sw.mk sw/qa
Miklos Vajna
vmiklos at kemper.freedesktop.org
Fri Jul 13 07:26:26 PDT 2012
dev/null |binary
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 |binary
sw/qa/extras/odfimport/odfimport.cxx | 71 +
sw/qa/extras/odftok/odftok.cxx | 71 -
sw/qa/extras/ooxmlimport/data/fdo49940.docx |binary
sw/qa/extras/ooxmlimport/data/n652364.docx |binary
sw/qa/extras/ooxmlimport/data/n693238.docx |binary
sw/qa/extras/ooxmlimport/data/n705956-1.docx |binary
sw/qa/extras/ooxmlimport/data/n705956-2.docx |binary
sw/qa/extras/ooxmlimport/data/n747461.docx |binary
sw/qa/extras/ooxmlimport/data/n750255.docx |binary
sw/qa/extras/ooxmlimport/data/n750935.docx |binary
sw/qa/extras/ooxmlimport/data/n751017.docx |binary
sw/qa/extras/ooxmlimport/data/n751054.docx |binary
sw/qa/extras/ooxmlimport/data/n751077.docx |binary
sw/qa/extras/ooxmlimport/data/n751117.docx |binary
sw/qa/extras/ooxmlimport/data/n757890.docx |binary
sw/qa/extras/ooxmlimport/data/n758883.docx |binary
sw/qa/extras/ooxmlimport/data/n760764.docx |binary
sw/qa/extras/ooxmlimport/data/n764005.docx |binary
sw/qa/extras/ooxmlimport/data/n764745-alignment.docx |binary
sw/qa/extras/ooxmlimport/data/n766477.docx |binary
sw/qa/extras/ooxmlimport/data/n766481.docx |binary
sw/qa/extras/ooxmlimport/data/n766487.docx |binary
sw/qa/extras/ooxmlimport/data/numbering1.docx |binary
sw/qa/extras/ooxmlimport/data/smartart.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 743 +++++++++++++++++
sw/qa/extras/ooxmltok/ooxmltok.cxx | 743 -----------------
sw/qa/extras/rtfimport/data/fdo38786.rtf | 2
sw/qa/extras/rtfimport/data/fdo39053.rtf |binary
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/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 |binary
sw/qa/extras/ww8import/data/n750255.doc |binary
sw/qa/extras/ww8import/data/n757118.doc |binary
sw/qa/extras/ww8import/data/n757905.doc |binary
sw/qa/extras/ww8import/data/n757910.doc |binary
sw/qa/extras/ww8import/data/n760294.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 230 +++++
sw/qa/extras/ww8tok/ww8tok.cxx | 230 -----
120 files changed, 2733 insertions(+), 2733 deletions(-)
New commits:
commit 06b6a1da4a19108d0988ebe49c680905ae27d721
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri Jul 13 16:25:03 2012 +0200
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
diff --git a/sw/CppunitTest_sw_subsequent_odfimport.mk b/sw/CppunitTest_sw_subsequent_odfimport.mk
new file mode 100644
index 0000000..006610e
--- /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 <vmiklos at suse.cz> (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 d1e3ad7..0000000
--- 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 <vmiklos at suse.cz> (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 0000000..8e5e3ef
--- /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 <vmiklos at suse.cz> (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 a1683c1..0000000
--- 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 <vmiklos at suse.cz> (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 0000000..33b2303
--- /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 <vmiklos at suse.cz> (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 15a6851..0000000
--- 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 <vmiklos at suse.cz> (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 0000000..cb947e4
--- /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 <vmiklos at suse.cz> (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 d95bfa6..0000000
--- 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 <vmiklos at suse.cz> (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 06cda0a..0f9d9c5 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 0000000..23ce6a4
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 0000000..d473893
--- /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 <vmiklos at suse.cz> (SUSE, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2012 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "../swmodeltestbase.hxx"
+
+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 23ce6a4..0000000
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 bb62a18..0000000
--- 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 <vmiklos at suse.cz> (SUSE, Inc.)
- * Portions created by the Initial Developer are Copyright (C) 2012 the
- * Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-#include "../swmodeltestbase.hxx"
-
-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 0000000..2422844
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 0000000..0845509
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 0000000..5bcda0f
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 0000000..edff3ba
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 0000000..1388185
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 0000000..1064e5d
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 0000000..a0c7370
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 0000000..0dd0159
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 0000000..cdd81cf
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 0000000..49d7d6a
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 0000000..62304e1
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 0000000..17cc9c5
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 0000000..f70368a
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 0000000..1562496
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 0000000..5e479e2
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 0000000..1c0dd9d
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 0000000..d29e980
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 0000000..a144463
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 0000000..e1521ec
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 0000000..85eda0e
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 0000000..55b4af3
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 0000000..7a553f4
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 0000000..fab93b1
--- /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 <vmiklos at suse.cz> (SUSE, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2012 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "../swmodeltestbase.hxx"
+
+#include <com/sun/star/awt/XBitmap.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/SetVariableType.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
+#include <com/sun/star/text/XDependentTextField.hpp>
+#include <com/sun/star/text/XFormField.hpp>
+#include <com/sun/star/text/XPageCursor.hpp>
+#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/text/XTextFramesSupplier.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+
+#include <vcl/svapp.hxx>
+
+#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
+
+using rtl::OString;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
+class Test : public SwModelTestBase
+{
+public:
+ void 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ text::TextContentAnchorType eValue;
+ xPropertySet->getPropertyValue("AnchorType") >>= eValue;
+ CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER);
+}
+
+void Test::testN751117()
+{
+ load("n751117.docx");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+
+ // First shape: the end should be an arrow, should be rotated and should be flipped.
+ uno::Reference<beans::XPropertySet> 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<drawing::XShape> xShape(xPropertySet, uno::UNO_QUERY);
+ awt::Size aActualSize(xShape->getSize());
+ CPPUNIT_ASSERT(aActualSize.Width < 0);
+
+ // The second shape should be a line
+ uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape"));
+}
+
+void Test::testN751017()
+{
+ load("n751017.docx");
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xMasters(xTextFieldsSupplier->getTextFieldMasters());
+ // Make sure we have a variable named foo.
+ CPPUNIT_ASSERT(xMasters->hasByName("com.sun.star.text.FieldMaster.SetExpression.foo"));
+
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+ bool bFoundSet(false), bFoundGet(false);
+ while (xFields->hasMoreElements())
+ {
+ uno::Reference<lang::XServiceInfo> xServiceInfo(xFields->nextElement(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xServiceInfo, uno::UNO_QUERY);
+ sal_Int16 nValue = 0;
+ OUString aValue;
+ if (xServiceInfo->supportsService("com.sun.star.text.TextField.SetExpression"))
+ {
+ bFoundSet = true;
+ uno::Reference<text::XDependentTextField> xDependentTextField(xServiceInfo, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> 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<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ // 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<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> 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<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+ // list of paragraphs
+ uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+ // go to 1st paragraph
+ (void) paraEnum->nextElement();
+ // get the 2nd paragraph
+ uno::Reference<uno::XInterface> paragraph(paraEnum->nextElement(), uno::UNO_QUERY);
+ // text of the paragraph
+ uno::Reference<text::XTextRange> 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<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
+ CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), drawPage->getCount());
+ uno::Reference<drawing::XShape> image;
+ drawPage->getByIndex(0) >>= image;
+ uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
+ uno::Reference<graphic::XGraphic> graphic;
+ imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
+ uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(120), bitmap->getSize().Width );
+ CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(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" );
+/*
+<v:shapetype> must be global, reachable even from <v:shape> inside another <w:pict>
+image = ThisComponent.DrawPage.getByIndex(0)
+xray image.FillColor
+*/
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShape> image;
+ drawPage->getByIndex(0) >>= image;
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
+ uno::Reference<drawing::XShape> 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<beans::XPropertySet> imageProperties1(image1, uno::UNO_QUERY);
+ imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1;
+ imageProperties1->getPropertyValue( "Description" ) >>= descr1;
+ uno::Reference<beans::XPropertySet> imageProperties2(image2, uno::UNO_QUERY);
+ imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2;
+ imageProperties2->getPropertyValue( "Description" ) >>= descr2;
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+ // list of paragraphs
+ uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+ // go to 1st paragraph
+ (void) paraEnum->nextElement();
+ // get the 2nd and 3rd paragraph
+ uno::Reference<uno::XInterface> paragraph1(paraEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<uno::XInterface> paragraph2(paraEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text1(paragraph1, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text2(paragraph2, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( OUString( "one" ), text1->getString());
+ CPPUNIT_ASSERT_EQUAL( OUString( "two" ), text2->getString());
+ uno::Reference<beans::XPropertySet> paragraphProperties1(paragraph1, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+ // list of paragraphs
+ uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+ // get the 2nd and 4th paragraph
+ (void) paraEnum->nextElement();
+ uno::Reference<uno::XInterface> paragraph1(paraEnum->nextElement(), uno::UNO_QUERY);
+ (void) paraEnum->nextElement();
+ uno::Reference<uno::XInterface> paragraph2(paraEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text1(paragraph1, uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text2(paragraph2, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( OUString( "text1" ), text1->getString());
+ CPPUNIT_ASSERT_EQUAL( OUString( "text2" ), text2->getString());
+ uno::Reference<beans::XPropertySet> paragraphProperties1(paragraph1, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
+
+ // Access the second run, which is a textfield
+ xRunEnum->nextElement();
+ uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+
+ // 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc
+
+ uno::Reference<container::XIndexAccess> 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<beans::XPropertySet> 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<text::XTextRange> xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text
+
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ // 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<style::XStyleFamiliesSupplier> styleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> styleFamilies = styleFamiliesSupplier->getStyleFamilies();
+ uno::Reference<container::XNameAccess> pageStyles;
+ styleFamilies->getByName("PageStyles") >>= pageStyles;
+ uno::Reference<uno::XInterface> defaultStyle;
+ pageStyles->getByName("Default") >>= defaultStyle;
+ uno::Reference<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
+ uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<text::XFormField> xFormField(xRun->getPropertyValue("Bookmark"), uno::UNO_QUERY);
+ uno::Reference<container::XNameContainer> xParameters(xFormField->getParameters());
+ uno::Sequence<OUString> 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<beans::XPropertySet> 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
+
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ 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<beans::XPropertySet> 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" );
+/* <w:numPr> in the paragraph itself was overriden by <w:numpr> introduced by the paragraph's <w:pStyle>
+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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+ // list of paragraphs
+ uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+ uno::Reference<uno::XInterface> paragraph(paraEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> text(paragraph, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( OUString( "Text1." ), text->getString());
+ uno::Reference<beans::XPropertySet> xPropertySet( paragraph, uno::UNO_QUERY );
+ OUString numberingStyleName;
+ xPropertySet->getPropertyValue( "NumberingStyleName" ) >>= numberingStyleName;
+ uno::Reference<text::XNumberingRulesSupplier> xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> numberingRules(xNumberingRulesSupplier->getNumberingRules(), uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> 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 2422844..0000000
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 0845509..0000000
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 5bcda0f..0000000
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 edff3ba..0000000
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 1388185..0000000
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 1064e5d..0000000
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 a0c7370..0000000
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 0dd0159..0000000
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 cdd81cf..0000000
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 49d7d6a..0000000
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 62304e1..0000000
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 17cc9c5..0000000
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 f70368a..0000000
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 1562496..0000000
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 5e479e2..0000000
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 1c0dd9d..0000000
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 d29e980..0000000
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 a144463..0000000
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 e1521ec..0000000
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 85eda0e..0000000
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 55b4af3..0000000
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 7a553f4..0000000
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 28f8dfb..0000000
--- 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 <vmiklos at suse.cz> (SUSE, Inc.)
- * Portions created by the Initial Developer are Copyright (C) 2012 the
- * Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-#include "../swmodeltestbase.hxx"
-
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/text/HoriOrientation.hpp>
-#include <com/sun/star/text/SetVariableType.hpp>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-#include <com/sun/star/text/WrapTextMode.hpp>
-#include <com/sun/star/text/XDependentTextField.hpp>
-#include <com/sun/star/text/XFormField.hpp>
-#include <com/sun/star/text/XPageCursor.hpp>
-#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-#include <com/sun/star/text/XTextFramesSupplier.hpp>
-#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
-#include <com/sun/star/style/ParagraphAdjust.hpp>
-
-#include <vcl/svapp.hxx>
-
-#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-
-using rtl::OString;
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-class Test : public SwModelTestBase
-{
-public:
- void 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
- text::TextContentAnchorType eValue;
- xPropertySet->getPropertyValue("AnchorType") >>= eValue;
- CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER);
-}
-
-void Test::testN751117()
-{
- load("n751117.docx");
-
- uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
-
- // First shape: the end should be an arrow, should be rotated and should be flipped.
- uno::Reference<beans::XPropertySet> 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<drawing::XShape> xShape(xPropertySet, uno::UNO_QUERY);
- awt::Size aActualSize(xShape->getSize());
- CPPUNIT_ASSERT(aActualSize.Width < 0);
-
- // The second shape should be a line
- uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.LineShape"));
-}
-
-void Test::testN751017()
-{
- load("n751017.docx");
- uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XNameAccess> xMasters(xTextFieldsSupplier->getTextFieldMasters());
- // Make sure we have a variable named foo.
- CPPUNIT_ASSERT(xMasters->hasByName("com.sun.star.text.FieldMaster.SetExpression.foo"));
-
- uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
- uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
- bool bFoundSet(false), bFoundGet(false);
- while (xFields->hasMoreElements())
- {
- uno::Reference<lang::XServiceInfo> xServiceInfo(xFields->nextElement(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPropertySet(xServiceInfo, uno::UNO_QUERY);
- sal_Int16 nValue = 0;
- OUString aValue;
- if (xServiceInfo->supportsService("com.sun.star.text.TextField.SetExpression"))
- {
- bFoundSet = true;
- uno::Reference<text::XDependentTextField> xDependentTextField(xServiceInfo, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> 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<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
- uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
- uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
- xCursor->jumpToLastPage();
- // 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<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
- uno::Reference<beans::XPropertySet> 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<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
- uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
- // list of paragraphs
- uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
- // go to 1st paragraph
- (void) paraEnum->nextElement();
- // get the 2nd paragraph
- uno::Reference<uno::XInterface> paragraph(paraEnum->nextElement(), uno::UNO_QUERY);
- // text of the paragraph
- uno::Reference<text::XTextRange> 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<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
- CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), drawPage->getCount());
- uno::Reference<drawing::XShape> image;
- drawPage->getByIndex(0) >>= image;
- uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
- uno::Reference<graphic::XGraphic> graphic;
- imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
- uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(120), bitmap->getSize().Width );
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int32>(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" );
-/*
-<v:shapetype> must be global, reachable even from <v:shape> inside another <w:pict>
-image = ThisComponent.DrawPage.getByIndex(0)
-xray image.FillColor
-*/
- uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
- uno::Reference<drawing::XShape> image;
- drawPage->getByIndex(0) >>= image;
- uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY);
- uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage();
- uno::Reference<drawing::XShape> 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<beans::XPropertySet> imageProperties1(image1, uno::UNO_QUERY);
- imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1;
- imageProperties1->getPropertyValue( "Description" ) >>= descr1;
- uno::Reference<beans::XPropertySet> imageProperties2(image2, uno::UNO_QUERY);
- imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2;
- imageProperties2->getPropertyValue( "Description" ) >>= descr2;
- uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
- // list of paragraphs
- uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
- // go to 1st paragraph
- (void) paraEnum->nextElement();
- // get the 2nd and 3rd paragraph
- uno::Reference<uno::XInterface> paragraph1(paraEnum->nextElement(), uno::UNO_QUERY);
- uno::Reference<uno::XInterface> paragraph2(paraEnum->nextElement(), uno::UNO_QUERY);
- uno::Reference<text::XTextRange> text1(paragraph1, uno::UNO_QUERY);
- uno::Reference<text::XTextRange> text2(paragraph2, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL( OUString( "one" ), text1->getString());
- CPPUNIT_ASSERT_EQUAL( OUString( "two" ), text2->getString());
- uno::Reference<beans::XPropertySet> paragraphProperties1(paragraph1, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> 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<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
- // list of paragraphs
- uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
- // get the 2nd and 4th paragraph
- (void) paraEnum->nextElement();
- uno::Reference<uno::XInterface> paragraph1(paraEnum->nextElement(), uno::UNO_QUERY);
- (void) paraEnum->nextElement();
- uno::Reference<uno::XInterface> paragraph2(paraEnum->nextElement(), uno::UNO_QUERY);
- uno::Reference<text::XTextRange> text1(paragraph1, uno::UNO_QUERY);
- uno::Reference<text::XTextRange> text2(paragraph2, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL( OUString( "text1" ), text1->getString());
- CPPUNIT_ASSERT_EQUAL( OUString( "text2" ), text2->getString());
- uno::Reference<beans::XPropertySet> paragraphProperties1(paragraph1, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> 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<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration());
- uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xRunEnum(xRunEnumAccess->createEnumeration());
-
- // Access the second run, which is a textfield
- xRunEnum->nextElement();
- uno::Reference<beans::XPropertySet> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
- 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
-
- // 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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc
-
- uno::Reference<container::XIndexAccess> 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<beans::XPropertySet> 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<text::XTextRange> xTextRange(xGroup->getByIndex(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text
-
- uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextRange->getText(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list