summaryrefslogtreecommitdiff
path: root/sax/Library_sax.mk
blob: d4149d382b66734647cc186798382855a2491b27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

$(eval $(call gb_Library_Library,sax))

$(eval $(call gb_Library_set_include,sax,\
	-I$(SRCDIR)/sax/inc \
	$$(INCLUDE) \
))

$(eval $(call gb_Library_use_external,sax,boost_headers))

$(eval $(call gb_Library_use_sdk_api,sax))

$(eval $(call gb_Library_use_libraries,sax,\
	comphelper \
	cppu \
	cppuhelper \
	sal \
))

$(eval $(call gb_Library_add_defs,sax,\
	-DSAX_DLLIMPLEMENTATION \
))

$(eval $(call gb_Library_add_exception_objects,sax,\
	sax/source/tools/converter \
	sax/source/tools/fastattribs \
	sax/source/tools/fastserializer \
	sax/source/tools/fshelper \
))

# vim: set noet sw=4 ts=4:
de'>-rw-r--r--avmedia/source/framework/mediaplayer.cxx2
-rw-r--r--avmedia/source/java/makefile.mk2
-rw-r--r--avmedia/source/quicktime/player.cxx75
-rw-r--r--avmedia/source/quicktime/player.hxx2
-rw-r--r--avmedia/source/viewer/mediawindow.cxx2
-rw-r--r--avmedia/source/viewer/mediawindowbase_impl.cxx4
-rw-r--r--basic/inc/basic/basmgr.hxx4
-rw-r--r--basic/inc/basic/sbdef.hxx2
-rw-r--r--basic/inc/basic/sbstar.hxx9
-rw-r--r--basic/inc/basic/sbx.hxx6
-rw-r--r--basic/inc/basic/sbxbase.hxx2
-rw-r--r--basic/inc/basic/sbxobj.hxx2
-rw-r--r--basic/inc/basic/testtool.hxx2
-rw-r--r--basic/inc/pch/precompiled_basic.hxx26
-rw-r--r--basic/source/app/app.cxx2
-rw-r--r--basic/source/app/app.hxx4
-rw-r--r--basic/source/app/appedit.cxx2
-rw-r--r--basic/source/app/dialogs.cxx2
-rw-r--r--basic/source/app/msgedit.cxx2
-rw-r--r--basic/source/app/textedit.hxx2
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx4
-rw-r--r--basic/source/basmgr/basmgr.cxx14
-rw-r--r--basic/source/classes/eventatt.cxx71
-rw-r--r--basic/source/classes/propacc.cxx2
-rw-r--r--basic/source/classes/sb.cxx98
-rw-r--r--basic/source/classes/sbunoobj.cxx15
-rw-r--r--basic/source/classes/sbxmod.cxx75
-rw-r--r--basic/source/comp/codegen.cxx6
-rw-r--r--basic/source/comp/exprgen.cxx2
-rw-r--r--basic/source/comp/symtbl.cxx2
-rw-r--r--basic/source/inc/propacc.hxx2
-rw-r--r--basic/source/inc/symtbl.hxx2
-rw-r--r--basic/source/runtime/ddectrl.cxx2
-rw-r--r--basic/source/runtime/dllmgr.hxx4
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx2
-rw-r--r--basic/source/runtime/runtime.cxx8
-rw-r--r--basic/source/runtime/step1.cxx2
-rw-r--r--basic/source/runtime/step2.cxx53
-rw-r--r--basic/source/sbx/format.src2
-rw-r--r--basic/source/sbx/sbxdate.cxx2
-rw-r--r--basic/source/sbx/sbxobj.cxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx6
-rw-r--r--basic/source/sbx/sbxvar.cxx2
-rw-r--r--basic/source/uno/dlgcont.cxx2
-rw-r--r--basic/source/uno/namecont.cxx14
-rw-r--r--basic/source/uno/scriptcont.cxx2
-rw-r--r--configmgr/qa/unit/common.hxx2
-rw-r--r--configmgr/qa/unit/makefile.mk4
-rw-r--r--configmgr/qa/unit/threading.cxx2
-rw-r--r--connectivity/inc/connectivity/FValue.hxx12
-rw-r--r--connectivity/prj/build.lst2
-rw-r--r--[-rwxr-xr-x]connectivity/qa/connectivity/tools/DbaseDatabase.java3
-rw-r--r--connectivity/qa/connectivity/tools/HsqlDatabase.java3
-rw-r--r--connectivity/source/commontools/FValue.cxx154
-rw-r--r--connectivity/source/commontools/TDatabaseMetaDataBase.cxx4
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx2
-rw-r--r--connectivity/source/drivers/calc/CConnection.cxx2
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx4
-rw-r--r--connectivity/source/drivers/calc/makefile.mk1
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx6
-rw-r--r--connectivity/source/drivers/evoab/LFolderList.cxx6
-rw-r--r--connectivity/source/drivers/evoab/LTable.cxx6
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/makefile.mk2
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx2
-rw-r--r--connectivity/source/drivers/file/fcode.cxx2
-rw-r--r--connectivity/source/drivers/file/quotedstring.cxx2
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx6
-rw-r--r--connectivity/source/drivers/flat/makefile.mk2
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx47
-rw-r--r--connectivity/source/drivers/hsqldb/makefile.mk1
-rw-r--r--connectivity/source/drivers/kab/KConnection.cxx2
-rw-r--r--connectivity/source/drivers/kab/KDEInit.cxx2
-rw-r--r--connectivity/source/drivers/kab/KDatabaseMetaData.cxx2
-rw-r--r--connectivity/source/drivers/kab/KResultSet.hxx2
-rw-r--r--connectivity/source/drivers/kab/kcondition.hxx2
-rw-r--r--connectivity/source/drivers/kab/kfields.hxx2
-rw-r--r--connectivity/source/drivers/kab/korder.hxx2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk113
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk44
-rw-r--r--connectivity/source/drivers/mozab/makefile_mozab.mk128
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/makefile.mk101
-rw-r--r--connectivity/source/inc/resource/hsqldb_res.hrc1
-rw-r--r--connectivity/source/parse/sqlnode.cxx14
-rw-r--r--connectivity/source/resource/conn_shared_res.src5
-rw-r--r--desktop/inc/app.hxx1
-rw-r--r--desktop/prj/build.lst4
-rw-r--r--desktop/prj/d.lst2
-rw-r--r--desktop/qa/deployment_misc/makefile.mk6
-rw-r--r--desktop/qa/deployment_misc/test_dp_version.cxx2
-rw-r--r--desktop/scripts/makefile.mk11
-rw-r--r--desktop/scripts/soffice.sh13
-rw-r--r--desktop/source/app/app.cxx82
-rw-r--r--desktop/source/app/appinit.cxx6
-rw-r--r--desktop/source/app/cmdlineargs.cxx2
-rw-r--r--desktop/source/app/copyright_ascii_ooo.c4
-rw-r--r--desktop/source/app/copyright_ascii_sun.c4
-rw-r--r--desktop/source/app/langselect.cxx14
-rw-r--r--desktop/source/app/langselect.hxx6
-rw-r--r--desktop/source/app/makefile.mk9
-rw-r--r--desktop/source/app/officeipcthread.cxx2
-rw-r--r--desktop/source/app/userinstall.cxx4
-rw-r--r--desktop/source/deployment/dp_persmap.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx28
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx4
-rw-r--r--desktop/source/deployment/makefile.mk1
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx2
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx2
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx2
-rw-r--r--desktop/source/deployment/registry/executable/dp_executable.cxx2
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx9
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx2
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx2
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_sfwk.cxx2
-rw-r--r--desktop/source/migration/makefile.mk1
-rw-r--r--desktop/source/migration/pages.cxx12
-rw-r--r--desktop/source/migration/pages.hxx2
-rw-r--r--desktop/source/pagein/makefile.mk7
-rw-r--r--desktop/source/pkgchk/unopkg/makefile.mk2
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/Installer.java7
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java142
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/RegistrationData.java1004
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java814
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/Registry.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/ServiceTag.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java279
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SunConnection.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java91
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java5
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/Util.java7
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java98
-rw-r--r--desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd667
-rw-r--r--desktop/util/makefile.mk27
-rw-r--r--desktop/util/verinfo.rc60
-rw-r--r--desktop/win32/source/setup/setup.cpp114
-rw-r--r--desktop/win32/source/setup/setup.hxx4
-rw-r--r--desktop/win32/source/setup/setup_main.cxx3
-rw-r--r--desktop/win32/source/setup/setup_main.hxx1
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx12
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx129
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx7
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx123
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx239
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx21
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx51
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx57
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx96
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx55
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx35
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx49
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx39
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx31
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx51
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx28
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx125
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx196
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx137
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx33
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx28
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx132
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx44
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx119
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx55
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx133
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx167
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx29
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx26
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx102
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx30
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx158
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx36
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx29
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx43
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx15
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx45
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx34
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx22
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx17
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx10
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx40
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx25
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx24
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx19
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx86
-rw-r--r--drawinglayer/prj/d.lst4
-rw-r--r--drawinglayer/source/attribute/fillbitmapattribute.cxx16
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx63
-rw-r--r--drawinglayer/source/attribute/makefile.mk1
-rw-r--r--drawinglayer/source/attribute/sdrfillbitmapattribute.cxx2
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx40
-rw-r--r--drawinglayer/source/primitive2d/animatedprimitive2d.cxx141
-rw-r--r--drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/baseprimitive2d.cxx54
-rw-r--r--drawinglayer/source/primitive2d/bitmapprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/borderlineprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx25
-rw-r--r--drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx124
-rw-r--r--drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/epsprimitive2d.cxx111
-rw-r--r--drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx178
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitive2d.cxx582
-rw-r--r--drawinglayer/source/primitive2d/gridprimitive2d.cxx21
-rw-r--r--drawinglayer/source/primitive2d/groupprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/helplineprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/hittestprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/makefile.mk6
-rw-r--r--drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/maskprimitive2d.cxx5
-rw-r--r--drawinglayer/source/primitive2d/mediaprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx3008
-rw-r--r--drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx19
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx30
-rw-r--r--drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx55
-rw-r--r--drawinglayer/source/primitive2d/primitivetools2d.cxx88
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx162
-rw-r--r--drawinglayer/source/primitive2d/shadowprimitive2d.cxx40
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx474
-rw-r--r--drawinglayer/source/primitive2d/texteffectprimitive2d.cxx56
-rw-r--r--drawinglayer/source/primitive2d/textenumsprimitive2d.cxx129
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx58
-rw-r--r--drawinglayer/source/primitive2d/textlineprimitive2d.cxx317
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx63
-rw-r--r--drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx294
-rw-r--r--drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx42
-rw-r--r--drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx276
-rw-r--r--drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/baseprimitive3d.cxx54
-rw-r--r--drawinglayer/source/primitive3d/groupprimitive3d.cxx12
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx22
-rw-r--r--drawinglayer/source/primitive3d/hittestprimitive3d.cxx12
-rw-r--r--drawinglayer/source/primitive3d/polygonprimitive3d.cxx8
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx16
-rw-r--r--drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/sdrprimitive3d.cxx4
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/textureprimitive3d.cxx58
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx53
-rw-r--r--drawinglayer/source/processor2d/contourextractor2d.cxx11
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx161
-rw-r--r--drawinglayer/source/processor2d/linegeometryextractor2d.cxx2
-rw-r--r--drawinglayer/source/processor2d/textaspolygonextractor2d.cxx2
-rw-r--r--drawinglayer/source/processor2d/vclhelperbitmaprender.cxx20
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx175
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx58
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx248
-rw-r--r--drawinglayer/source/processor3d/cutfindprocessor3d.cxx199
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx10
-rw-r--r--drawinglayer/source/processor3d/geometry2dextractor.cxx4
-rw-r--r--drawinglayer/source/processor3d/makefile.mk1
-rw-r--r--drawinglayer/source/processor3d/shadow3dextractor.cxx4
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx4
-rw-r--r--drawinglayer/source/texture/texture.cxx6
-rw-r--r--embeddedobj/source/general/docholder.cxx21
-rw-r--r--formula/inc/formula/opcode.hxx2
-rw-r--r--formula/inc/formula/token.hxx2
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx2
-rw-r--r--formula/source/ui/dlg/FormulaHelper.cxx2
-rw-r--r--formula/source/ui/dlg/formula.cxx6
-rw-r--r--formula/source/ui/dlg/funcpage.cxx4
-rw-r--r--formula/source/ui/dlg/parawin.cxx4
-rw-r--r--formula/source/ui/dlg/structpg.cxx4
-rw-r--r--formula/util/makefile.mk2
-rw-r--r--fpicker/source/aqua/SalAquaPicker.cxx5
-rw-r--r--fpicker/source/aqua/resourceprovider.cxx2
-rw-r--r--fpicker/source/generic/fpicker.cxx2
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx4
-rw-r--r--fpicker/source/office/OfficeFilePicker.src2
-rw-r--r--fpicker/source/office/OfficeFolderPicker.cxx4
-rw-r--r--fpicker/source/office/iodlg.cxx20
-rw-r--r--fpicker/source/office/iodlg.hrc2
-rw-r--r--fpicker/source/office/iodlg.hxx6
-rw-r--r--fpicker/source/office/iodlg.src2
-rw-r--r--fpicker/source/office/iodlgimp.cxx14
-rw-r--r--fpicker/source/office/iodlgimp.hxx2
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.cxx13
-rw-r--r--fpicker/source/unx/gnome/resourceprovider.cxx2
-rw-r--r--fpicker/source/unx/kde4/KDE4FPEntry.cxx6
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx116
-rw-r--r--fpicker/source/win32/misc/resourceprovider.cxx2
-rw-r--r--framework/inc/classes/fwktabwindow.hxx1
-rw-r--r--framework/inc/classes/protocolhandlercache.hxx1
-rw-r--r--framework/inc/dispatch/basedispatcher.hxx2
-rw-r--r--framework/inc/helper/mischelper.hxx2
-rw-r--r--framework/inc/helper/persistentwindowstate.hxx2
-rw-r--r--framework/inc/helper/titlebarupdate.hxx2
-rw-r--r--framework/inc/macros/registration.hxx6
-rw-r--r--framework/inc/pch/precompiled_framework.hxx24
-rw-r--r--framework/inc/properties.h17
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/inc/services/autorecovery.hxx7
-rw-r--r--framework/inc/services/desktop.hxx2
-rw-r--r--framework/inc/services/frame.hxx2
-rw-r--r--framework/inc/services/layoutmanager.hxx38
-rw-r--r--framework/inc/services/licensedlg.hxx2
-rw-r--r--framework/inc/services/pluginframe.hxx2
-rw-r--r--framework/inc/services/sessionlistener.hxx20
-rw-r--r--framework/inc/services/substitutepathvars.hxx1
-rw-r--r--framework/inc/services/tabwindowservice.hxx91
-rw-r--r--framework/inc/xml/eventsconfiguration.hxx2
-rw-r--r--framework/inc/xml/imagesconfiguration.hxx2
-rw-r--r--framework/inc/xml/statusbarconfiguration.hxx2
-rw-r--r--framework/inc/xml/toolboxconfiguration.hxx2
-rwxr-xr-xframework/qa/complex/api_internal/makefile.mk2
-rwxr-xr-xframework/qa/complex/broken_document/makefile.mk2
-rw-r--r--framework/qa/complex/contextMenuInterceptor/makefile.mk2
-rwxr-xr-xframework/qa/complex/disposing/makefile.mk2
-rwxr-xr-xframework/qa/complex/framework/recovery/makefile.mk2
-rwxr-xr-xframework/qa/complex/imageManager/interfaces/makefile.mk2
-rwxr-xr-xframework/qa/complex/imageManager/makefile.mk2
-rwxr-xr-xframework/qa/complex/path_settings/makefile.mk2
-rwxr-xr-xframework/qa/complex/path_substitution/makefile.mk2
-rwxr-xr-xframework/qa/complex/sequence/makefile.mk2
-rw-r--r--framework/source/classes/bmkmenu.cxx2
-rw-r--r--framework/source/classes/fwktabwindow.cxx6
-rw-r--r--framework/source/classes/menumanager.cxx4
-rw-r--r--framework/source/classes/protocolhandlercache.cxx4
-rw-r--r--framework/source/dispatch/closedispatcher.cxx2
-rw-r--r--framework/source/dispatch/startmoduledispatcher.cxx2
-rw-r--r--framework/source/helper/popupmenucontrollerbase.cxx6
-rw-r--r--framework/source/helper/titlebarupdate.cxx6
-rw-r--r--framework/source/helper/titlehelper.cxx2
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx310
-rw-r--r--framework/source/layoutmanager/makefile.mk2
-rw-r--r--framework/source/loadenv/loadenv.cxx2
-rw-r--r--framework/source/register/makefile.mk2
-rw-r--r--framework/source/services/autorecovery.cxx147
-rw-r--r--framework/source/services/backingcomp.cxx2
-rw-r--r--framework/source/services/backingwindow.cxx11
-rw-r--r--framework/source/services/backingwindow.hxx3
-rw-r--r--framework/source/services/frame.cxx2
-rw-r--r--framework/source/services/mediatypedetectionhelper.cxx2
-rw-r--r--framework/source/services/sessionlistener.cxx161
-rw-r--r--framework/source/services/substitutepathvars.cxx5
-rw-r--r--framework/source/services/tabwindowservice.cxx32
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx4
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx4
-rw-r--r--framework/source/uielement/headermenucontroller.cxx4
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx2
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx4
-rw-r--r--framework/source/uielement/menubarmanager.cxx6
-rw-r--r--framework/source/uielement/newmenucontroller.cxx2
-rw-r--r--framework/source/uielement/objectmenucontroller.cxx4
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx2
-rw-r--r--framework/source/uielement/toolbarmanager.cxx10
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx2
-rw-r--r--framework/source/xml/menuconfiguration.cxx4
-rw-r--r--linguistic/inc/lngprops.hxx2
-rw-r--r--linguistic/inc/misc.hxx3
-rw-r--r--linguistic/prj/build.lst2
-rw-r--r--linguistic/source/convdic.cxx97
-rw-r--r--linguistic/source/convdiclist.cxx8
-rw-r--r--linguistic/source/convdiclist.hxx2
-rw-r--r--linguistic/source/convdicxml.cxx3
-rw-r--r--linguistic/source/convdicxml.hxx2
-rw-r--r--linguistic/source/defs.hxx7
-rw-r--r--linguistic/source/dicimp.cxx103
-rw-r--r--linguistic/source/dicimp.hxx3
-rw-r--r--linguistic/source/dlistimp.cxx41
-rw-r--r--linguistic/source/gciterator.cxx6
-rw-r--r--linguistic/source/grammarchecker.cxx1
-rw-r--r--linguistic/source/hhconvdic.cxx1
-rw-r--r--linguistic/source/hyphdsp.cxx16
-rw-r--r--linguistic/source/hyphdta.cxx2
-rw-r--r--linguistic/source/lngopt.cxx3
-rw-r--r--linguistic/source/lngopt.hxx8
-rw-r--r--linguistic/source/lngsvcmgr.cxx19
-rw-r--r--linguistic/source/lngsvcmgr.hxx2
-rw-r--r--linguistic/source/makefile.mk8
-rw-r--r--linguistic/source/misc.cxx9
-rw-r--r--linguistic/source/misc2.cxx2
-rw-r--r--linguistic/source/spelldsp.cxx13
-rw-r--r--linguistic/source/thesdsp.cxx10
-rw-r--r--officecfg/registry/data/org/openoffice/Inet.xcu5
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu8
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Writer.xcu27
-rw-r--r--officecfg/registry/data/org/openoffice/Office/makefile.mk2
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu247
-rw-r--r--officecfg/registry/data/org/openoffice/makefile.mk1
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs41
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Recovery.xcs13
-rw-r--r--oovbaapi/genconstidl/makefile.mk6
-rw-r--r--oovbaapi/ooo/vba/ControlProvider.idl (renamed from svx/source/cui/readonlyimage.hxx)32
-rw-r--r--oovbaapi/ooo/vba/XApplicationBase.idl66
-rw-r--r--oovbaapi/ooo/vba/XCommandBar.idl3
-rw-r--r--oovbaapi/ooo/vba/XCommandBarButton.idl52
-rw-r--r--oovbaapi/ooo/vba/XCommandBarControl.idl2
-rw-r--r--oovbaapi/ooo/vba/XCommandBarPopup.idl52
-rw-r--r--oovbaapi/ooo/vba/XControlProvider.idl (renamed from oovbaapi/ooo/vba/XGlobals.idl)37
-rw-r--r--oovbaapi/ooo/vba/XDialogBase.idl (renamed from svx/source/cui/srchxtra.hrc)38
-rw-r--r--oovbaapi/ooo/vba/XDialogsBase.idl (renamed from svx/source/cui/charmap.hrc)52
-rw-r--r--oovbaapi/ooo/vba/XDocumentBase.idl67
-rw-r--r--oovbaapi/ooo/vba/XDocumentProperties.idl71
-rw-r--r--oovbaapi/ooo/vba/XDocumentProperty.idl106
-rw-r--r--oovbaapi/ooo/vba/XDocumentsBase.idl55
-rw-r--r--oovbaapi/ooo/vba/XFontBase.idl (renamed from svx/source/cui/showcols.hxx)60
-rw-r--r--oovbaapi/ooo/vba/XGlobalsBase.idl53
-rw-r--r--oovbaapi/ooo/vba/XPageSetupBase.idl (renamed from svx/source/cui/bbdlg.hxx)48
-rw-r--r--oovbaapi/ooo/vba/XWindowBase.idl62
-rw-r--r--oovbaapi/ooo/vba/excel/Globals.idl (renamed from oovbaapi/ooo/vba/Globals.idl)12
-rw-r--r--oovbaapi/ooo/vba/excel/TextFrame.idl53
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl14
-rw-r--r--oovbaapi/ooo/vba/excel/XDialog.idl7
-rw-r--r--oovbaapi/ooo/vba/excel/XDialogs.idl11
-rw-r--r--oovbaapi/ooo/vba/excel/XFont.idl13
-rw-r--r--oovbaapi/ooo/vba/excel/XGlobals.idl86
-rw-r--r--oovbaapi/ooo/vba/excel/XPageSetup.idl9
-rw-r--r--oovbaapi/ooo/vba/excel/XTextFrame.idl14
-rw-r--r--oovbaapi/ooo/vba/excel/XVPageBreak.idl54
-rw-r--r--oovbaapi/ooo/vba/excel/XVPageBreaks.idl71
-rw-r--r--oovbaapi/ooo/vba/excel/XWindow.idl9
-rw-r--r--oovbaapi/ooo/vba/excel/XWorkbook.idl17
-rw-r--r--oovbaapi/ooo/vba/excel/XWorkbooks.idl3
-rw-r--r--oovbaapi/ooo/vba/excel/XWorksheet.idl3
-rw-r--r--oovbaapi/ooo/vba/excel/makefile.mk7
-rw-r--r--oovbaapi/ooo/vba/makefile.mk17
-rw-r--r--oovbaapi/ooo/vba/msforms/XControl.idl1
-rw-r--r--oovbaapi/ooo/vba/msforms/XShape.idl17
-rw-r--r--oovbaapi/ooo/vba/msforms/XShapeRange.idl16
-rw-r--r--oovbaapi/ooo/vba/msforms/XShapes.idl1
-rw-r--r--oovbaapi/ooo/vba/msforms/XTextFrame.idl (renamed from sandbox/com/sun/star/lib/sandbox/CodeSource.java)46
-rw-r--r--oovbaapi/ooo/vba/msforms/makefile.mk1
-rw-r--r--oovbaapi/ooo/vba/word/XAddin.idl61
-rw-r--r--oovbaapi/ooo/vba/word/XAddins.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XApplication.idl70
-rw-r--r--oovbaapi/ooo/vba/word/XAutoTextEntries.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XAutoTextEntry.idl59
-rw-r--r--oovbaapi/ooo/vba/word/XBookmark.idl61
-rw-r--r--oovbaapi/ooo/vba/word/XBookmarks.idl61
-rw-r--r--oovbaapi/ooo/vba/word/XBorder.idl (renamed from sandbox/com/sun/star/lib/sandbox/ClassContext.java)39
-rw-r--r--oovbaapi/ooo/vba/word/XBorders.idl (renamed from svx/inc/optasian.hrc)49
-rw-r--r--oovbaapi/ooo/vba/word/XDialog.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XDialogs.idl (renamed from svx/source/cui/doclinkdialog.hrc)33
-rw-r--r--oovbaapi/ooo/vba/word/XDocument.idl75
-rw-r--r--oovbaapi/ooo/vba/word/XDocuments.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XField.idl52
-rw-r--r--oovbaapi/ooo/vba/word/XFields.idl62
-rw-r--r--oovbaapi/ooo/vba/word/XFind.idl87
-rw-r--r--oovbaapi/ooo/vba/word/XFont.idl (renamed from svx/inc/connect.hrc)50
-rw-r--r--oovbaapi/ooo/vba/word/XGlobals.idl (renamed from svx/source/cui/internationaloptions.hxx)55
-rw-r--r--oovbaapi/ooo/vba/word/XHeaderFooter.idl (renamed from svx/source/cui/postdlg.hrc)43
-rw-r--r--oovbaapi/ooo/vba/word/XOptions.idl (renamed from svx/inc/msoleexp.hxx)53
-rw-r--r--oovbaapi/ooo/vba/word/XPageSetup.idl (renamed from svx/source/cui/sdrcelldlg.hxx)51
-rw-r--r--oovbaapi/ooo/vba/word/XPane.idl (renamed from svx/source/cui/iconcdlg.src)46
-rw-r--r--oovbaapi/ooo/vba/word/XPanes.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XParagraph.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XParagraphFormat.idl (renamed from svx/source/cui/multifil.hxx)54
-rw-r--r--oovbaapi/ooo/vba/word/XParagraphs.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XRange.idl78
-rw-r--r--oovbaapi/ooo/vba/word/XReplacement.idl (renamed from svx/inc/defdlgname.hxx)31
-rw-r--r--oovbaapi/ooo/vba/word/XSection.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XSections.idl57
-rw-r--r--oovbaapi/ooo/vba/word/XSelection.idl89
-rw-r--r--oovbaapi/ooo/vba/word/XStyle.idl58
-rw-r--r--oovbaapi/ooo/vba/word/XStyles.idl55
-rw-r--r--oovbaapi/ooo/vba/word/XSystem.idl56
-rw-r--r--oovbaapi/ooo/vba/word/XTable.idl86
-rw-r--r--oovbaapi/ooo/vba/word/XTables.idl79
-rw-r--r--oovbaapi/ooo/vba/word/XTemplate.idl (renamed from svx/inc/optpath.hrc)38
-rw-r--r--oovbaapi/ooo/vba/word/XVariable.idl (renamed from svx/source/cui/cuiexp.cxx)52
-rw-r--r--oovbaapi/ooo/vba/word/XVariables.idl57
-rw-r--r--oovbaapi/ooo/vba/word/XView.idl (renamed from svx/inc/multipat.hrc)44
-rw-r--r--oovbaapi/ooo/vba/word/XWindow.idl (renamed from svx/source/cui/insrc.hxx)58
-rw-r--r--oovbaapi/ooo/vba/word/XWrapFormat.idl (renamed from sandbox/com/sun/star/lib/sandbox/Permission.java)24
-rw-r--r--oovbaapi/ooo/vba/word/makefile.mk (renamed from svx/source/msfilter/makefile.mk)84
-rw-r--r--oovbaapi/prj/build.lst3
-rw-r--r--oovbaapi/util/makefile.mk1
-rwxr-xr-xreadlicense_oo/util/makefile.pmk3
-rw-r--r--sandbox/com/sun/star/lib/sandbox/AudioProxy.java74
-rw-r--r--sandbox/com/sun/star/lib/sandbox/Cachable.java37
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ClassContextImpl.java356
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ClassContextProxy.java152
-rw-r--r--sandbox/com/sun/star/lib/sandbox/Disposable.java36
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ExecutionContext.java473
-rw-r--r--sandbox/com/sun/star/lib/sandbox/Holder.java38
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ImageProducerProxy.java77
-rw-r--r--sandbox/com/sun/star/lib/sandbox/JarEntry.java95
-rw-r--r--sandbox/com/sun/star/lib/sandbox/JarInputStream.java107
-rw-r--r--sandbox/com/sun/star/lib/sandbox/PermissionCollection.java86
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ProtectionDomain.java87
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ResourceImpl.java317
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ResourceProxy.java217
-rw-r--r--sandbox/com/sun/star/lib/sandbox/ResourceViewer.java101
-rw-r--r--sandbox/com/sun/star/lib/sandbox/SandboxMessageHandler.java119
-rw-r--r--sandbox/com/sun/star/lib/sandbox/SandboxSecurity.java1160
-rw-r--r--sandbox/com/sun/star/lib/sandbox/SandboxSecurityException.java71
-rw-r--r--sandbox/com/sun/star/lib/sandbox/WeakRef.java80
-rw-r--r--sandbox/com/sun/star/lib/sandbox/WeakTable.java147
-rw-r--r--sandbox/com/sun/star/lib/sandbox/XImage.java70
-rw-r--r--sandbox/com/sun/star/lib/sandbox/makefile.mk89
-rw-r--r--sandbox/prj/build.lst5
-rw-r--r--sandbox/prj/d.lst1
-rw-r--r--sandbox/test/com/sun/star/lib/sandbox/ResourceTest.java69
-rw-r--r--sandbox/util/delzip0
-rw-r--r--scripting/source/pyprov/mailmerge.py12
-rw-r--r--sfx2/inc/arrdecl.hxx2
-rw-r--r--sfx2/inc/minfitem.hxx2
-rw-r--r--sfx2/inc/msgnodei.hxx4
-rw-r--r--sfx2/inc/orgmgr.hxx2
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx140
-rw-r--r--sfx2/inc/sfx2/app.hxx6
-rw-r--r--sfx2/inc/sfx2/appuno.hxx4
-rw-r--r--sfx2/inc/sfx2/childwin.hxx6
-rw-r--r--sfx2/inc/sfx2/cntids.hrc2
-rw-r--r--sfx2/inc/sfx2/ctrlitem.hxx2
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx72
-rw-r--r--sfx2/inc/sfx2/dispatch.hxx2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx7
-rw-r--r--sfx2/inc/sfx2/event.hxx4
-rw-r--r--sfx2/inc/sfx2/evntconf.hxx4
-rw-r--r--sfx2/inc/sfx2/fcontnr.hxx2
-rw-r--r--sfx2/inc/sfx2/frame.hxx4
-rw-r--r--sfx2/inc/sfx2/frmdescr.hxx4
-rw-r--r--sfx2/inc/sfx2/itemwrapper.hxx8
-rw-r--r--sfx2/inc/sfx2/linkmgr.hxx2
-rw-r--r--sfx2/inc/sfx2/macrconf.hxx2
-rw-r--r--sfx2/inc/sfx2/macropg.hxx2
-rw-r--r--sfx2/inc/sfx2/mnuitem.hxx9
-rw-r--r--sfx2/inc/sfx2/msgpool.hxx2
-rw-r--r--sfx2/inc/sfx2/objitem.hxx2
-rw-r--r--sfx2/inc/sfx2/objsh.hxx7
-rw-r--r--sfx2/inc/sfx2/objuno.hxx2
-rw-r--r--sfx2/inc/sfx2/passwd.hxx4
-rw-r--r--sfx2/inc/sfx2/querystatus.hxx2
-rw-r--r--sfx2/inc/sfx2/request.hxx4
-rw-r--r--sfx2/inc/sfx2/sfx.hrc2
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx2
-rw-r--r--sfx2/inc/sfx2/sfxhtml.hxx2
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc2
-rw-r--r--sfx2/inc/sfx2/sfxstatuslistener.hxx2
-rw-r--r--sfx2/inc/sfx2/shell.hxx2
-rw-r--r--sfx2/inc/sfx2/srchitem.hxx3
-rw-r--r--sfx2/inc/sfx2/tabdlg.hxx4
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx4
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx2
-rw-r--r--sfx2/inc/sorgitm.hxx2
-rw-r--r--sfx2/inc/stbitem.hxx2
-rw-r--r--sfx2/inc/tplpitem.hxx2
-rw-r--r--sfx2/prj/d.lst4
-rw-r--r--sfx2/qa/complex/DocumentMetaData.java50
-rw-r--r--sfx2/sdi/sfxitems.sdi89
-rw-r--r--sfx2/sdi/sfxslots.sdi94
-rw-r--r--sfx2/source/appl/app.cxx47
-rw-r--r--sfx2/source/appl/appbas.cxx16
-rw-r--r--sfx2/source/appl/appcfg.cxx38
-rw-r--r--sfx2/source/appl/appchild.cxx4
-rw-r--r--sfx2/source/appl/appdata.cxx9
-rw-r--r--sfx2/source/appl/appdde.cxx12
-rw-r--r--sfx2/source/appl/appinit.cxx18
-rw-r--r--sfx2/source/appl/appmain.cxx9
-rw-r--r--sfx2/source/appl/appmisc.cxx16
-rw-r--r--sfx2/source/appl/appopen.cxx18
-rw-r--r--sfx2/source/appl/appquit.cxx15
-rw-r--r--sfx2/source/appl/appserv.cxx18
-rw-r--r--sfx2/source/appl/appuno.cxx16
-rw-r--r--sfx2/source/appl/childwin.cxx2
-rw-r--r--sfx2/source/appl/impldde.cxx2
-rw-r--r--sfx2/source/appl/linkmgr2.cxx2
-rw-r--r--sfx2/source/appl/linksrc.cxx2
-rw-r--r--sfx2/source/appl/lnkbase2.cxx2
-rw-r--r--sfx2/source/appl/newhelp.cxx16
-rw-r--r--sfx2/source/appl/newhelp.hxx2
-rw-r--r--sfx2/source/appl/sfxhelp.cxx17
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx10
-rw-r--r--sfx2/source/appl/shutdownicon.cxx31
-rw-r--r--sfx2/source/appl/shutdowniconOs2.cxx4
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm6
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx4
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx4
-rw-r--r--sfx2/source/appl/workwin.cxx10
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx20
-rw-r--r--sfx2/source/bastyp/frmhtml.cxx2
-rw-r--r--sfx2/source/bastyp/frmhtmlw.cxx4
-rw-r--r--sfx2/source/bastyp/progress.cxx2
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx4
-rw-r--r--sfx2/source/config/evntconf.cxx4
-rw-r--r--sfx2/source/control/bindings.cxx19
-rw-r--r--sfx2/source/control/ctrlitem.cxx2
-rw-r--r--sfx2/source/control/dispatch.cxx14
-rw-r--r--sfx2/source/control/macrconf.cxx2
-rw-r--r--sfx2/source/control/makefile.mk6
-rw-r--r--sfx2/source/control/msg.cxx4
-rw-r--r--sfx2/source/control/querystatus.cxx12
-rw-r--r--sfx2/source/control/request.cxx6
-rw-r--r--sfx2/source/control/sfxstatuslistener.cxx12
-rw-r--r--sfx2/source/control/shell.cxx10
-rw-r--r--sfx2/source/control/srchitem.cxx7
-rw-r--r--sfx2/source/control/statcach.cxx8
-rw-r--r--sfx2/source/control/unoctitm.cxx12
-rw-r--r--sfx2/source/dialog/alienwarn.cxx2
-rw-r--r--sfx2/source/dialog/basedlgs.cxx4
-rw-r--r--sfx2/source/dialog/dialog.hrc2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx375
-rw-r--r--sfx2/source/dialog/dinfdlg.hrc22
-rw-r--r--sfx2/source/dialog/dinfdlg.src222
-rw-r--r--sfx2/source/dialog/dockwin.cxx2
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx18
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx2
-rw-r--r--sfx2/source/dialog/intro.cxx2
-rw-r--r--sfx2/source/dialog/itemconnect.cxx2
-rw-r--r--sfx2/source/dialog/mailmodel.cxx2
-rw-r--r--sfx2/source/dialog/mailmodelapi.cxx6
-rw-r--r--sfx2/source/dialog/mgetempl.cxx8
-rw-r--r--sfx2/source/dialog/newstyle.cxx2
-rw-r--r--sfx2/source/dialog/passwd.cxx28
-rw-r--r--sfx2/source/dialog/printopt.cxx4
-rw-r--r--sfx2/source/dialog/recfloat.cxx2
-rw-r--r--sfx2/source/dialog/splitwin.cxx2
-rw-r--r--sfx2/source/dialog/srchdlg.cxx2
-rw-r--r--sfx2/source/dialog/styledlg.cxx4
-rw-r--r--sfx2/source/dialog/tabdlg.cxx4
-rw-r--r--sfx2/source/dialog/templdlg.cxx12
-rw-r--r--sfx2/source/dialog/tplcitem.cxx2
-rw-r--r--sfx2/source/dialog/versdlg.cxx12
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx198
-rw-r--r--sfx2/source/doc/applet.cxx2
-rw-r--r--sfx2/source/doc/doc.src2
-rw-r--r--sfx2/source/doc/docfac.cxx4
-rw-r--r--sfx2/source/doc/docfile.cxx197
-rw-r--r--sfx2/source/doc/docinsert.cxx10
-rw-r--r--sfx2/source/doc/docmacromode.cxx2
-rw-r--r--sfx2/source/doc/doctdlg.cxx2
-rw-r--r--sfx2/source/doc/doctempl.cxx2
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rw-r--r--sfx2/source/doc/docvor.cxx18
-rw-r--r--sfx2/source/doc/frmdescr.cxx2
-rw-r--r--sfx2/source/doc/guisaveas.cxx11
-rw-r--r--sfx2/source/doc/makefile.mk8
-rw-r--r--sfx2/source/doc/new.cxx4
-rw-r--r--sfx2/source/doc/objcont.cxx64
-rw-r--r--sfx2/source/doc/objmisc.cxx39
-rw-r--r--sfx2/source/doc/objserv.cxx28
-rw-r--r--sfx2/source/doc/objstor.cxx29
-rw-r--r--sfx2/source/doc/objuno.cxx2
-rw-r--r--sfx2/source/doc/objxtor.cxx16
-rwxr-xr-xsfx2/source/doc/printhelper.cxx8
-rwxr-xr-xsfx2/source/doc/sfxacldetect.cxx108
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
-rw-r--r--sfx2/source/explorer/nochaos.cxx6
-rw-r--r--sfx2/source/inc/appdata.hxx4
-rw-r--r--sfx2/source/inc/applet.hxx4
-rw-r--r--sfx2/source/inc/eventsupplier.hxx4
-rw-r--r--sfx2/source/inc/helpid.hrc3
-rw-r--r--sfx2/source/inc/iframe.hxx4
-rw-r--r--sfx2/source/inc/objshimp.hxx2
-rw-r--r--sfx2/source/inc/plugin.hxx4
-rw-r--r--sfx2/source/inc/sfxlocal.hrc5
-rw-r--r--sfx2/source/inc/sfxpicklist.hxx2
-rw-r--r--sfx2/source/inc/templdgi.hxx6
-rw-r--r--sfx2/source/inc/virtmenu.hxx2
-rw-r--r--sfx2/source/inc/workwin.hxx2
-rw-r--r--sfx2/source/inet/inettbc.cxx16
-rw-r--r--sfx2/source/layout/sfxtabdialog.cxx4
-rw-r--r--sfx2/source/menu/mnuitem.cxx28
-rw-r--r--sfx2/source/menu/mnumgr.cxx4
-rw-r--r--sfx2/source/menu/objmnctl.cxx2
-rw-r--r--sfx2/source/menu/virtmenu.cxx32
-rw-r--r--sfx2/source/notify/eventsupplier.cxx6
-rw-r--r--sfx2/source/statbar/stbitem.cxx8
-rw-r--r--sfx2/source/toolbox/imgmgr.cxx8
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx20
-rw-r--r--sfx2/source/view/frame.cxx6
-rw-r--r--sfx2/source/view/frmload.cxx8
-rw-r--r--sfx2/source/view/impframe.cxx2
-rw-r--r--sfx2/source/view/impframe.hxx2
-rw-r--r--sfx2/source/view/ipclient.cxx2
-rw-r--r--sfx2/source/view/printer.cxx2
-rw-r--r--sfx2/source/view/prnmon.cxx4
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx24
-rw-r--r--sfx2/source/view/topfrm.cxx16
-rw-r--r--sfx2/source/view/viewfrm.cxx16
-rw-r--r--sfx2/source/view/viewprn.cxx2052
-rw-r--r--sfx2/source/view/viewsh.cxx14
-rw-r--r--shell/inc/internal/config.hxx5
-rw-r--r--shell/inc/internal/utilities.hxx21
-rw-r--r--shell/inc/internal/xml_parser.hxx11
-rw-r--r--shell/inc/kde_headers.h97
-rw-r--r--shell/prj/build.lst2
-rwxr-xr-x[-rw-r--r--]shell/prj/d.lst4
-rwxr-xr-xshell/qa/makefile.mk12
-rwxr-xr-xshell/qa/recent_docs.cxx2
-rw-r--r--shell/source/all/xml_parser.cxx14
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.cxx3
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.hxx5
-rw-r--r--shell/source/backends/kdebe/kdebecdef.cxx2
-rw-r--r--shell/source/backends/kdebe/kdecommonlayer.cxx2
-rwxr-xr-x[-rw-r--r--]shell/source/backends/kdebe/kdeinetlayer.hxx2
-rw-r--r--shell/source/backends/kdebe/kdepathslayer.cxx2
-rw-r--r--shell/source/backends/kdebe/kdevcllayer.cxx2
-rw-r--r--shell/source/backends/kdebe/makefile.mk4
-rw-r--r--shell/source/backends/localebe/localebackend.cxx6
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx44
-rw-r--r--shell/source/unix/sysshell/recently_used_file.cxx6
-rw-r--r--shell/source/unix/sysshell/recently_used_file.hxx3
-rw-r--r--shell/source/unix/sysshell/recently_used_file_handler.cxx20
-rw-r--r--shell/source/win32/shlxthandler/infotips/infotips.cxx2
-rw-r--r--shell/source/win32/shlxthandler/makefile.mk13
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx4
-rw-r--r--shell/source/win32/shlxthandler/propsheets/propsheets.cxx3
-rw-r--r--shell/source/win32/shlxthandler/res/makefile.mk10
-rw-r--r--shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx18
-rw-r--r--shell/source/win32/shlxthandler/util/utilities.cxx15
-rw-r--r--svx/inc/bolnitem.hxx2
-rw-r--r--svx/inc/bulitem.hxx2
-rw-r--r--svx/inc/charhiddenitem.hxx4
-rw-r--r--svx/inc/chrtitem.hxx2
-rw-r--r--svx/inc/clipboardctl.hxx2
-rw-r--r--svx/inc/clipfmtitem.hxx2
-rw-r--r--svx/inc/countryid.hxx321
-rw-r--r--svx/inc/dlgutil.hxx4
-rw-r--r--svx/inc/drawitem.hxx2
-rw-r--r--svx/inc/editund2.hxx2
-rw-r--r--svx/inc/extrusioncontrols.hxx2
-rw-r--r--svx/inc/flstitem.hxx2
-rw-r--r--svx/inc/fmhelp.hrc163
-rw-r--r--svx/inc/fontitem.hxx2
-rw-r--r--svx/inc/fwdtitem.hxx2
-rw-r--r--svx/inc/galbrws2.hxx2
-rw-r--r--svx/inc/galctrl.hxx5
-rw-r--r--svx/inc/galdlg.hxx72
-rw-r--r--svx/inc/gallery.hrc55
-rw-r--r--svx/inc/galobj.hxx16
-rw-r--r--svx/inc/galtheme.hxx46
-rw-r--r--svx/inc/grafctrl.hxx4
-rw-r--r--svx/inc/helpid.hrc1041
-rw-r--r--svx/inc/hlnkitem.hxx4
-rw-r--r--svx/inc/htmlcfg.hxx3
-rw-r--r--svx/inc/linectrl.hxx2
-rw-r--r--svx/inc/mscodec.hxx343
-rw-r--r--svx/inc/nlbkitem.hxx2
-rw-r--r--svx/inc/ofaitem.hxx2
-rw-r--r--svx/inc/opaqitem.hxx2
-rw-r--r--svx/inc/optaccessibility.hrc87
-rw-r--r--svx/inc/optcolor.hrc222
-rw-r--r--svx/inc/optctl.hrc61
-rw-r--r--svx/inc/optgenrl.hrc88
-rw-r--r--svx/inc/optgrid.hxx2
-rw-r--r--svx/inc/optimprove.hrc53
-rw-r--r--svx/inc/optinet2.hrc175
-rw-r--r--svx/inc/optitems.hxx2
-rw-r--r--svx/inc/optsave.hrc84
-rw-r--r--svx/inc/pch/precompiled_svx.hxx134
-rw-r--r--svx/inc/pgrditem.hxx2
-rw-r--r--svx/inc/postattr.hxx2
-rw-r--r--svx/inc/prntitem.hxx2
-rw-r--r--svx/inc/protitem.hxx2
-rw-r--r--svx/inc/rotmodit.hxx2
-rw-r--r--svx/inc/rulritem.hxx2
-rw-r--r--svx/inc/srchdlg.hxx4
-rwxr-xr-xsvx/inc/svx/EnhancedCustomShapeFunctionParser.hxx (renamed from svx/inc/EnhancedCustomShapeFunctionParser.hxx)0
-rw-r--r--svx/inc/svx/SmartTagItem.hxx2
-rw-r--r--svx/inc/svx/adjitem.hxx2
-rw-r--r--svx/inc/svx/akrnitem.hxx2
-rw-r--r--svx/inc/svx/algitem.hxx4
-rw-r--r--svx/inc/svx/blnkitem.hxx4
-rw-r--r--svx/inc/svx/borderline.hxx2
-rw-r--r--svx/inc/svx/boxitem.hxx2
-rw-r--r--svx/inc/svx/brkitem.hxx2
-rw-r--r--svx/inc/svx/brshitem.hxx2
-rw-r--r--svx/inc/svx/charreliefitem.hxx2
-rw-r--r--svx/inc/svx/charrotateitem.hxx2
-rw-r--r--svx/inc/svx/charscaleitem.hxx2
-rw-r--r--svx/inc/svx/cmapitem.hxx2
-rw-r--r--svx/inc/svx/cntritem.hxx2
-rw-r--r--svx/inc/svx/colrctrl.hxx2
-rw-r--r--svx/inc/svx/colritem.hxx2
-rw-r--r--svx/inc/svx/crsditem.hxx2
-rw-r--r--svx/inc/svx/dialogs.hrc767
-rw-r--r--svx/inc/svx/dlgctl3d.hxx2
-rw-r--r--svx/inc/svx/dlgctrl.hxx1
-rw-r--r--svx/inc/svx/e3ditem.hxx2
-rw-r--r--svx/inc/svx/editdata.hxx2
-rw-r--r--svx/inc/svx/editobj.hxx2
-rw-r--r--svx/inc/svx/emphitem.hxx2
-rw-r--r--svx/inc/svx/escherex.hxx1513
-rw-r--r--svx/inc/svx/escpitem.hxx2
-rw-r--r--svx/inc/svx/exthelpid.hrc (renamed from svx/source/cui/bbdlg.cxx)61
-rw-r--r--svx/inc/svx/fhgtitem.hxx2
-rw-r--r--svx/inc/svx/fillctrl.hxx2
-rw-r--r--svx/inc/svx/flditem.hxx2
-rw-r--r--svx/inc/svx/fmmodel.hxx10
-rw-r--r--svx/inc/svx/fmsearch.hxx2
-rw-r--r--svx/inc/svx/fmtools.hxx (renamed from svx/source/inc/fmtools.hxx)4
-rw-r--r--svx/inc/svx/fntctl.hxx2
-rw-r--r--svx/inc/svx/forbiddenruleitem.hxx2
-rw-r--r--svx/inc/svx/frmdiritem.hxx2
-rw-r--r--svx/inc/svx/gallery1.hxx (renamed from svx/inc/gallery1.hxx)6
-rw-r--r--svx/inc/svx/galmisc.hxx (renamed from svx/inc/galmisc.hxx)36
-rw-r--r--svx/inc/svx/grfcrop.hxx2
-rw-r--r--svx/inc/svx/hngpnctitem.hxx2
-rw-r--r--svx/inc/svx/hyznitem.hxx2
-rw-r--r--svx/inc/svx/impgrf.hxx (renamed from svx/inc/impgrf.hxx)0
-rw-r--r--svx/inc/svx/itemtype.hxx2
-rw-r--r--svx/inc/svx/keepitem.hxx2
-rw-r--r--svx/inc/svx/kernitem.hxx2
-rw-r--r--svx/inc/svx/langitem.hxx2
-rw-r--r--svx/inc/svx/lrspitem.hxx2
-rw-r--r--svx/inc/svx/lspcitem.hxx2
-rw-r--r--svx/inc/svx/msdffdef.hxx93
-rw-r--r--svx/inc/svx/msdffimp.hxx773
-rw-r--r--svx/inc/svx/msfiltertracer.hxx99
-rw-r--r--svx/inc/svx/msocximex.hxx1423
-rw-r--r--svx/inc/svx/nhypitem.hxx2
-rw-r--r--svx/inc/svx/numfmtsh.hxx2
-rw-r--r--svx/inc/svx/numinf.hxx2
-rw-r--r--svx/inc/svx/numitem.hxx34
-rw-r--r--svx/inc/svx/obj3d.hxx2
-rw-r--r--svx/inc/svx/optimprove.hxx143
-rw-r--r--svx/inc/svx/optlingu.hxx185
-rw-r--r--svx/inc/svx/orphitem.hxx2
-rw-r--r--svx/inc/svx/outliner.hxx2
-rw-r--r--svx/inc/svx/pageitem.hxx2
-rw-r--r--svx/inc/svx/paravertalignitem.hxx2
-rw-r--r--svx/inc/svx/pbinitem.hxx2
-rw-r--r--svx/inc/svx/pmdlitem.hxx2
-rw-r--r--svx/inc/svx/postitem.hxx2
-rw-r--r--svx/inc/svx/prszitem.hxx2
-rw-r--r--svx/inc/svx/ruler.hxx2
-rw-r--r--svx/inc/svx/scriptspaceitem.hxx2
-rw-r--r--svx/inc/svx/scripttypeitem.hxx4
-rw-r--r--svx/inc/svx/sdangitm.hxx2
-rw-r--r--svx/inc/svx/sdasaitm.hxx2
-rw-r--r--svx/inc/svx/sdasitm.hxx2
-rw-r--r--svx/inc/svx/sdggaitm.hxx2
-rw-r--r--svx/inc/svx/sdgmoitm.hxx2
-rw-r--r--svx/inc/svx/sdmetitm.hxx2
-rw-r--r--svx/inc/svx/sdooitm.hxx2
-rw-r--r--svx/inc/svx/sdprcitm.hxx2
-rw-r--r--svx/inc/svx/sdr/contact/objectcontact.hxx3
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx5
-rw-r--r--svx/inc/svx/sdr/overlay/overlaytools.hxx10
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx11
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx6
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx29
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx21
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx11
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx13
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx10
-rw-r--r--svx/inc/svx/sdr/properties/attributeproperties.hxx2
-rw-r--r--svx/inc/svx/sdrpagewindow.hxx2
-rw-r--r--svx/inc/svx/sdtaaitm.hxx2
-rw-r--r--svx/inc/svx/sdtacitm.hxx2
-rw-r--r--svx/inc/svx/sdtaditm.hxx2
-rw-r--r--svx/inc/svx/sdtaitm.hxx2
-rw-r--r--svx/inc/svx/sdtakitm.hxx2
-rw-r--r--svx/inc/svx/sdtayitm.hxx2
-rw-r--r--svx/inc/svx/sdtfsitm.hxx2
-rw-r--r--svx/inc/svx/sdynitm.hxx2
-rw-r--r--svx/inc/svx/selectioncontroller.hxx11
-rw-r--r--svx/inc/svx/shaditem.hxx2
-rw-r--r--svx/inc/svx/shdditem.hxx2
-rw-r--r--svx/inc/svx/sizeitem.hxx2
-rw-r--r--svx/inc/svx/spltitem.hxx2
-rw-r--r--svx/inc/svx/svddrgmt.hxx20
-rw-r--r--svx/inc/svx/svdedxv.hxx17
-rw-r--r--svx/inc/svx/svdfppt.hxx1445
-rw-r--r--svx/inc/svx/svdmodel.hxx6
-rw-r--r--svx/inc/svx/svdoashp.hxx2
-rw-r--r--svx/inc/svx/svdobj.hxx2
-rw-r--r--svx/inc/svx/svdpage.hxx3
-rw-r--r--svx/inc/svx/svdpagv.hxx2
-rwxr-xr-xsvx/inc/svx/svdpntv.hxx14
-rw-r--r--svx/inc/svx/svdundo.hxx2
-rw-r--r--svx/inc/svx/svdview.hxx5
-rw-r--r--svx/inc/svx/svx3ditems.hxx4
-rw-r--r--svx/inc/svx/svxacorr.hxx2
-rw-r--r--svx/inc/svx/svxbox.hxx2
-rw-r--r--svx/inc/svx/svxdlg.hxx73
-rw-r--r--svx/inc/svx/svxids.hrc7
-rw-r--r--svx/inc/svx/sxcecitm.hxx2
-rw-r--r--svx/inc/svx/sxcikitm.hxx2
-rw-r--r--svx/inc/svx/sxctitm.hxx2
-rw-r--r--svx/inc/svx/sxekitm.hxx2
-rw-r--r--svx/inc/svx/sxfiitm.hxx2
-rw-r--r--svx/inc/svx/sxlayitm.hxx4
-rw-r--r--svx/inc/svx/sxmfsitm.hxx2
-rw-r--r--svx/inc/svx/sxmkitm.hxx2
-rw-r--r--svx/inc/svx/sxmtpitm.hxx2
-rw-r--r--svx/inc/svx/sxmuitm.hxx2
-rw-r--r--svx/inc/svx/sxonitm.hxx2
-rw-r--r--svx/inc/svx/tbcontrl.hxx2
-rw-r--r--svx/inc/svx/tstpitem.hxx2
-rw-r--r--svx/inc/svx/twolinesitem.hxx2
-rw-r--r--svx/inc/svx/udlnitem.hxx2
-rw-r--r--svx/inc/svx/ulspitem.hxx2
-rw-r--r--svx/inc/svx/unoedsrc.hxx4
-rw-r--r--svx/inc/svx/unoipset.hxx2
-rw-r--r--svx/inc/svx/unopage.hxx2
-rw-r--r--svx/inc/svx/unoprov.hxx2
-rw-r--r--svx/inc/svx/unoshape.hxx2
-rw-r--r--svx/inc/svx/unoshprp.hxx2
-rw-r--r--svx/inc/svx/unotext.hxx6
-rw-r--r--svx/inc/svx/viewlayoutitem.hxx2
-rw-r--r--svx/inc/svx/wghtitem.hxx2
-rw-r--r--svx/inc/svx/widwitem.hxx2
-rw-r--r--svx/inc/svx/writingmodeitem.hxx2
-rw-r--r--svx/inc/svx/wrlmitem.hxx2
-rw-r--r--svx/inc/svx/xfillit.hxx2
-rw-r--r--svx/inc/svx/xfillit0.hxx2
-rw-r--r--svx/inc/svx/xflasit.hxx2
-rw-r--r--svx/inc/svx/xflbckit.hxx2
-rw-r--r--svx/inc/svx/xflbmpit.hxx2
-rw-r--r--svx/inc/svx/xflbmsli.hxx2
-rw-r--r--svx/inc/svx/xflbmsxy.hxx2
-rw-r--r--svx/inc/svx/xflbmtit.hxx2
-rw-r--r--svx/inc/svx/xflboxy.hxx2
-rw-r--r--svx/inc/svx/xflbstit.hxx2
-rw-r--r--svx/inc/svx/xflbtoxy.hxx2
-rw-r--r--svx/inc/svx/xfltrit.hxx2
-rw-r--r--svx/inc/svx/xftadit.hxx2
-rw-r--r--svx/inc/svx/xftdiit.hxx2
-rw-r--r--svx/inc/svx/xftmrit.hxx2
-rw-r--r--svx/inc/svx/xftshit.hxx2
-rw-r--r--svx/inc/svx/xftshtit.hxx2
-rw-r--r--svx/inc/svx/xftshxy.hxx2
-rw-r--r--svx/inc/svx/xftstit.hxx2
-rw-r--r--svx/inc/svx/xgrscit.hxx2
-rw-r--r--svx/inc/svx/xit.hxx2
-rw-r--r--svx/inc/svx/xlineit.hxx4
-rw-r--r--svx/inc/svx/xlineit0.hxx2
-rw-r--r--svx/inc/svx/xlinjoit.hxx (renamed from svx/inc/xlinjoit.hxx)2
-rw-r--r--svx/inc/svx/xlnasit.hxx2
-rw-r--r--svx/inc/svx/xlnedcit.hxx2
-rw-r--r--svx/inc/svx/xlnedwit.hxx2
-rw-r--r--svx/inc/svx/xlnstcit.hxx2
-rw-r--r--svx/inc/svx/xlnstwit.hxx2
-rw-r--r--svx/inc/svx/xlntrit.hxx2
-rw-r--r--svx/inc/svx/xlnwtit.hxx2
-rw-r--r--svx/inc/svx/xpool.hxx2
-rw-r--r--svx/inc/svx/xsetit.hxx4
-rw-r--r--svx/inc/svx/xtextit.hxx4
-rw-r--r--svx/inc/svx/xtextit0.hxx2
-rw-r--r--svx/inc/svx/zoomitem.hxx2
-rw-r--r--svx/inc/svx/zoomslideritem.hxx2
-rw-r--r--svx/inc/svxgrahicitem.hxx2
-rw-r--r--svx/inc/svxmsbas.hxx97
-rw-r--r--svx/inc/svxrtf.hxx4
-rw-r--r--svx/inc/txtrange.hxx2
-rw-r--r--svx/inc/unoapi.hxx2
-rw-r--r--svx/inc/unoedhlp.hxx2
-rw-r--r--svx/inc/unofdesc.hxx2
-rw-r--r--svx/inc/unolingu.hxx4
-rw-r--r--svx/inc/xattr.hxx2
-rw-r--r--svx/inc/xmlcnitm.hxx2
-rw-r--r--svx/prj/build.lst6
-rw-r--r--svx/prj/d.lst289
-rw-r--r--svx/sdi/makefile.mk5
-rw-r--r--svx/sdi/svxslots.sdi5
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx2
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.hxx4
-rw-r--r--svx/source/accessibility/AccessibleStaticTextBase.cxx4
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx2
-rw-r--r--svx/source/cui/SpellAttrib.cxx178
-rw-r--r--svx/source/cui/SpellAttrib.hxx176
-rw-r--r--svx/source/cui/SpellDialog.cxx2167
-rw-r--r--svx/source/cui/SpellDialog.hrc58
-rw-r--r--svx/source/cui/SpellDialog.src245
-rw-r--r--svx/source/cui/acccfg.cxx1700
-rw-r--r--svx/source/cui/acccfg.hrc78
-rw-r--r--svx/source/cui/acccfg.hxx288
-rw-r--r--svx/source/cui/acccfg.src360
-rw-r--r--svx/source/cui/align.cxx303
-rw-r--r--svx/source/cui/align.hrc87
-rw-r--r--svx/source/cui/align.hxx113
-rw-r--r--svx/source/cui/align.src251
-rw-r--r--svx/source/cui/autocdlg.cxx2780
-rw-r--r--svx/source/cui/autocdlg.hrc162
-rw-r--r--svx/source/cui/autocdlg.hxx508
-rw-r--r--svx/source/cui/autocdlg.src856
-rw-r--r--svx/source/cui/backgrnd.cxx1990
-rw-r--r--svx/source/cui/backgrnd.hrc73
-rw-r--r--svx/source/cui/backgrnd.hxx173
-rw-r--r--svx/source/cui/backgrnd.src307
-rw-r--r--svx/source/cui/bbdlg.src88
-rw-r--r--svx/source/cui/border.cxx1274
-rw-r--r--svx/source/cui/border.hrc109
-rw-r--r--svx/source/cui/border.hxx179
-rw-r--r--svx/source/cui/border.src431
-rw-r--r--svx/source/cui/borderconn.cxx318
-rw-r--r--svx/source/cui/borderconn.hxx79
-rw-r--r--svx/source/cui/cfg.cxx6059
-rw-r--r--svx/source/cui/cfg.hrc108
-rw-r--r--svx/source/cui/cfg.hxx836
-rw-r--r--svx/source/cui/cfg.src875
-rw-r--r--svx/source/cui/cfgchart.cxx327
-rw-r--r--svx/source/cui/cfgchart.hxx118
-rw-r--r--svx/source/cui/cfgutil.cxx1801
-rw-r--r--svx/source/cui/cfgutil.hxx220
-rw-r--r--svx/source/cui/chardlg.cxx4070
-rw-r--r--svx/source/cui/chardlg.h74
-rw-r--r--svx/source/cui/chardlg.hrc184
-rw-r--r--svx/source/cui/chardlg.hxx400
-rw-r--r--svx/source/cui/chardlg.src1133
-rw-r--r--svx/source/cui/charmap.src161
-rw-r--r--svx/source/cui/commonlingui.cxx294
-rw-r--r--svx/source/cui/commonlingui.hxx174
-rw-r--r--svx/source/cui/commonlingui.src156
-rw-r--r--svx/source/cui/connect.cxx569
-rw-r--r--svx/source/cui/connect.hxx133
-rw-r--r--svx/source/cui/connect.src268
-rw-r--r--svx/source/cui/connpoolconfig.cxx231
-rw-r--r--svx/source/cui/connpoolconfig.hxx57
-rw-r--r--svx/source/cui/connpooloptions.cxx516
-rw-r--r--svx/source/cui/connpooloptions.hrc52
-rw-r--r--svx/source/cui/connpooloptions.hxx95
-rw-r--r--svx/source/cui/connpooloptions.src169
-rw-r--r--svx/source/cui/connpoolsettings.cxx126
-rw-r--r--svx/source/cui/connpoolsettings.hxx111
-rw-r--r--svx/source/cui/cuicharmap.cxx593
-rw-r--r--svx/source/cui/cuicharmap.hxx146
-rw-r--r--svx/source/cui/cuifmsearch.cxx984
-rw-r--r--svx/source/cui/cuifmsearch.hxx230
-rw-r--r--svx/source/cui/cuigaldlg.cxx1290
-rw-r--r--svx/source/cui/cuigaldlg.hxx377
-rw-r--r--svx/source/cui/cuigrfflt.cxx762
-rw-r--r--svx/source/cui/cuigrfflt.hxx256
-rw-r--r--svx/source/cui/cuihyperdlg.cxx423
-rw-r--r--svx/source/cui/cuihyperdlg.hxx117
-rwxr-xr-xsvx/source/cui/cuiimapdlg.hrc50
-rwxr-xr-xsvx/source/cui/cuiimapdlg.src151
-rw-r--r--svx/source/cui/cuiimapwnd.cxx105
-rw-r--r--svx/source/cui/cuiimapwnd.hxx54
-rw-r--r--svx/source/cui/cuioptgenrl.hxx137
-rw-r--r--svx/source/cui/cuisrchdlg.cxx112
-rw-r--r--svx/source/cui/cuisrchdlg.hxx90
-rw-r--r--svx/source/cui/cuitabarea.hxx805
-rw-r--r--svx/source/cui/cuitabline.hxx433
-rw-r--r--svx/source/cui/cuitbxform.cxx84
-rw-r--r--svx/source/cui/cuitbxform.hxx29
-rw-r--r--svx/source/cui/dbregister.cxx519
-rw-r--r--svx/source/cui/dbregister.hrc45
-rw-r--r--svx/source/cui/dbregister.hxx163
-rw-r--r--svx/source/cui/dbregister.src97
-rw-r--r--svx/source/cui/dbregisterednamesconfig.cxx196
-rw-r--r--svx/source/cui/dbregisterednamesconfig.hxx57
-rw-r--r--svx/source/cui/dbregistersettings.cxx81
-rw-r--r--svx/source/cui/dbregistersettings.hxx66
-rw-r--r--svx/source/cui/dlgfact.cxx2393
-rw-r--r--svx/source/cui/dlgfact.hxx818
-rw-r--r--svx/source/cui/dlgname.cxx243
-rw-r--r--svx/source/cui/dlgname.hrc49
-rw-r--r--svx/source/cui/dlgname.hxx207
-rw-r--r--svx/source/cui/dlgname.src272
-rw-r--r--svx/source/cui/doclinkdialog.cxx235
-rw-r--r--svx/source/cui/doclinkdialog.hxx96
-rw-r--r--svx/source/cui/doclinkdialog.src154
-rw-r--r--svx/source/cui/dstribut.cxx251
-rw-r--r--svx/source/cui/dstribut.hrc58
-rw-r--r--svx/source/cui/dstribut.hxx128
-rw-r--r--svx/source/cui/dstribut.src293
-rw-r--r--svx/source/cui/eventdlg.cxx250
-rw-r--r--svx/source/cui/eventdlg.hrc46
-rw-r--r--svx/source/cui/eventdlg.src114
-rw-r--r--svx/source/cui/fontsubs.cxx625
-rw-r--r--svx/source/cui/fontsubs.hrc65
-rw-r--r--svx/source/cui/fontsubs.hxx132
-rw-r--r--svx/source/cui/fontsubs.src200
-rw-r--r--svx/source/cui/grfflt.hrc83
-rw-r--r--svx/source/cui/grfflt.src456
-rw-r--r--svx/source/cui/grfpage.cxx858
-rw-r--r--svx/source/cui/grfpage.hrc56
-rw-r--r--svx/source/cui/grfpage.hxx143
-rw-r--r--svx/source/cui/grfpage.src334
-rw-r--r--svx/source/cui/hangulhanjadlg.cxx1929
-rw-r--r--svx/source/cui/hangulhanjadlg.hrc200
-rw-r--r--svx/source/cui/hangulhanjadlg.hxx355
-rw-r--r--svx/source/cui/hangulhanjadlg.src431
-rwxr-xr-xsvx/source/cui/headertablistbox.hxx71
-rw-r--r--svx/source/cui/hldocntp.cxx525
-rw-r--r--svx/source/cui/hldocntp.hxx81
-rw-r--r--svx/source/cui/hldoctp.cxx387
-rw-r--r--svx/source/cui/hldoctp.hxx96
-rw-r--r--svx/source/cui/hlinettp.cxx550
-rw-r--r--svx/source/cui/hlinettp.hxx110
-rw-r--r--svx/source/cui/hlmailtp.cxx367
-rw-r--r--svx/source/cui/hlmailtp.hxx80
-rw-r--r--svx/source/cui/hlmarkwn.cxx549
-rw-r--r--svx/source/cui/hlmarkwn.src98
-rw-r--r--svx/source/cui/hltpbase.cxx880
-rw-r--r--svx/source/cui/hltpbase.hxx218
-rw-r--r--svx/source/cui/iconcdlg.cxx1445
-rw-r--r--svx/source/cui/iconcdlg.hxx292
-rw-r--r--svx/source/cui/init.cxx60
-rw-r--r--svx/source/cui/insdlg.cxx1064
-rw-r--r--svx/source/cui/insdlg.hxx217
-rw-r--r--svx/source/cui/insrc.cxx88
-rw-r--r--svx/source/cui/insrc.hrc43
-rw-r--r--svx/source/cui/insrc.src118
-rw-r--r--svx/source/cui/internationaloptions.cxx172
-rw-r--r--svx/source/cui/internationaloptions.hrc75
-rw-r--r--svx/source/cui/internationaloptions.src105
-rw-r--r--svx/source/cui/labdlg.cxx657
-rw-r--r--svx/source/cui/labdlg.hrc80
-rw-r--r--svx/source/cui/labdlg.hxx147
-rw-r--r--svx/source/cui/labdlg.src301
-rw-r--r--svx/source/cui/linkdlg.cxx721
-rw-r--r--svx/source/cui/linkdlg.hxx137
-rw-r--r--svx/source/cui/macroass.cxx719
-rw-r--r--svx/source/cui/macroass.hrc85
-rwxr-xr-xsvx/source/cui/macroass.hxx146
-rw-r--r--svx/source/cui/macroass.src143
-rw-r--r--svx/source/cui/macropg.cxx1062
-rw-r--r--svx/source/cui/macropg.hrc104
-rw-r--r--svx/source/cui/macropg.hxx178
-rw-r--r--svx/source/cui/macropg.src461
-rwxr-xr-xsvx/source/cui/makefile.mk234
-rw-r--r--svx/source/cui/measure.cxx881
-rw-r--r--svx/source/cui/measure.hrc56
-rw-r--r--svx/source/cui/measure.hxx132
-rw-r--r--svx/source/cui/measure.src310
-rw-r--r--svx/source/cui/multifil.cxx191
-rw-r--r--svx/source/cui/multipat.cxx367
-rw-r--r--svx/source/cui/multipat.hxx92
-rw-r--r--svx/source/cui/newtabledlg.cxx78
-rw-r--r--svx/source/cui/newtabledlg.hrc38
-rw-r--r--svx/source/cui/newtabledlg.src138
-rw-r--r--svx/source/cui/numfmt.cxx1957
-rw-r--r--svx/source/cui/numfmt.hrc77
-rw-r--r--svx/source/cui/numfmt.hxx206
-rw-r--r--svx/source/cui/numfmt.src297
-rw-r--r--svx/source/cui/numpages.cxx4046
-rw-r--r--svx/source/cui/numpages.hrc135
-rw-r--r--svx/source/cui/numpages.hxx472
-rw-r--r--svx/source/cui/numpages.src910
-rw-r--r--svx/source/cui/optHeaderTabListbox.cxx93
-rw-r--r--svx/source/cui/optHeaderTabListbox.hxx48
-rw-r--r--svx/source/cui/optaccessibility.cxx191
-rw-r--r--svx/source/cui/optaccessibility.hxx68
-rw-r--r--svx/source/cui/optasian.cxx475
-rw-r--r--svx/source/cui/optasian.hxx84
-rw-r--r--svx/source/cui/optchart.cxx244
-rw-r--r--svx/source/cui/optchart.hxx92
-rw-r--r--svx/source/cui/optcolor.cxx1642
-rw-r--r--svx/source/cui/optcolor.hxx84
-rw-r--r--svx/source/cui/optctl.cxx182
-rw-r--r--svx/source/cui/optctl.hxx73
-rw-r--r--svx/source/cui/optdict.cxx817
-rw-r--r--svx/source/cui/optdict.hxx191
-rw-r--r--svx/source/cui/optfltr.cxx444
-rw-r--r--svx/source/cui/optfltr.hrc58
-rw-r--r--svx/source/cui/optfltr.hxx118
-rw-r--r--svx/source/cui/optfltr.src204
-rw-r--r--svx/source/cui/optgdlg.cxx1926
-rw-r--r--svx/source/cui/optgdlg.hrc208
-rw-r--r--svx/source/cui/optgdlg.hxx217
-rw-r--r--svx/source/cui/optgdlg.src642
-rw-r--r--svx/source/cui/optgenrl.cxx587
-rw-r--r--svx/source/cui/opthtml.cxx275
-rw-r--r--svx/source/cui/opthtml.hrc66
-rw-r--r--svx/source/cui/opthtml.hxx104
-rw-r--r--svx/source/cui/opthtml.src290
-rw-r--r--svx/source/cui/optimprove.cxx233
-rw-r--r--svx/source/cui/optimprove2.cxx276
-rw-r--r--svx/source/cui/optinet2.cxx2356
-rw-r--r--svx/source/cui/optinet2.hxx357
-rw-r--r--svx/source/cui/optjava.cxx1142
-rw-r--r--svx/source/cui/optjava.hrc86
-rw-r--r--svx/source/cui/optjava.hxx221
-rw-r--r--svx/source/cui/optjava.src290
-rw-r--r--svx/source/cui/optjsearch.cxx393
-rw-r--r--svx/source/cui/optjsearch.hxx96
-rw-r--r--svx/source/cui/optmemory.cxx287
-rw-r--r--svx/source/cui/optmemory.hrc89
-rw-r--r--svx/source/cui/optmemory.hxx92
-rw-r--r--svx/source/cui/optmemory.src210
-rw-r--r--svx/source/cui/optpath.cxx871
-rw-r--r--svx/source/cui/optpath.hxx119
-rw-r--r--svx/source/cui/optsave.cxx826
-rw-r--r--svx/source/cui/optsave.hxx108
-rw-r--r--svx/source/cui/optupdt.cxx424
-rw-r--r--svx/source/cui/optupdt.hrc52
-rw-r--r--svx/source/cui/optupdt.hxx84
-rw-r--r--svx/source/cui/optupdt.src114
-rw-r--r--svx/source/cui/page.cxx1788
-rw-r--r--svx/source/cui/page.h74
-rw-r--r--svx/source/cui/page.hrc87
-rw-r--r--svx/source/cui/page.hxx256
-rw-r--r--svx/source/cui/page.src668
-rw-r--r--svx/source/cui/paragrph.cxx2394
-rw-r--r--svx/source/cui/paragrph.hrc124
-rw-r--r--svx/source/cui/paragrph.hxx336
-rw-r--r--svx/source/cui/paragrph.src734
-rw-r--r--svx/source/cui/pastedlg.cxx314
-rw-r--r--svx/source/cui/pastedlg.hxx98
-rw-r--r--svx/source/cui/plfilter.cxx133
-rw-r--r--svx/source/cui/postdlg.cxx273
-rw-r--r--svx/source/cui/postdlg.hxx129
-rw-r--r--svx/source/cui/postdlg.src161
-rw-r--r--svx/source/cui/readonlyimage.cxx88
-rw-r--r--svx/source/cui/readonlyimage.src55
-rw-r--r--svx/source/cui/scriptdlg.cxx1695
-rw-r--r--svx/source/cui/scriptdlg.hrc83
-rw-r--r--svx/source/cui/scriptdlg.hxx251
-rw-r--r--svx/source/cui/scriptdlg.src310
-rw-r--r--svx/source/cui/sdbcdriverenum.cxx136
-rw-r--r--svx/source/cui/sdbcdriverenum.hxx79
-rw-r--r--svx/source/cui/sdrcelldlg.cxx106
-rw-r--r--svx/source/cui/sdrcelldlg.src142
-rw-r--r--svx/source/cui/securityoptions.cxx116
-rw-r--r--svx/source/cui/securityoptions.hrc83
-rw-r--r--svx/source/cui/securityoptions.hxx94
-rw-r--r--svx/source/cui/securityoptions.src168
-rw-r--r--svx/source/cui/selector.cxx1262
-rw-r--r--svx/source/cui/selector.hrc60
-rw-r--r--svx/source/cui/selector.hxx249
-rw-r--r--svx/source/cui/selector.src215
-rw-r--r--svx/source/cui/showcols.cxx144
-rw-r--r--svx/source/cui/splitcelldlg.cxx120
-rw-r--r--svx/source/cui/splitcelldlg.hrc45
-rw-r--r--svx/source/cui/splitcelldlg.src135
-rw-r--r--svx/source/cui/srchxtra.cxx306
-rw-r--r--svx/source/cui/srchxtra.hxx111
-rw-r--r--svx/source/cui/srchxtra.src281
-rw-r--r--svx/source/cui/svuidlg.hrc139
-rw-r--r--svx/source/cui/svuidlg.src711
-rw-r--r--svx/source/cui/swpossizetabpage.cxx1977
-rw-r--r--svx/source/cui/swpossizetabpage.hrc62
-rw-r--r--svx/source/cui/swpossizetabpage.hxx163
-rw-r--r--svx/source/cui/swpossizetabpage.src299
-rw-r--r--svx/source/cui/tabarea.cxx382
-rw-r--r--svx/source/cui/tabarea.hrc190
-rw-r--r--svx/source/cui/tabarea.src1541
-rw-r--r--svx/source/cui/tabline.cxx306
-rw-r--r--svx/source/cui/tabline.hrc109
-rw-r--r--svx/source/cui/tabline.src803
-rw-r--r--svx/source/cui/tabstpge.cxx755
-rw-r--r--svx/source/cui/tabstpge.hrc66
-rw-r--r--svx/source/cui/tabstpge.hxx161
-rw-r--r--svx/source/cui/tabstpge.src234
-rw-r--r--svx/source/cui/textanim.cxx763
-rw-r--r--svx/source/cui/textanim.hrc50
-rw-r--r--svx/source/cui/textanim.hxx131
-rw-r--r--svx/source/cui/textanim.src322
-rw-r--r--svx/source/cui/textattr.cxx807
-rw-r--r--svx/source/cui/textattr.hrc49
-rw-r--r--svx/source/cui/textattr.hxx138
-rw-r--r--svx/source/cui/textattr.src247
-rw-r--r--svx/source/cui/tparea.cxx2586
-rw-r--r--svx/source/cui/tpbitmap.cxx1179
-rw-r--r--svx/source/cui/tpcolor.cxx1286
-rw-r--r--svx/source/cui/tpgradnt.cxx948
-rw-r--r--svx/source/cui/tphatch.cxx912
-rw-r--r--svx/source/cui/tpline.cxx1959
-rw-r--r--svx/source/cui/tplnedef.cxx1027
-rw-r--r--svx/source/cui/tplneend.cxx762
-rw-r--r--svx/source/cui/tpshadow.cxx620
-rw-r--r--svx/source/cui/transfrm.cxx1706
-rw-r--r--svx/source/cui/transfrm.hrc79
-rw-r--r--svx/source/cui/transfrm.hxx308
-rw-r--r--svx/source/cui/transfrm.src612
-rw-r--r--svx/source/cui/treeopt.cxx2861
-rw-r--r--svx/source/cui/treeopt.hrc103
-rw-r--r--svx/source/cui/treeopt.hxx362
-rw-r--r--svx/source/cui/treeopt.src386
-rw-r--r--svx/source/cui/webconninfo.cxx386
-rw-r--r--svx/source/cui/webconninfo.hrc65
-rw-r--r--svx/source/cui/webconninfo.hxx88
-rw-r--r--svx/source/cui/webconninfo.src106
-rw-r--r--svx/source/cui/winpluginlib.cpp233
-rw-r--r--svx/source/cui/zoom.cxx541
-rw-r--r--svx/source/cui/zoom.hrc56
-rw-r--r--svx/source/cui/zoom.hxx120
-rw-r--r--svx/source/cui/zoom.src159
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx72
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.hxx5
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx16
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx2
-rwxr-xr-x[-rw-r--r--]svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx10
-rw-r--r--svx/source/customshapes/tbxcustomshapes.cxx2
-rw-r--r--svx/source/dialog/_bmpmask.cxx4
-rw-r--r--svx/source/dialog/_contdlg.cxx6
-rw-r--r--svx/source/dialog/charmap.cxx2
-rw-r--r--svx/source/dialog/connctrl.cxx2
-rw-r--r--svx/source/dialog/databaseregistrationui.cxx2
-rw-r--r--svx/source/dialog/dlgctl3d.cxx2
-rw-r--r--svx/source/dialog/dlgctrl.cxx31
-rw-r--r--svx/source/dialog/dlgutil.cxx2
-rw-r--r--svx/source/dialog/docrecovery.cxx6
-rw-r--r--svx/source/dialog/fntctrl.cxx2
-rw-r--r--svx/source/dialog/fontwork.cxx4
-rw-r--r--svx/source/dialog/frmdirlbox.src96
-rw-r--r--svx/source/dialog/frmsel.cxx2
-rw-r--r--svx/source/dialog/graphctl.cxx4
-rw-r--r--svx/source/dialog/grfflt.cxx2
-rw-r--r--svx/source/dialog/hangulhanja.cxx6
-rw-r--r--svx/source/dialog/hdft.cxx4
-rw-r--r--svx/source/dialog/hyperdlg.cxx10
-rw-r--r--svx/source/dialog/hyperdlg.src971
-rw-r--r--svx/source/dialog/hyprlink.cxx25
-rw-r--r--svx/source/dialog/imapdlg.cxx10
-rw-r--r--svx/source/dialog/imapwnd.cxx4
-rw-r--r--svx/source/dialog/imapwnd.hxx2
-rw-r--r--svx/source/dialog/impgrf.cxx12
-rw-r--r--svx/source/dialog/langbox.cxx2
-rw-r--r--svx/source/dialog/makefile.mk13
-rw-r--r--svx/source/dialog/measctrl.cxx4
-rw-r--r--svx/source/dialog/opengrf.cxx4
-rw-r--r--svx/source/dialog/radiobtnbox.cxx124
-rw-r--r--svx/source/dialog/rlrcitem.cxx4
-rw-r--r--svx/source/dialog/rubydialog.cxx2
-rw-r--r--svx/source/dialog/sdstring.src209
-rw-r--r--svx/source/dialog/srchctrl.cxx2
-rw-r--r--svx/source/dialog/srchdlg.cxx60
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx10
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.src130
-rw-r--r--svx/source/dialog/svxdlg.cxx9
-rw-r--r--svx/source/dialog/svxruler.cxx11
-rw-r--r--svx/source/dialog/swframeexample.cxx2
-rw-r--r--svx/source/dialog/thesdlg.cxx2
-rw-r--r--svx/source/editeng/SvXMLAutoCorrectExport.cxx2
-rw-r--r--svx/source/editeng/SvXMLAutoCorrectImport.cxx2
-rw-r--r--svx/source/editeng/acorrcfg.cxx4
-rw-r--r--svx/source/editeng/editattr.hxx2
-rw-r--r--svx/source/editeng/editdoc.cxx11
-rw-r--r--svx/source/editeng/editdoc.hxx6
-rw-r--r--svx/source/editeng/editdoc2.cxx2
-rw-r--r--svx/source/editeng/editeng.cxx6
-rw-r--r--svx/source/editeng/editobj.cxx4
-rw-r--r--svx/source/editeng/editobj2.hxx2
-rw-r--r--svx/source/editeng/editview.cxx6
-rw-r--r--svx/source/editeng/edtspell.cxx4
-rw-r--r--svx/source/editeng/eehtml.hxx2
-rw-r--r--svx/source/editeng/eeobj.cxx2
-rw-r--r--svx/source/editeng/eerdll.cxx2
-rw-r--r--svx/source/editeng/eertfpar.cxx2
-rw-r--r--svx/source/editeng/impedit.cxx2
-rw-r--r--svx/source/editeng/impedit.hxx2
-rw-r--r--svx/source/editeng/impedit2.cxx4
-rw-r--r--svx/source/editeng/impedit3.cxx4
-rw-r--r--svx/source/editeng/impedit5.cxx2
-rw-r--r--svx/source/editeng/svxacorr.cxx14
-rw-r--r--svx/source/editeng/txtrange.cxx2
-rw-r--r--svx/source/editeng/unolingu.cxx4
-rw-r--r--svx/source/engine3d/float3d.cxx6
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx183
-rw-r--r--svx/source/engine3d/helperminimaldepth3d.cxx4
-rw-r--r--svx/source/engine3d/obj3d.cxx4
-rw-r--r--svx/source/engine3d/polysc3d.cxx4
-rw-r--r--svx/source/engine3d/scene3d.cxx4
-rw-r--r--svx/source/engine3d/view3d.cxx11
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx8
-rw-r--r--svx/source/fmcomp/fmgridif.cxx2
-rw-r--r--svx/source/fmcomp/gridcell.cxx8
-rw-r--r--svx/source/fmcomp/gridcols.cxx2
-rw-r--r--svx/source/fmcomp/gridctrl.cxx2
-rw-r--r--svx/source/fmcomp/makefile.mk3
-rw-r--r--svx/source/fmcomp/showcols.src106
-rw-r--r--svx/source/form/ParseContext.cxx2
-rw-r--r--svx/source/form/databaselocationinput.cxx2
-rw-r--r--svx/source/form/datanavi.cxx12
-rw-r--r--svx/source/form/filtnav.cxx2
-rw-r--r--svx/source/form/fmcontrollayout.cxx206
-rw-r--r--svx/source/form/fmctrler.cxx2
-rw-r--r--svx/source/form/fmexch.cxx4
-rw-r--r--svx/source/form/fmmodel.cxx39
-rw-r--r--svx/source/form/fmobj.cxx88
-rw-r--r--svx/source/form/fmobjfac.cxx2
-rw-r--r--svx/source/form/fmpage.cxx2
-rw-r--r--svx/source/form/fmpgeimp.cxx2
-rw-r--r--svx/source/form/fmsearch.src333
-rw-r--r--svx/source/form/fmshell.cxx16
-rw-r--r--svx/source/form/fmshimp.cxx10
-rw-r--r--svx/source/form/fmsrccfg.cxx2
-rw-r--r--svx/source/form/fmsrcimp.cxx7
-rw-r--r--svx/source/form/fmtextcontroldialogs.cxx4
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx10
-rw-r--r--svx/source/form/fmtools.cxx6
-rw-r--r--svx/source/form/fmundo.cxx4
-rw-r--r--svx/source/form/fmview.cxx4
-rw-r--r--svx/source/form/fmvwimp.cxx4
-rw-r--r--svx/source/form/formcontrolfactory.cxx109
-rw-r--r--svx/source/form/formcontrolling.cxx2
-rw-r--r--svx/source/form/makefile.mk2
-rw-r--r--svx/source/form/navigatortree.cxx1
-rw-r--r--svx/source/form/navigatortreemodel.cxx1
-rw-r--r--svx/source/form/sdbdatacolumn.cxx10
-rw-r--r--svx/source/form/tabwin.cxx2
-rw-r--r--svx/source/form/tbxform.cxx8
-rw-r--r--svx/source/form/tbxform.src69
-rw-r--r--svx/source/form/typemap.cxx4
-rw-r--r--svx/source/gallery2/galbrws.cxx6
-rw-r--r--svx/source/gallery2/galbrws1.cxx15
-rw-r--r--svx/source/gallery2/galbrws1.hxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx27
-rw-r--r--svx/source/gallery2/galctrl.cxx28
-rw-r--r--svx/source/gallery2/galexpl.cxx5
-rw-r--r--svx/source/gallery2/gallery.src456
-rw-r--r--svx/source/gallery2/gallery1.cxx11
-rw-r--r--svx/source/gallery2/galmisc.cxx10
-rw-r--r--svx/source/gallery2/galobj.cxx6
-rw-r--r--svx/source/gallery2/galtheme.cxx32
-rw-r--r--svx/source/gengal/gengal.cxx18
-rw-r--r--svx/source/gengal/gengal.sh5
-rw-r--r--svx/source/inc/GraphCtlAccessibleContext.hxx2
-rw-r--r--svx/source/inc/SpellDialog.hxx261
-rw-r--r--svx/source/inc/eventdlg.hxx81
-rw-r--r--svx/source/inc/filtnav.hxx8
-rw-r--r--svx/source/inc/fmPropBrw.hxx2
-rw-r--r--svx/source/inc/fmcontrollayout.hxx16
-rw-r--r--svx/source/inc/fmctrler.hxx2
-rw-r--r--svx/source/inc/fmexpl.hxx8
-rw-r--r--svx/source/inc/fmitems.hxx2
-rw-r--r--svx/source/inc/fmobj.hxx8
-rw-r--r--svx/source/inc/fmresids.hrc14
-rw-r--r--svx/source/inc/fmsearch.hrc72
-rw-r--r--svx/source/inc/fmshimp.hxx11
-rw-r--r--svx/source/inc/fmsrcimp.hxx2
-rw-r--r--svx/source/inc/fmundo.hxx2
-rw-r--r--svx/source/inc/gridcell.hxx2
-rw-r--r--svx/source/inc/hlmarkwn.hrc37
-rw-r--r--svx/source/inc/hlmarkwn.hxx114
-rw-r--r--svx/source/inc/hyperdlg.hrc103
-rw-r--r--svx/source/inc/macropg_impl.hxx76
-rw-r--r--svx/source/inc/optchart.hrc40
-rw-r--r--svx/source/inc/optdict.hrc68
-rw-r--r--svx/source/inc/svdoimp.hxx2
-rw-r--r--svx/source/inc/tabwin.hxx2
-rw-r--r--svx/source/inc/unoedprx.hxx2
-rw-r--r--svx/source/intro/intro_tmpl.hrc210
-rw-r--r--svx/source/intro/iso.src2
-rw-r--r--svx/source/intro/ooo.src2
-rw-r--r--svx/source/items/SmartTagItem.cxx2
-rw-r--r--svx/source/items/clipfmtitem.cxx2
-rw-r--r--svx/source/items/flditem.cxx2
-rw-r--r--svx/source/items/frmitems.cxx6
-rw-r--r--svx/source/items/makefile.mk1
-rw-r--r--svx/source/items/numfmtsh.cxx4
-rw-r--r--svx/source/items/numitem.cxx504
-rw-r--r--svx/source/items/page.src258
-rw-r--r--svx/source/items/pageitem.cxx2
-rw-r--r--svx/source/items/paraitem.cxx8
-rw-r--r--svx/source/items/textitem.cxx6
-rw-r--r--svx/source/mnuctrls/SmartTagCtl.cxx2
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx4
-rw-r--r--svx/source/mnuctrls/fntszctl.cxx2
-rw-r--r--svx/source/msfilter/countryid.cxx345
-rw-r--r--svx/source/msfilter/escherex.cxx4848
-rw-r--r--svx/source/msfilter/eschesdo.cxx1244
-rw-r--r--svx/source/msfilter/eschesdo.hxx208
-rw-r--r--svx/source/msfilter/mscodec.cxx537
-rw-r--r--svx/source/msfilter/msdffimp.cxx8194
-rw-r--r--svx/source/msfilter/msfiltertracer.cxx254
-rw-r--r--svx/source/msfilter/msocximex.cxx5975
-rw-r--r--svx/source/msfilter/msoleexp.cxx376
-rw-r--r--svx/source/msfilter/msvbasic.cxx677
-rw-r--r--svx/source/msfilter/msvbasic.hxx131
-rw-r--r--svx/source/msfilter/svxmsbas.cxx406
-rw-r--r--svx/source/msfilter/svxmsbas2.cxx88
-rw-r--r--svx/source/msfilter/viscache.hxx85
-rw-r--r--svx/source/options/asiancfg.cxx2
-rw-r--r--svx/source/options/htmlcfg.cxx5
-rw-r--r--svx/source/options/makefile.mk20
-rw-r--r--svx/source/options/multipat.src153
-rw-r--r--svx/source/options/optaccessibility.src155
-rw-r--r--svx/source/options/optasian.src177
-rw-r--r--svx/source/options/optchart.src86
-rw-r--r--svx/source/options/optcolor.src552
-rw-r--r--svx/source/options/optctl.src119
-rw-r--r--svx/source/options/optdict.src282
-rw-r--r--svx/source/options/optgenrl.src333
-rw-r--r--svx/source/options/optimprove.src123
-rw-r--r--svx/source/options/optinet2.src647
-rw-r--r--svx/source/options/optjsearch.src223
-rw-r--r--svx/source/options/optlingu.cxx2563
-rw-r--r--svx/source/options/optlingu.hrc91
-rw-r--r--svx/source/options/optlingu.src357
-rw-r--r--svx/source/options/optpath.src203
-rw-r--r--svx/source/options/optsave.src325
-rw-r--r--svx/source/options/optspell.src128
-rw-r--r--svx/source/options/srchcfg.cxx2
-rw-r--r--svx/source/outliner/outl_pch.hxx2
-rw-r--r--svx/source/outliner/outleeng.cxx2
-rw-r--r--svx/source/outliner/outlin2.cxx2
-rw-r--r--svx/source/outliner/outliner.cxx8
-rw-r--r--svx/source/outliner/outlvw.cxx4
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx39
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx32
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcircobj.cxx30
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx23
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx15
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx33
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx38
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx2
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx28
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx85
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx16
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx36
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx11
-rw-r--r--svx/source/sdr/overlay/overlaytools.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx8
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx24
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx35
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx43
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx60
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx25
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx6
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx16
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx20
-rw-r--r--svx/source/sdr/primitive3d/sdrattributecreator3d.cxx2
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx10
-rw-r--r--svx/source/sdr/properties/captionproperties.cxx4
-rw-r--r--svx/source/sdr/properties/circleproperties.cxx4
-rw-r--r--svx/source/sdr/properties/connectorproperties.cxx4
-rw-r--r--svx/source/sdr/properties/customshapeproperties.cxx10
-rw-r--r--svx/source/sdr/properties/defaultproperties.cxx4
-rw-r--r--svx/source/sdr/properties/e3dcompoundproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dextrudeproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dlatheproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dsceneproperties.cxx4
-rw-r--r--svx/source/sdr/properties/e3dsphereproperties.cxx2
-rw-r--r--svx/source/sdr/properties/emptyproperties.cxx2
-rw-r--r--svx/source/sdr/properties/graphicproperties.cxx4
-rw-r--r--svx/source/sdr/properties/groupproperties.cxx4
-rw-r--r--svx/source/sdr/properties/itemsettools.cxx4
-rw-r--r--svx/source/sdr/properties/measureproperties.cxx4
-rw-r--r--svx/source/sdr/properties/pageproperties.cxx2
-rw-r--r--svx/source/sdr/properties/properties.cxx2
-rw-r--r--svx/source/sdr/properties/textproperties.cxx8
-rw-r--r--svx/source/src/app.hrc4
-rw-r--r--svx/source/src/app.src32
-rw-r--r--svx/source/stbctrls/insctrl.cxx2
-rw-r--r--svx/source/stbctrls/modctrl.cxx2
-rw-r--r--svx/source/stbctrls/pszctrl.cxx6
-rw-r--r--svx/source/stbctrls/selctrl.cxx2
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx14
-rw-r--r--svx/source/stbctrls/zoomsliderctrl.cxx8
-rw-r--r--svx/source/svdraw/gradtrns.cxx25
-rw-r--r--svx/source/svdraw/makefile.mk6
-rw-r--r--svx/source/svdraw/selectioncontroller.cxx11
-rw-r--r--svx/source/svdraw/svddrgmt.cxx84
-rw-r--r--svx/source/svdraw/svdedtv1.cxx6
-rw-r--r--svx/source/svdraw/svdedtv2.cxx2
-rw-r--r--svx/source/svdraw/svdedxv.cxx232
-rw-r--r--svx/source/svdraw/svdetc.cxx10
-rw-r--r--svx/source/svdraw/svdfmtf.cxx113
-rw-r--r--svx/source/svdraw/svdfmtf.hxx2
-rw-r--r--svx/source/svdraw/svdfppt.cxx7804
-rw-r--r--svx/source/svdraw/svdhdl.cxx2
-rw-r--r--svx/source/svdraw/svdibrow.cxx10
-rw-r--r--svx/source/svdraw/svdmark.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx10
-rw-r--r--svx/source/svdraw/svdoashp.cxx41
-rw-r--r--svx/source/svdraw/svdoattr.cxx12
-rw-r--r--svx/source/svdraw/svdobj.cxx26
-rw-r--r--svx/source/svdraw/svdocapt.cxx2
-rw-r--r--svx/source/svdraw/svdocirc.cxx62
-rw-r--r--svx/source/svdraw/svdoedge.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx8
-rw-r--r--svx/source/svdraw/svdogrp.cxx4
-rw-r--r--svx/source/svdraw/svdomeas.cxx19
-rw-r--r--svx/source/svdraw/svdoole2.cxx4
-rw-r--r--svx/source/svdraw/svdopage.cxx2
-rw-r--r--svx/source/svdraw/svdopath.cxx57
-rw-r--r--svx/source/svdraw/svdotext.cxx45
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx176
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx12
-rw-r--r--svx/source/svdraw/svdotxat.cxx12
-rw-r--r--svx/source/svdraw/svdotxed.cxx2
-rw-r--r--svx/source/svdraw/svdotxln.cxx2
-rw-r--r--svx/source/svdraw/svdotxtr.cxx2
-rw-r--r--svx/source/svdraw/svdoutl.cxx2
-rw-r--r--svx/source/svdraw/svdovirt.cxx5
-rw-r--r--svx/source/svdraw/svdpage.cxx14
-rwxr-xr-xsvx/source/svdraw/svdpntv.cxx22
-rw-r--r--svx/source/svdraw/svdtext.cxx2
-rw-r--r--svx/source/svdraw/svdtrans.cxx2
-rw-r--r--svx/source/svdraw/svdundo.cxx2
-rw-r--r--svx/source/svdraw/svdview.cxx16
-rw-r--r--svx/source/svdraw/svdviter.cxx2
-rw-r--r--svx/source/svdraw/svdxcgv.cxx6
-rw-r--r--svx/source/svrtf/rtfgrf.cxx4
-rw-r--r--svx/source/svrtf/rtfitem.cxx4
-rw-r--r--svx/source/svrtf/svxrtf.cxx6
-rw-r--r--svx/source/svxlink/fileobj.cxx4
-rw-r--r--svx/source/svxlink/linkmgr.cxx12
-rw-r--r--svx/source/table/cell.cxx4
-rw-r--r--svx/source/table/celleditsource.cxx6
-rw-r--r--svx/source/table/svdotable.cxx2
-rw-r--r--svx/source/table/tablecontroller.cxx84
-rw-r--r--svx/source/table/tablecontroller.hxx4
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx20
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx2
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx22
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx10
-rw-r--r--svx/source/tbxctrls/formatpaintbrushctrl.cxx2
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx6
-rw-r--r--svx/source/tbxctrls/itemwin.cxx26
-rw-r--r--svx/source/tbxctrls/layctrl.cxx2
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx8
-rw-r--r--svx/source/tbxctrls/subtoolboxcontrol.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx18
-rw-r--r--svx/source/tbxctrls/tbxalign.cxx2
-rw-r--r--svx/source/tbxctrls/tbxcolorupdate.cxx6
-rw-r--r--svx/source/tbxctrls/tbxdrctl.cxx2
-rw-r--r--svx/source/tbxctrls/verttexttbxctrl.cxx4
-rw-r--r--svx/source/toolbars/fontworkbar.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx4
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx4
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src4
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx8
-rw-r--r--svx/source/unodraw/UnoNameItemTable.cxx6
-rw-r--r--svx/source/unodraw/UnoNameItemTable.hxx2
-rw-r--r--svx/source/unodraw/UnoNamespaceMap.cxx2
-rw-r--r--svx/source/unodraw/unobtabl.cxx6
-rw-r--r--svx/source/unodraw/unoctabl.cxx2
-rw-r--r--svx/source/unodraw/unodtabl.cxx4
-rw-r--r--svx/source/unodraw/unofdesc.cxx2
-rw-r--r--svx/source/unodraw/unogtabl.cxx4
-rw-r--r--svx/source/unodraw/unohtabl.cxx4
-rw-r--r--svx/source/unodraw/unoipset.cxx4
-rw-r--r--svx/source/unodraw/unomod.cxx2
-rw-r--r--svx/source/unodraw/unomtabl.cxx8
-rw-r--r--svx/source/unodraw/unonrule.cxx2
-rw-r--r--svx/source/unodraw/unoshap2.cxx2
-rw-r--r--svx/source/unodraw/unoshape.cxx13
-rw-r--r--svx/source/unodraw/unoshtxt.cxx9
-rw-r--r--svx/source/unodraw/unottabl.cxx4
-rw-r--r--svx/source/unoedit/unoedsrc.cxx2
-rw-r--r--svx/source/unoedit/unofored.cxx2
-rw-r--r--svx/source/unoedit/unoforou.cxx6
-rw-r--r--svx/source/unoedit/unotext.cxx8
-rw-r--r--svx/source/unoedit/unotext2.cxx2
-rw-r--r--svx/source/unogallery/unogalitem.cxx12
-rw-r--r--svx/source/unogallery/unogaltheme.cxx6
-rw-r--r--svx/source/unogallery/unogaltheme.hxx2
-rw-r--r--svx/source/unogallery/unogalthemeprovider.cxx4
-rw-r--r--svx/source/xml/xmlgrhlp.cxx2
-rw-r--r--svx/source/xml/xmltxtexp.cxx4
-rw-r--r--svx/source/xml/xmltxtimp.cxx2
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx2
-rw-r--r--svx/source/xoutdev/xattr.cxx6
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx2
-rw-r--r--svx/source/xoutdev/xexch.cxx8
-rw-r--r--svx/source/xoutdev/xpool.cxx2
-rw-r--r--svx/source/xoutdev/xtabbtmp.cxx2
-rw-r--r--svx/source/xoutdev/xtabcolr.cxx2
-rw-r--r--svx/source/xoutdev/xtabdash.cxx2
-rw-r--r--svx/source/xoutdev/xtabgrdt.cxx2
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx2
-rw-r--r--svx/source/xoutdev/xtablend.cxx2
-rw-r--r--svx/util/cui.map7
-rw-r--r--svx/util/hidother.src409
-rw-r--r--svx/util/makefile.mk90
-rw-r--r--svx/workben/edittest.cxx8
-rw-r--r--svx/workben/msview/msview.cxx2
-rw-r--r--sysui/desktop/debian/makefile.mk20
-rw-r--r--sysui/desktop/productversion.mk2
-rw-r--r--sysui/desktop/slackware/makefile.mk20
-rwxr-xr-xucb/qa/complex/tdoc/interfaces/makefile.mk2
-rwxr-xr-xucb/qa/complex/tdoc/makefile.mk2
-rwxr-xr-xucb/qa/complex/ucb/makefile.mk2
-rw-r--r--ucb/source/ucp/gio/gio_mount.cxx2
-rw-r--r--ucb/source/ucp/odma/odma_content.cxx2
-rw-r--r--ucb/source/ucp/odma/odma_datasupplier.cxx8
-rw-r--r--ucb/source/ucp/odma/odma_provider.cxx22
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.cxx5
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx11
-rw-r--r--uui/source/cookiedg.cxx2
-rw-r--r--uui/source/iahndl.cxx6
-rw-r--r--uui/source/secmacrowarnings.hxx2
-rw-r--r--vbahelper/inc/vbahelper/helperdecl.hxx (renamed from svx/source/cui/splitcelldlg.hxx)66
-rw-r--r--vbahelper/inc/vbahelper/vbaapplicationbase.hxx64
-rw-r--r--vbahelper/inc/vbahelper/vbacollectionimpl.hxx257
-rw-r--r--vbahelper/inc/vbahelper/vbadialogbase.hxx (renamed from svx/inc/radiobtnbox.hxx)48
-rw-r--r--vbahelper/inc/vbahelper/vbadialogsbase.hxx54
-rw-r--r--vbahelper/inc/vbahelper/vbadllapi.h (renamed from svx/inc/optspell.hrc)23
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentbase.hxx73
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentsbase.hxx69
-rw-r--r--vbahelper/inc/vbahelper/vbafontbase.hxx99
-rw-r--r--vbahelper/inc/vbahelper/vbaglobalbase.hxx53
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx231
-rw-r--r--vbahelper/inc/vbahelper/vbahelperinterface.hxx121
-rw-r--r--vbahelper/inc/vbahelper/vbapagesetupbase.hxx70
-rw-r--r--vbahelper/inc/vbahelper/vbapropvalue.hxx (renamed from svx/source/cui/newtabledlg.hxx)49
-rw-r--r--vbahelper/inc/vbahelper/vbashape.hxx118
-rw-r--r--vbahelper/inc/vbahelper/vbashaperange.hxx89
-rw-r--r--vbahelper/inc/vbahelper/vbashapes.hxx84
-rw-r--r--vbahelper/inc/vbahelper/vbatextframe.hxx70
-rw-r--r--vbahelper/inc/vbahelper/vbawindowbase.hxx66
-rw-r--r--vbahelper/prj/build.lst6
-rw-r--r--vbahelper/prj/d.lst27
-rw-r--r--vbahelper/source/msforms/makefile.mk (renamed from sandbox/test/com/sun/star/lib/sandbox/makefile.mk)50
-rw-r--r--vbahelper/source/msforms/service.cxx83
-rw-r--r--vbahelper/source/msforms/vbabutton.cxx74
-rw-r--r--vbahelper/source/msforms/vbabutton.hxx (renamed from sandbox/com/sun/star/lib/sandbox/SandboxThreadGroup.java)58
-rw-r--r--vbahelper/source/msforms/vbacheckbox.cxx112
-rw-r--r--vbahelper/source/msforms/vbacheckbox.hxx61
-rw-r--r--vbahelper/source/msforms/vbacombobox.cxx183
-rw-r--r--vbahelper/source/msforms/vbacombobox.hxx80
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx539
-rw-r--r--vbahelper/source/msforms/vbacontrol.hxx114
-rw-r--r--vbahelper/source/msforms/vbacontrols.cxx232
-rw-r--r--vbahelper/source/msforms/vbacontrols.hxx62
-rw-r--r--vbahelper/source/msforms/vbaframe.cxx93
-rw-r--r--vbahelper/source/msforms/vbaframe.hxx58
-rw-r--r--vbahelper/source/msforms/vbaimage.cxx (renamed from svx/inc/optjsearch.hrc)52
-rw-r--r--vbahelper/source/msforms/vbaimage.hxx (renamed from svx/source/cui/ControlFocusHelper.hxx)33
-rw-r--r--vbahelper/source/msforms/vbalabel.cxx88
-rw-r--r--vbahelper/source/msforms/vbalabel.hxx56
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx290
-rw-r--r--vbahelper/source/msforms/vbalistbox.hxx90
-rw-r--r--vbahelper/source/msforms/vbalistcontrolhelper.cxx146
-rw-r--r--vbahelper/source/msforms/vbalistcontrolhelper.hxx20
-rw-r--r--vbahelper/source/msforms/vbamultipage.cxx132
-rw-r--r--vbahelper/source/msforms/vbamultipage.hxx65
-rw-r--r--vbahelper/source/msforms/vbapages.cxx80
-rw-r--r--vbahelper/source/msforms/vbapages.hxx64
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.cxx78
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.hxx59
-rw-r--r--vbahelper/source/msforms/vbaradiobutton.cxx107
-rw-r--r--vbahelper/source/msforms/vbaradiobutton.hxx55
-rw-r--r--vbahelper/source/msforms/vbascrollbar.cxx139
-rw-r--r--vbahelper/source/msforms/vbascrollbar.hxx66
-rw-r--r--vbahelper/source/msforms/vbaspinbutton.cxx109
-rw-r--r--vbahelper/source/msforms/vbaspinbutton.hxx61
-rw-r--r--vbahelper/source/msforms/vbatextbox.cxx137
-rw-r--r--vbahelper/source/msforms/vbatextbox.hxx59
-rw-r--r--vbahelper/source/msforms/vbatogglebutton.cxx108
-rw-r--r--vbahelper/source/msforms/vbatogglebutton.hxx63
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx227
-rw-r--r--vbahelper/source/msforms/vbauserform.hxx77
-rw-r--r--vbahelper/source/vbahelper/makefile.mk (renamed from sandbox/util/makefile.mk)52
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx218
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.cxx190
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.hxx128
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.cxx212
-rw-r--r--vbahelper/source/vbahelper/vbacommandbar.hxx83
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.cxx259
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.hxx122
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.cxx256
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.hxx75
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx282
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.hxx110
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.cxx238
-rw-r--r--vbahelper/source/vbahelper/vbacommandbars.hxx71
-rw-r--r--vbahelper/source/vbahelper/vbadialogbase.cxx (renamed from sandbox/com/sun/star/lib/sandbox/Resource.java)39
-rw-r--r--vbahelper/source/vbahelper/vbadialogsbase.cxx (renamed from svx/inc/hlmarkwn_def.hxx)22
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx228
-rw-r--r--vbahelper/source/vbahelper/vbadocumentsbase.cxx305
-rw-r--r--vbahelper/source/vbahelper/vbafillformat.cxx202
-rw-r--r--vbahelper/source/vbahelper/vbafillformat.hxx74
-rw-r--r--vbahelper/source/vbahelper/vbafontbase.cxx309
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx126
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx1198
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx.rej45
-rw-r--r--vbahelper/source/vbahelper/vbalineformat.cxx458
-rw-r--r--vbahelper/source/vbahelper/vbalineformat.hxx85
-rw-r--r--vbahelper/source/vbahelper/vbapagesetupbase.cxx325
-rw-r--r--vbahelper/source/vbahelper/vbapictureformat.cxx147
-rw-r--r--vbahelper/source/vbahelper/vbapictureformat.hxx64
-rw-r--r--vbahelper/source/vbahelper/vbapropvalue.cxx (renamed from sandbox/com/sun/star/lib/sandbox/WeakEntry.java)28
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx676
-rw-r--r--vbahelper/source/vbahelper/vbashaperange.cxx382
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx491
-rw-r--r--vbahelper/source/vbahelper/vbatextframe.cxx169
-rw-r--r--vbahelper/source/vbahelper/vbawindowbase.cxx180
-rw-r--r--vbahelper/util/makefile.mk104
-rw-r--r--vbahelper/util/msforms.map9
-rw-r--r--xmlhelp/prj/build.lst2
-rw-r--r--xmlhelp/source/com/sun/star/help/MANIFEST.MF1
-rw-r--r--xmlhelp/source/com/sun/star/help/makefile.mk19
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx130
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx30
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx2
-rw-r--r--xmlhelp/source/treeview/makefile.mk3
-rw-r--r--xmlhelp/source/treeview/tvread.cxx50
-rw-r--r--xmlhelp/util/makefile.mk8
-rw-r--r--xmloff/inc/VisAreaContext.hxx2
-rw-r--r--xmloff/inc/VisAreaExport.hxx2
-rw-r--r--xmloff/inc/pch/precompiled_xmloff.hxx24
-rw-r--r--xmloff/inc/txtfldi.hxx5
-rw-r--r--xmloff/inc/xexptran.hxx2
-rw-r--r--xmloff/inc/xmlcnitm.hxx2
-rw-r--r--xmloff/inc/xmlehelp.hxx2
-rw-r--r--xmloff/inc/xmloff/ProgressBarHelper.hxx2
-rw-r--r--xmloff/inc/xmloff/maptype.hxx2
-rw-r--r--xmloff/inc/xmloff/styleexp.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlcnimp.hxx4
-rw-r--r--xmloff/inc/xmloff/xmlexp.hxx8
-rw-r--r--xmloff/inc/xmloff/xmlnume.hxx2
-rw-r--r--xmloff/inc/xmloff/xmluconv.hxx2
-rw-r--r--xmloff/prj/build.lst2
-rw-r--r--xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx2
-rw-r--r--xmloff/source/core/ProgressBarHelper.cxx4
-rw-r--r--xmloff/source/core/attrlist.cxx13
-rw-r--r--xmloff/source/core/i18nmap.cxx2
-rw-r--r--xmloff/source/core/xmlehelp.cxx77
-rw-r--r--xmloff/source/core/xmlerror.cxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx4
-rw-r--r--xmloff/source/core/xmlimp.cxx8
-rw-r--r--xmloff/source/core/xmltkmap.cxx2
-rw-r--r--xmloff/source/core/xmluconv.cxx2
-rw-r--r--xmloff/source/draw/shapeexport.cxx2
-rw-r--r--xmloff/source/draw/shapeexport2.cxx2
-rw-r--r--xmloff/source/draw/shapeexport3.cxx7
-rw-r--r--xmloff/source/draw/xexptran.cxx2
-rw-r--r--xmloff/source/draw/ximpstyl.cxx2
-rw-r--r--xmloff/source/forms/elementexport.cxx3
-rw-r--r--xmloff/source/forms/formenums.cxx2
-rw-r--r--xmloff/source/forms/gridcolumnproptranslator.cxx10
-rw-r--r--xmloff/source/forms/layerimport.cxx2
-rw-r--r--xmloff/source/script/XMLEventExport.cxx5
-rw-r--r--xmloff/source/style/EnumPropertyHdl.cxx14
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx4
-rw-r--r--xmloff/source/style/fonthdl.cxx2
-rw-r--r--xmloff/source/style/impastpl.hxx2
-rw-r--r--xmloff/source/style/numehelp.cxx2
-rw-r--r--xmloff/source/style/postuhdl.cxx2
-rw-r--r--xmloff/source/style/styleexp.cxx2
-rw-r--r--xmloff/source/style/weighhdl.cxx49
-rw-r--r--xmloff/source/style/xmlexppr.cxx2
-rw-r--r--xmloff/source/style/xmlnume.cxx2
-rw-r--r--xmloff/source/style/xmlnumfe.cxx12
-rw-r--r--xmloff/source/style/xmlnumfi.cxx8
-rw-r--r--xmloff/source/style/xmlnumi.cxx4
-rw-r--r--xmloff/source/style/xmlstyle.cxx12
-rw-r--r--xmloff/source/style/xmltabi.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx2
-rw-r--r--xmloff/source/text/XMLSectionImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextColumnsContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListAutoStylePool.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx13
-rw-r--r--xmloff/source/text/txtfldi.cxx33
-rw-r--r--xmloff/source/text/txtimp.cxx62
-rw-r--r--xmloff/source/text/txtimppr.cxx14
-rw-r--r--xmloff/source/text/txtparae.cxx41
-rw-r--r--xmloff/source/text/txtparai.cxx2
-rw-r--r--xmloff/source/text/txtparaimphint.hxx2
-rw-r--r--xmloff/source/text/txtprhdl.cxx2
-rw-r--r--xmloff/source/text/txtstyli.cxx60
-rw-r--r--xmloff/source/transform/StyleOOoTContext.cxx2
-rw-r--r--xmloff/source/transform/TransformerBase.cxx4
-rw-r--r--xmloff/util/makefile.mk3
1886 files changed, 38555 insertions, 204915 deletions
diff --git a/avmedia/inc/avmedia/mediaitem.hxx b/avmedia/inc/avmedia/mediaitem.hxx
index 31aa6e9d597c..b341a8f61998 100644
--- a/avmedia/inc/avmedia/mediaitem.hxx
+++ b/avmedia/inc/avmedia/mediaitem.hxx
@@ -33,7 +33,7 @@
#include <tools/rtti.hxx>
#ifndef _POOLITEM_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#endif
#include <com/sun/star/media/ZoomLevel.hpp>
diff --git a/avmedia/inc/avmedia/mediatoolbox.hxx b/avmedia/inc/avmedia/mediatoolbox.hxx
index f9a52d584ea0..e7e1e0df2d1c 100644
--- a/avmedia/inc/avmedia/mediatoolbox.hxx
+++ b/avmedia/inc/avmedia/mediatoolbox.hxx
@@ -31,7 +31,7 @@
#ifndef _AVMEDIA_MEDIATOOLBOX_HXX
#define _AVMEDIA_MEDIATOOLBOX_HXX
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <sfx2/tbxctrl.hxx>
namespace avmedia
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 9ed28adc7067..e5ecac180b6c 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -37,7 +37,7 @@
#include <tools/time.hxx>
#include <vcl/svapp.hxx>
#include <vcl/lstbox.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <sfx2/viewfrm.hxx>
#include <math.h>
#include <algorithm>
diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx
index 52c8cf61b103..6c2ea64f1fcc 100644
--- a/avmedia/source/framework/mediaplayer.cxx
+++ b/avmedia/source/framework/mediaplayer.cxx
@@ -35,7 +35,7 @@
#include "mediacontrol.hrc"
#include "helpids.hrc"
-#include <svtools/stritem.hxx>
+#include <svl/stritem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/bindings.hxx>
diff --git a/avmedia/source/java/makefile.mk b/avmedia/source/java/makefile.mk
index b445aa87d62e..f207713ac47a 100644
--- a/avmedia/source/java/makefile.mk
+++ b/avmedia/source/java/makefile.mk
@@ -51,7 +51,7 @@ JAVAFILES = \
FrameGrabber.java \
x11$/SystemWindowAdapter.java
-JARFILES = sandbox.jar jurt.jar unoil.jar ridl.jar juh.jar java_uno.jar jmf.jar
+JARFILES = jurt.jar unoil.jar ridl.jar juh.jar java_uno.jar jmf.jar
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:s/.java//).class)
JARTARGET = $(TARGET).jar
diff --git a/avmedia/source/quicktime/player.cxx b/avmedia/source/quicktime/player.cxx
index e8289570b5ae..29332698016e 100644
--- a/avmedia/source/quicktime/player.cxx
+++ b/avmedia/source/quicktime/player.cxx
@@ -100,8 +100,6 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
if ((result == noErr) && (mnVersion >= QT701))
{
// we have version 7.01 or later, initialize
- mpMovie = [QTMovie movie];
- [mpMovie retain];
mbInitialized = true;
}
[pool release];
@@ -111,44 +109,58 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
Player::~Player()
{
- if( mbInitialized )
+ if( mpMovie )
{
- if( mpMovie )
- {
- [mpMovie release];
- mpMovie = nil;
- }
-
+ [mpMovie release];
+ mpMovie = nil;
}
}
+// ------------------------------------------------------------------------------
+QTMovie* Player::getMovie()
+{
+ OSL_ASSERT( mpMovie );
+ return mpMovie;
+}
// ------------------------------------------------------------------------------
bool Player::create( const ::rtl::OUString& rURL )
{
bool bRet = false;
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSString* aNSStr = [[[NSString alloc] initWithCharacters: rURL.getStr() length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
-// NSString * aNSStringEscaped = [aNSStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSURL* aURL = [NSURL URLWithString:aNSStr ];
-
// create the Movie
-
if( mbInitialized )
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ if( mpMovie )
+ {
+ [mpMovie release];
+ mpMovie = nil;
+ }
+
+ NSString* aNSStr = [[[NSString alloc] initWithCharacters: rURL.getStr() length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
+ NSURL* aURL = [NSURL URLWithString:aNSStr ];
+
- mpMovie = [mpMovie initWithURL:aURL error:nil];
+ NSError* pErr = nil;
+ mpMovie = [QTMovie movieWithURL:aURL error:&pErr];
if(mpMovie)
{
[mpMovie retain];
maURL = rURL;
bRet = true;
}
+ if( pErr )
+ {
+ OSL_TRACE( "NSMovie create failed with error %ld (%s)",
+ (long)[pErr code],
+ [[pErr localizedDescription] cString]
+ );
+ }
+ [pool release];
}
- [pool release];
-
return bRet;
}
@@ -159,10 +171,10 @@ void SAL_CALL Player::start( )
{
OSL_TRACE ("Player::start");
- if ( mbInitialized && mpMovie )
- {
+ if( mpMovie )
+ {
[mpMovie play];
- }
+ }
}
// ------------------------------------------------------------------------------
@@ -171,11 +183,10 @@ void SAL_CALL Player::stop( )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::stop");
- if ( mpMovie )
+ if( mpMovie )
{
- [mpMovie stop];
+ [mpMovie stop];
}
-
}
// ------------------------------------------------------------------------------
@@ -185,7 +196,7 @@ sal_Bool SAL_CALL Player::isPlaying()
{
bool bRet = false;
- if ( mbInitialized )
+ if ( mpMovie )
{
if ([mpMovie rate] != 0)
{
@@ -220,10 +231,10 @@ void SAL_CALL Player::setMediaTime( double fTime )
{
OSL_TRACE ("Player::setMediaTime");
- if ( mpMovie )
- {
- [mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
- }
+ if ( mpMovie )
+ {
+ [mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
+ }
}
// ------------------------------------------------------------------------------
@@ -244,7 +255,6 @@ double SAL_CALL Player::getMediaTime( )
stop();
}
-
return position;
}
@@ -256,7 +266,6 @@ void SAL_CALL Player::setStopTime( double fTime )
OSL_TRACE ("Player::setStopTime %f", fTime);
mnStopTime = fTime;
-
}
// ------------------------------------------------------------------------------
@@ -264,9 +273,7 @@ void SAL_CALL Player::setStopTime( double fTime )
double SAL_CALL Player::getStopTime( )
throw (uno::RuntimeException)
{
- double fRet = 0.0;
-
- fRet = mnStopTime;
+ double fRet = mnStopTime;
return fRet;
}
diff --git a/avmedia/source/quicktime/player.hxx b/avmedia/source/quicktime/player.hxx
index b7cab51005f4..c49ccd62915c 100644
--- a/avmedia/source/quicktime/player.hxx
+++ b/avmedia/source/quicktime/player.hxx
@@ -83,7 +83,7 @@ public:
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- QTMovie* getMovie() { return mpMovie; }
+ QTMovie* getMovie();
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index 5a3376c0ce65..4cf91bd3d199 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -36,7 +36,7 @@
#include "mediawindow.hrc"
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/filedlghelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index 05acc545c77b..2506c179f413 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -147,9 +147,9 @@ void MediaWindowBaseImpl::stopPlayingInternal( bool bStop )
if( isPlaying() )
{
if( bStop )
- mxPlayer->start();
- else
mxPlayer->stop();
+ else
+ mxPlayer->start();
}
}
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx
index 277bf6b9c34e..29f2d7ebc25c 100644
--- a/basic/inc/basic/basmgr.hxx
+++ b/basic/inc/basic/basmgr.hxx
@@ -32,7 +32,7 @@
#define _BASMGR_HXX
#include <tools/string.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <basic/sbstar.hxx>
#include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
#include <com/sun/star/script/XStarBasicAccess.hpp>
@@ -231,6 +231,8 @@ public:
::com::sun::star::uno::Any
SetGlobalUNOConstant( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Any& _rValue );
+ /** retrieves a global constant in the basic library, referring to some UNO object, returns true if a value is found ( value is in aOut ) false otherwise. */
+ bool GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
/** determines whether there are password-protected modules whose size exceedes the
legacy module size
@param _out_rModuleNames
diff --git a/basic/inc/basic/sbdef.hxx b/basic/inc/basic/sbdef.hxx
index dbb6e703b0c6..f15391e227d1 100644
--- a/basic/inc/basic/sbdef.hxx
+++ b/basic/inc/basic/sbdef.hxx
@@ -32,7 +32,7 @@
#define _SB_SBDEF_HXX
#include <basic/sbxdef.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#define _BASIC_TEXTPORTIONS
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index 3ec0803eb4a9..1278972135f9 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -74,6 +74,11 @@ class StarBASIC : public SbxObject
BOOL bDocBasic;
BasicLibInfo* pLibInfo; // Info block for basic manager
SbLanguageMode eLanguageMode; // LanguageMode of the basic object
+ BOOL bQuit;
+
+ SbxObjectRef pVBAGlobals;
+ SbxObject* getVBAGlobals( );
+
protected:
BOOL CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen );
private:
@@ -196,6 +201,10 @@ public:
SbxObjectRef getRTL( void ) { return pRtl; }
BOOL IsDocBasic() { return bDocBasic; }
+ SbxVariable* VBAFind( const String& rName, SbxClassType t );
+ bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
+ void QuitAndExitApplication();
+ BOOL IsQuitApplication() { return bQuit; };
};
#ifndef __SB_SBSTARBASICREF_HXX
diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx
index ce2e992da854..87aacbcab44f 100644
--- a/basic/inc/basic/sbx.hxx
+++ b/basic/inc/basic/sbx.hxx
@@ -32,9 +32,9 @@
#define _SBXCLASS_HXX
#include "tools/ref.hxx"
-#include "svtools/svarray.hxx"
-#include "svtools/smplhint.hxx"
-#include "svtools/lstner.hxx"
+#include "svl/svarray.hxx"
+#include "svl/smplhint.hxx"
+#include "svl/lstner.hxx"
#include <basic/sbxdef.hxx>
#include <basic/sbxform.hxx>
diff --git a/basic/inc/basic/sbxbase.hxx b/basic/inc/basic/sbxbase.hxx
index dc7707cce57d..c8cd59ba320f 100644
--- a/basic/inc/basic/sbxbase.hxx
+++ b/basic/inc/basic/sbxbase.hxx
@@ -33,7 +33,7 @@
#include <i18npool/lang.h>
#include "tools/list.hxx"
-#include "svtools/svarray.hxx"
+#include "svl/svarray.hxx"
#include <basic/sbxdef.hxx>
class SbxFactory;
diff --git a/basic/inc/basic/sbxobj.hxx b/basic/inc/basic/sbxobj.hxx
index 6a62f4a52978..bd3bb8333b54 100644
--- a/basic/inc/basic/sbxobj.hxx
+++ b/basic/inc/basic/sbxobj.hxx
@@ -31,7 +31,7 @@
#ifndef _SBX_SBXOBJECT_HXX
#define _SBX_SBXOBJECT_HXX
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <basic/sbxvar.hxx>
///////////////////////////////////////////////////////////////////////////
diff --git a/basic/inc/basic/testtool.hxx b/basic/inc/basic/testtool.hxx
index 1cdb42fd042c..64645e05ba55 100644
--- a/basic/inc/basic/testtool.hxx
+++ b/basic/inc/basic/testtool.hxx
@@ -30,7 +30,7 @@
#ifndef _BASIC_TESTTOOL_HXX_
#define _BASIC_TESTTOOL_HXX_
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <tools/string.hxx>
#define TESTTOOL_DEFAULT_PORT 12479
diff --git a/basic/inc/pch/precompiled_basic.hxx b/basic/inc/pch/precompiled_basic.hxx
index efeab112b2eb..505705bd5ad9 100644
--- a/basic/inc/pch/precompiled_basic.hxx
+++ b/basic/inc/pch/precompiled_basic.hxx
@@ -173,35 +173,35 @@
#include "sot/storage.hxx"
#include "sot/storinfo.hxx"
-#include "svtools/brdcst.hxx"
+#include "svl/brdcst.hxx"
#include "svtools/ctrlbox.hxx"
#include "svtools/ctrltool.hxx"
#include "svtools/ehdl.hxx"
#include "svtools/filedlg.hxx"
-#include "svtools/hint.hxx"
-#include "svtools/lstner.hxx"
-#include "svtools/pathoptions.hxx"
+#include "svl/hint.hxx"
+#include "svl/lstner.hxx"
+#include "unotools/pathoptions.hxx"
#include "svtools/sfxecode.hxx"
-#include "svtools/smplhint.hxx"
+#include "svl/smplhint.hxx"
#include "vcl/solar.hrc"
#include "svtools/stringtransfer.hxx"
-#include "svtools/svarray.hxx"
-#include "svtools/svdde.hxx"
+#include "svl/svarray.hxx"
+#include "svl/svdde.hxx"
#include "svtools/svmedit.hxx"
-#include "svtools/svstdarr.hxx"
+#include "svl/svstdarr.hxx"
#include "svtools/svtdata.hxx"
-#include "svtools/svtools.hrc"
+#include "svl/svtools.hrc"
#include "svtools/svtreebx.hxx"
-#include "svtools/syslocale.hxx"
+#include "unotools/syslocale.hxx"
#include "svtools/taskbar.hxx"
#include "svtools/textdata.hxx"
#include "svtools/texteng.hxx"
#include "svtools/textview.hxx"
#include "svtools/transfer.hxx"
#include "svtools/txtattr.hxx"
-#include "svtools/undo.hxx"
-#include "svtools/zforlist.hxx"
-#include "svtools/zformat.hxx"
+#include "svl/undo.hxx"
+#include "svl/zforlist.hxx"
+#include "svl/zformat.hxx"
#include "tools/color.hxx"
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index ed25b15ebddf..4cc2765604fd 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -80,7 +80,7 @@
#include <com/sun/star/ucb/XContentProviderManager.hpp>
#include <ucbhelper/content.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
using namespace comphelper;
using namespace cppu;
diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx
index 4fc9e9cb9c07..68b3db186785 100644
--- a/basic/source/app/app.hxx
+++ b/basic/source/app/app.hxx
@@ -42,8 +42,8 @@
#include <vcl/wrkwin.hxx>
#endif
#include <vcl/timer.hxx>
-#include <svtools/brdcst.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
class BasicFrame;
#include <basic/mybasic.hxx>
diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx
index a9b7b1d03b77..31e4192e5965 100644
--- a/basic/source/app/appedit.cxx
+++ b/basic/source/app/appedit.cxx
@@ -34,7 +34,7 @@
#include <svtools/ctrltool.hxx>
#include <svtools/textview.hxx>
#include <svtools/texteng.hxx>
-#include <svtools/undo.hxx>
+#include <svl/undo.hxx>
#ifndef _BASIC_TTRESHLP_HXX
#include <basic/ttstrhlp.hxx>
diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index e2daa7608d78..8536ac087383 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -60,7 +60,7 @@
#include <svtools/stringtransfer.hxx>
#include <vcl/splitwin.hxx>
#ifndef _ZFORLIST_HXX //autogen
-#include <svtools/zformat.hxx>
+#include <svl/zformat.hxx>
#endif
#include <svtools/ctrltool.hxx>
diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx
index 7d0755d39aa6..544d7c9f4d4d 100644
--- a/basic/source/app/msgedit.cxx
+++ b/basic/source/app/msgedit.cxx
@@ -48,7 +48,7 @@ Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8
#endif
#include <tools/fsys.hxx>
#include <svtools/stringtransfer.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#ifndef _BASIC_TTRESHLP_HXX
#include <basic/ttstrhlp.hxx>
#endif
diff --git a/basic/source/app/textedit.hxx b/basic/source/app/textedit.hxx
index 1598d4867140..5caf90d738d7 100644
--- a/basic/source/app/textedit.hxx
+++ b/basic/source/app/textedit.hxx
@@ -40,7 +40,7 @@ class BreakpointWindow;
#include <vcl/timer.hxx>
#include <tools/table.hxx>
#include <tools/debug.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <svtools/svmedit.hxx>
#include "dataedit.hxx"
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 17bd8a712763..3a0be2efa41c 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -44,8 +44,8 @@
/** === end UNO includes === **/
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/smplhint.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svl/smplhint.hxx>
#include <vcl/svapp.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 8cf8a674ec2f..0645bfb85c2a 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -33,20 +33,21 @@
#include <tools/stream.hxx>
#include <sot/storage.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/msgbox.hxx>
#include <basic/sbx.hxx>
#include <sot/storinfo.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <basic/sbmod.hxx>
#include <basic/sbuno.hxx>
#include <basic/basmgr.hxx>
+#include <sbunoobj.hxx>
#include "basrid.hxx"
#include "sbintern.hxx"
#include <sb.hrc>
@@ -1767,6 +1768,15 @@ BasicError* BasicManager::GetNextError()
DBG_CHKTHIS( BasicManager, 0 );
return pErrorMgr->GetNextError();
}
+bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut )
+{
+ bool bRes = false;
+ StarBASIC* pStandardLib = GetStdLib();
+ OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" );
+ if ( pStandardLib )
+ bRes = pStandardLib->GetUNOConstant( _pAsciiName, aOut );
+ return bRes;
+}
Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const Any& _rValue )
{
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 7776b57829c9..b0c8f4b3c36c 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -95,53 +95,48 @@ Any sbxToUnoValue( SbxVariable* pVar );
Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic )
{
- Reference< frame::XModel > xModel;
-
- SbxObject* basicChosen = pBasic;
-
- if ( basicChosen == NULL)
+ OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" );
+ if ( !pBasic )
+ return NULL;
+
+ // look for the ThisComponent variable, first in the parent (which
+ // might be the document's Basic), then in the parent's parent (which might be
+ // the application Basic)
+ const ::rtl::OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) );
+ SbxVariable* pThisComponent = NULL;
+
+ SbxObject* pLookup = pBasic->GetParent();
+ while ( pLookup && !pThisComponent )
{
- OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
- return xModel;
+ pThisComponent = pLookup->Find( sThisComponent, SbxCLASS_OBJECT );
+ pLookup = pLookup->GetParent();
}
- SbxObject* p = pBasic;
- SbxObject* pParent = p->GetParent();
- SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
-
- if( pParentParent )
+ if ( !pThisComponent )
{
- basicChosen = pParentParent;
+ OSL_TRACE("Failed to get ThisComponent");
+ // the application Basic, at the latest, should have this variable
+ return NULL;
}
- else if( pParent )
+
+ Any aThisComponent( sbxToUnoValue( pThisComponent ) );
+ Reference< frame::XModel > xModel( aThisComponent, UNO_QUERY );
+ if ( !xModel.is() )
{
- basicChosen = pParent;
+ // it's no XModel. Okay, ThisComponent nowadays is allowed to be a controller.
+ Reference< frame::XController > xController( aThisComponent, UNO_QUERY );
+ if ( xController.is() )
+ xModel = xController->getModel();
}
+ if ( !xModel.is() )
+ return NULL;
- Any aModel;
- SbxVariable *pCompVar = basicChosen->Find( UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT );
+#if OSL_DEBUG_LEVEL > 0
+ OSL_TRACE("Have model ThisComponent points to url %s",
+ ::rtl::OUStringToOString( xModel->getURL(),
+ RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+#endif
- if ( pCompVar )
- {
- aModel = sbxToUnoValue( pCompVar );
- if ( sal_False == ( aModel >>= xModel ) ||
- !xModel.is() )
- {
- OSL_TRACE("Failed to extract model from thisComponent ");
- return xModel;
- }
- else
- {
- OSL_TRACE("Have model ThisComponent points to url %s",
- ::rtl::OUStringToOString( xModel->getURL(),
- RTL_TEXTENCODING_ASCII_US ).pData->buffer );
-
- }
- }
- else
- {
- OSL_TRACE("Failed to get ThisComponent");
- }
return xModel;
}
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx
index aed5b2b3c575..f54cdc800d38 100644
--- a/basic/source/classes/propacc.cxx
+++ b/basic/source/classes/propacc.cxx
@@ -35,7 +35,7 @@
#include <tools/urlobj.hxx>
#include <tools/errcode.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <basic/sbstar.hxx>
#include <sbunoobj.hxx>
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index af056b884826..80fa3c6bb836 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -65,7 +65,29 @@ SV_IMPL_VARARR(SbTextPortions,SbTextPortion)
TYPEINIT1(StarBASIC,SbxObject)
#define RTLNAME "@SBRTL"
+// i#i68894#
+const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
+const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+
+SbxObject* StarBASIC::getVBAGlobals( )
+{
+ if ( !pVBAGlobals )
+ pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE );
+ return pVBAGlobals;
+}
+
+// i#i68894#
+SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t )
+{
+ if( rName == aThisComponent )
+ return NULL;
+ // rename to init globals
+ if ( getVBAGlobals( ) )
+ return pVBAGlobals->Find( rName, t );
+ return NULL;
+
+}
// Create array for conversion SFX <-> VB error code
struct SFX_VB_ErrorItem
{
@@ -303,32 +325,32 @@ SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( pProp )
{
SbxProperty* pNewProp = new SbxProperty( *pProp );
- if( pVar->GetType() & SbxARRAY )
- {
- SbxBase* pParObj = pVar->GetObject();
- SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
- SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
- INT32 lb = 0;
- INT32 ub = 0;
-
- pDest->setHasFixedSize( pSource->hasFixedSize() );
- if ( pSource->GetDims() && pSource->hasFixedSize() )
- {
- for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
- {
- pSource->GetDim32( (INT32)j, lb, ub );
- pDest->AddDim32( lb, ub );
- }
- }
- else
- pDest->unoAddDim( 0, -1 ); // variant array
-
- USHORT nSavFlags = pVar->GetFlags();
- pNewProp->ResetFlag( SBX_FIXED );
- // need to reset the FIXED flag
- // when calling PutObject ( because the type will not match Object )
- pNewProp->PutObject( pDest );
- pNewProp->SetFlags( nSavFlags );
+ if( pVar->GetType() & SbxARRAY )
+ {
+ SbxBase* pParObj = pVar->GetObject();
+ SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
+ INT32 lb = 0;
+ INT32 ub = 0;
+
+ pDest->setHasFixedSize( pSource->hasFixedSize() );
+ if ( pSource->GetDims() && pSource->hasFixedSize() )
+ {
+ for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
+ {
+ pSource->GetDim32( (INT32)j, lb, ub );
+ pDest->AddDim32( lb, ub );
+ }
+ }
+ else
+ pDest->unoAddDim( 0, -1 ); // variant array
+
+ USHORT nSavFlags = pVar->GetFlags();
+ pNewProp->ResetFlag( SBX_FIXED );
+ // need to reset the FIXED flag
+ // when calling PutObject ( because the type will not match Object )
+ pNewProp->PutObject( pDest );
+ pNewProp->SetFlags( nSavFlags );
}
pProps->PutDirect( pNewProp, i );
}
@@ -445,8 +467,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbProcedureProperty* pNewProp = new SbProcedureProperty
( pProcedureProp->GetName(), pProcedureProp->GetType() );
// ( pProcedureProp->GetName(), pProcedureProp->GetType(), this );
- pNewProp->SetFlags( nFlags_ ); // Copy flags
- pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set
+ pNewProp->SetFlags( nFlags_ ); // Copy flags
+ pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set
pProcedureProp->SetFlags( nFlags_ );
pProps->PutDirect( pNewProp, i );
StartListening( pNewProp->GetBroadcaster(), TRUE );
@@ -681,6 +703,8 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic )
pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this );
// Search via StarBasic is always global
SetFlag( SBX_GBLSEARCH );
+ pVBAGlobals = NULL;
+ bQuit = FALSE;
}
// #51727 Override SetModified so that the modified state
@@ -995,6 +1019,12 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy
return pVar;
}
+void StarBASIC::QuitAndExitApplication()
+{
+ Stop();
+ bQuit = TRUE;
+}
+
void StarBASIC::Stop()
{
SbiInstance* p = pINST;
@@ -1533,6 +1563,18 @@ BOOL StarBASIC::LoadOldModules( SvStream& )
return FALSE;
}
+bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut )
+{
+ bool bRes = false;
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
+ SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( sVarName, SbxCLASS_DONTCARE ) );
+ if ( pGlobs )
+ {
+ aOut = pGlobs->getUnoAny();
+ bRes = true;
+ }
+ return bRes;
+}
//========================================================================
// #118116 Implementation Collection object
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index a6ae8cac29af..26d17d77c84b 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -36,7 +36,7 @@
#ifndef _TOOLERR_HXX //autogen
#include <tools/errcode.hxx>
#endif
-#include <svtools/hint.hxx>
+#include <svl/hint.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -750,11 +750,11 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
// SbUnoObject instanzieren
String aName;
SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue );
- //If this is called externally e.g. from the scripting
- //framework then there is no 'active' runtime the default property will not be set up
- //only a vba object will have XDefaultProp set anyway so... this
- //test seems a bit of overkill
- //if ( SbiRuntime::isVBAEnabled() )
+ //If this is called externally e.g. from the scripting
+ //framework then there is no 'active' runtime the default property will not be set up
+ //only a vba object will have XDefaultProp set anyway so... this
+ //test seems a bit of overkill
+ //if ( SbiRuntime::isVBAEnabled() )
{
String sDfltPropName;
@@ -3377,9 +3377,10 @@ SbxVariable* SbUnoService::Find( const String& rName, SbxClassType )
// Create and insert SbUnoServiceCtor
SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor );
QuickInsert( (SbxVariable*)xSbCtorRef );
- pRes = xSbCtorRef;
}
}
+
+ pRes = SbxObject::Find( rName, SbxCLASS_METHOD );
}
}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 2a61557457b7..393719b71c2d 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -36,7 +36,7 @@
#include <vos/macros.hxx>
#include <vcl/svapp.hxx>
#include <tools/stream.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <tools/shl.hxx>
#include <basic/sbx.hxx>
#include "sb.hxx"
@@ -69,6 +69,11 @@
#endif
#include <stdio.h>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/processfactory.hxx>
+#include <vcl/svapp.hxx>
+ using namespace ::com::sun::star;
TYPEINIT1(SbModule,SbxObject)
@@ -84,7 +89,63 @@ SV_IMPL_VARARR(SbiBreakpoints,USHORT)
SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
+class AsyncQuitHandler
+{
+ AsyncQuitHandler() {}
+ AsyncQuitHandler( const AsyncQuitHandler&);
+public:
+ static AsyncQuitHandler& instance()
+ {
+ static AsyncQuitHandler dInst;
+ return dInst;
+ }
+ void QuitApplication()
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ if ( xFactory.is() )
+ {
+ uno::Reference< frame::XDesktop > xDeskTop( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ) ), uno::UNO_QUERY );
+ if ( xDeskTop.is() )
+ xDeskTop->terminate();
+ }
+ }
+ DECL_LINK( OnAsyncQuit, void* );
+};
+
+IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ )
+{
+ QuitApplication();
+ return 0L;
+}
+
+#if 0
+bool UnlockControllerHack( StarBASIC* pBasic )
+{
+ bool bRes = false;
+ if ( pBasic && pBasic->IsDocBasic() )
+ {
+ uno::Any aUnoVar;
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( "ThisComponent" ) );
+ SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( pBasic->Find( sVarName, SbxCLASS_DONTCARE ) );
+ if ( pGlobs )
+ aUnoVar = pGlobs->getUnoAny();
+ uno::Reference< frame::XModel > xModel( aUnoVar, uno::UNO_QUERY);
+ if ( xModel.is() )
+ {
+ try
+ {
+ xModel->unlockControllers();
+ bRes = true;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ }
+ return bRes;
+}
+#endif
/////////////////////////////////////////////////////////////////////////////
// Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen
@@ -696,6 +757,13 @@ USHORT SbModule::Run( SbMethod* pMeth )
pINST->nCallLvl--; // Call-Level wieder runter
StarBASIC::FatalError( SbERR_STACK_OVERFLOW );
}
+
+ // VBA always ensure screenupdating is enabled after completing
+ StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent());
+#if 0
+ if ( pBasic && pBasic->IsDocBasic() && !pINST )
+ UnlockControllerHack( pBasic );
+#endif
if( bDelInst )
{
// #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden,
@@ -705,6 +773,11 @@ USHORT SbModule::Run( SbMethod* pMeth )
delete pINST;
pINST = NULL;
}
+ if ( pBasic && pBasic->IsDocBasic() && pBasic->IsQuitApplication() && !pINST )
+ {
+ Application::PostUserEvent( LINK( &AsyncQuitHandler::instance(), AsyncQuitHandler, OnAsyncQuit ), NULL );
+ }
+
return nRes;
}
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index c3e8a000cf8c..8b840770a0e6 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -83,7 +83,7 @@ void SbiCodeGen::GenStmnt()
UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( eOpcode < SbOP0_START || eOpcode > SbOP0_END )
pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE1" );
#endif
@@ -94,7 +94,7 @@ UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode )
UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( eOpcode < SbOP1_START || eOpcode > SbOP1_END )
pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE2" );
#endif
@@ -107,7 +107,7 @@ UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd )
UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd1, UINT32 nOpnd2 )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( eOpcode < SbOP2_START || eOpcode > SbOP2_END )
pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE3" );
#endif
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index c18501c98e40..32a0007a61ca 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -170,7 +170,7 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
void SbiExprNode::GenElement( SbiOpcode eOp )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( (eOp < _RTL || eOp > _CALLC) && eOp != _FIND_G && eOp != _FIND_CM )
pGen->GetParser()->Error( SbERR_INTERNAL_ERROR, "Opcode" );
#endif
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 2eb87dcdcc52..089dc068773a 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -175,7 +175,7 @@ void SbiSymPool::Add( SbiSymDef* pDef )
{
if( pDef->pIn )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
// schon in einem anderen Pool drin!
pParser->Error( SbERR_INTERNAL_ERROR, "Dbl Pool" );
#endif
diff --git a/basic/source/inc/propacc.hxx b/basic/source/inc/propacc.hxx
index 565c7a358a97..698b3d453d5b 100644
--- a/basic/source/inc/propacc.hxx
+++ b/basic/source/inc/propacc.hxx
@@ -30,7 +30,7 @@
#ifndef _SFX_PROPBAG_HXX
#define _SFX_PROPBAG_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HXX_
#include <com/sun/star/beans/PropertyValue.hpp>
#endif
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index f3d691bf059a..7221ee68252f 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -31,7 +31,7 @@
#ifndef _SYMTBL_HXX
#define _SYMTBL_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <tools/string.hxx>
#include <basic/sbxdef.hxx>
#include <basic/sbdef.hxx>
diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx
index 751bd57cc808..425eec2eaf85 100644
--- a/basic/source/runtime/ddectrl.cxx
+++ b/basic/source/runtime/ddectrl.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basic.hxx"
#include <tools/errcode.hxx>
-#include <svtools/svdde.hxx>
+#include <svl/svdde.hxx>
#include "ddectrl.hxx"
#ifndef _SBERRORS_HXX
#include <basic/sberrors.hxx>
diff --git a/basic/source/runtime/dllmgr.hxx b/basic/source/runtime/dllmgr.hxx
index 607abaa843fa..ae25e570f10c 100644
--- a/basic/source/runtime/dllmgr.hxx
+++ b/basic/source/runtime/dllmgr.hxx
@@ -32,9 +32,9 @@
#define _DLLMGR_HXX
#define _SVSTDARR_BYTESTRINGSSORT
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#ifndef _SVSTDARR_HXX //autogen
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
// !!! nur zum debuggen fuer infoboxes !!!
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index e92c8c974eb2..6c26409a883c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -43,7 +43,7 @@
#include <vcl/wintypes.hxx>
#include <vcl/msgbox.hxx>
#include <basic/sbx.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <tools/urlobj.hxx>
#include <osl/time.h>
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index dbd66a61575c..bac63edb62f9 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -44,7 +44,7 @@
#ifndef _SBX_HXX
#include <basic/sbx.hxx>
#endif
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <tools/fsys.hxx>
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index cc276eea766b..6c83c6e2f3f1 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -33,8 +33,8 @@
#include <tools/fsys.hxx>
#include <vcl/svapp.hxx>
#include <tools/wldcrd.hxx>
-#include <svtools/zforlist.hxx>
-#include <svtools/syslocale.hxx>
+#include <svl/zforlist.hxx>
+#include <unotools/syslocale.hxx>
#include "runtime.hxx"
#include "sbintern.hxx"
#include "opcodes.hxx"
@@ -867,7 +867,7 @@ void SbiRuntime::PushVar( SbxVariable* pVar )
SbxVariableRef SbiRuntime::PopVar()
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( !nExprLvl )
{
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
@@ -902,7 +902,7 @@ BOOL SbiRuntime::ClearExprStack()
SbxVariable* SbiRuntime::GetTOS( short n )
{
n = nExprLvl - n - 1;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
if( n < 0 )
{
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index 938e5f6ad236..3c461c1f5541 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -160,7 +160,7 @@ void SbiRuntime::StepPAD( UINT32 nOp1 )
void SbiRuntime::StepJUMP( UINT32 nOp1 )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
// #QUESTION shouln't this be
// if( (BYTE*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() )
if( nOp1 >= pImg->GetCodeSize() )
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 413d3a6f4def..fb0b217b76c4 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -56,57 +56,6 @@ using com::sun::star::uno::Reference;
SbxVariable* getVBAConstant( const String& rName );
-const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
-const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
-// i#i68894#
-SbxArray* getVBAGlobals( )
-{
- static SbxArrayRef pArray;
- static bool isInitialised = false;
- if ( isInitialised )
- return pArray;
- Reference < XComponentContext > xCtx;
- Reference < XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- xCtx.set( xProps->getPropertyValue( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))),
- UNO_QUERY_THROW );
- SbUnoObject dGlobs( String( RTL_CONSTASCII_USTRINGPARAM("ExcelGlobals") ), xCtx->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ) );
-
- SbxVariable *vba = dGlobs.Find( String( RTL_CONSTASCII_USTRINGPARAM("getGlobals") ) , SbxCLASS_DONTCARE );
-
- if ( vba )
- {
- pArray = static_cast<SbxArray *>(vba->GetObject());
- isInitialised = true;
- return pArray;
- }
- return NULL;
-}
-
-// i#i68894#
-SbxVariable* VBAFind( const String& rName, SbxClassType t )
-{
- if( rName == aThisComponent )
- return NULL;
-
- SbxArray *pVBAGlobals = getVBAGlobals( );
- for (USHORT i = 0; pVBAGlobals && i < pVBAGlobals->Count(); i++)
- {
- SbxVariable *pElem = pVBAGlobals->Get( i );
- if (!pElem || !pElem->IsObject())
- continue;
- SbxObject *pVba = static_cast<SbxObject *>(pElem->GetObject());
- SbxVariable *pVbaVar = pVba ? pVba->Find( rName, t ) : NULL;
- if( pVbaVar )
- {
- return pVbaVar;
- }
- }
- return NULL;
-
-}
-
// Suchen eines Elements
// Die Bits im String-ID:
// 0x8000 - Argv ist belegt
@@ -191,7 +140,7 @@ SbxVariable* SbiRuntime::FindElement
if ( bVBAEnabled )
{
// Try Find in VBA symbols space
- pElem = VBAFind( aName, SbxCLASS_DONTCARE );
+ pElem = rBasic.VBAFind( aName, SbxCLASS_DONTCARE );
if ( pElem )
bSetName = false; // don't overwrite uno name
else
diff --git a/basic/source/sbx/format.src b/basic/source/sbx/format.src
index 8609bbc875b3..618b6d97a8d1 100644
--- a/basic/source/sbx/format.src
+++ b/basic/source/sbx/format.src
@@ -28,7 +28,7 @@
*
************************************************************************/
-#include "svtools/svtools.hrc"
+#include "svl/svtools.hrc"
String STR_BASICKEY_FORMAT_ON
{
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index c6862a88a56c..76bb917699ce 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basic.hxx"
#include <vcl/svapp.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <tools/errcode.hxx>
#include <tools/color.hxx>
#include <i18npool/lang.h>
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 3f747f27c5bd..bb62caba2076 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -35,7 +35,7 @@
#include <basic/sbx.hxx>
#include <basic/sbxbase.hxx>
#include "sbxres.hxx"
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
TYPEINIT1(SbxMethod,SbxVariable)
TYPEINIT1(SbxProperty,SbxVariable)
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index acc5d91c4e2e..1fc3ad018b15 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -34,7 +34,7 @@
#include <basic/sbx.hxx>
#include "sbxconv.hxx"
-#include "svtools/syslocale.hxx"
+#include "unotools/syslocale.hxx"
#if defined ( UNX )
#include <stdlib.h>
@@ -50,12 +50,12 @@
#include "sbxres.hxx"
#include <basic/sbxbase.hxx>
#include <basic/sbxform.hxx>
-#include <svtools/svtools.hrc>
+#include <svl/svtools.hrc>
#include "basrid.hxx"
#include "runtime.hxx"
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 66c56adc731a..2f517c3453ca 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -33,7 +33,7 @@
#include <tools/stream.hxx>
-#include "svtools/brdcst.hxx"
+#include "svl/brdcst.hxx"
#include <basic/sbx.hxx>
#include <basic/sbxbase.hxx>
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index f7e5f9a842e4..f199353c2d7a 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -51,7 +51,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <xmlscript/xmldlg_imexp.hxx>
#include <cppuhelper/factory.hxx>
#include <svtools/sfxecode.hxx>
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index c397e402fac4..02a7b174da1c 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -54,7 +54,7 @@
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <unotools/streamwrap.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <basic/basmgr.hxx>
@@ -940,7 +940,17 @@ sal_Bool SfxLibraryContainer::init_Impl(
// #110009
if( !bStorage && meInitMode == DEFAULT )
- implScanExtensions();
+ {
+ try
+ {
+ implScanExtensions();
+ }
+ catch( uno::Exception& )
+ {
+ // TODO: error handling?
+ OSL_ASSERT( "Cannot access extensions!" );
+ }
+ }
// #110009 Preload?
{
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index aad4815872c0..e72205744ce0 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -58,7 +58,7 @@
#include <tools/urlobj.hxx>
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <basic/basmgr.hxx>
diff --git a/configmgr/qa/unit/common.hxx b/configmgr/qa/unit/common.hxx
index d53d52d55ad7..7d5be659283c 100644
--- a/configmgr/qa/unit/common.hxx
+++ b/configmgr/qa/unit/common.hxx
@@ -44,7 +44,7 @@
#include "com/sun/star/uno/XComponentContext.hpp"
#include "cppuhelper/component_context.hxx"
#include "cppuhelper/servicefactory.hxx"
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "osl/file.hxx"
#include "osl/thread.h"
#include "osl/process.h"
diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk
index a6a79ebdd0ca..aededf799d4f 100644
--- a/configmgr/qa/unit/makefile.mk
+++ b/configmgr/qa/unit/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -41,7 +41,7 @@ DLLPRE = # no leading "lib" on .so files
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/performance.obj $(SLO)$/threading.obj $(SLO)$/ubootstrap.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
SHL1VERSIONMAP = export.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/configmgr/qa/unit/threading.cxx b/configmgr/qa/unit/threading.cxx
index 1531e9f49138..68baee1c6829 100644
--- a/configmgr/qa/unit/threading.cxx
+++ b/configmgr/qa/unit/threading.cxx
@@ -53,7 +53,7 @@ class KeyTester : public osl::Thread
virtual ~KeyTester ()
{
}
- virtual void run ()
+ virtual void SAL_CALL run ()
{
testIteration();
while (!m_pCond->check())
diff --git a/connectivity/inc/connectivity/FValue.hxx b/connectivity/inc/connectivity/FValue.hxx
index 4196e8d843d9..22a169f4025d 100644
--- a/connectivity/inc/connectivity/FValue.hxx
+++ b/connectivity/inc/connectivity/FValue.hxx
@@ -44,9 +44,15 @@
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdb/XColumn.hpp>
namespace connectivity
{
+ namespace detail
+ {
+ class IValueSource;
+ }
+
class OOO_DLLPUBLIC_DBTOOLS ORowSetValue
{
union
@@ -361,6 +367,12 @@ namespace connectivity
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow);
void fill(const ::com::sun::star::uno::Any& _rValue);
+
+ void fill( const sal_Int32 _nType,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn );
+
+ private:
+ void impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource );
};
/// ORowSetValueDecorator decorates a ORowSetValue so the value is "refcounted"
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index 20cb27644e29..87e1791ba72e 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -1,4 +1,4 @@
-cn connectivity : l10n comphelper MOZ:moz SO:moz_prebuilt svtools UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo officecfg NSS:nss NULL
+cn connectivity : shell l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb QADEVOOO:qadevOOo officecfg NSS:nss NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL
diff --git a/connectivity/qa/connectivity/tools/DbaseDatabase.java b/connectivity/qa/connectivity/tools/DbaseDatabase.java
index 9c1d6ea47411..8846c3995f56 100755..100644
--- a/connectivity/qa/connectivity/tools/DbaseDatabase.java
+++ b/connectivity/qa/connectivity/tools/DbaseDatabase.java
@@ -65,7 +65,8 @@ public class DbaseDatabase extends AbstractDatabase
private void createDBDocument() throws Exception
{
final File documentFile = File.createTempFile("dbase", ".odb");
- documentFile.deleteOnExit();
+ if ( documentFile.exists() )
+ documentFile.delete();
final File subPath = new File(documentFile.getParent() + File.separator + documentFile.getName().replaceAll(".odb", "") + File.separator );
subPath.mkdir();
//subPath.deleteOnExit();
diff --git a/connectivity/qa/connectivity/tools/HsqlDatabase.java b/connectivity/qa/connectivity/tools/HsqlDatabase.java
index d27816cf4b7e..593a5ad95981 100644
--- a/connectivity/qa/connectivity/tools/HsqlDatabase.java
+++ b/connectivity/qa/connectivity/tools/HsqlDatabase.java
@@ -71,7 +71,8 @@ public class HsqlDatabase extends AbstractDatabase
private void createDBDocument() throws Exception
{
final File documentFile = File.createTempFile("testdb", ".odb");
- documentFile.deleteOnExit();
+ if ( documentFile.exists() )
+ documentFile.delete();
m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index cd09efa227fe..f7943fc4cf45 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -40,13 +40,16 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/logfile.hxx>
-using namespace connectivity;
-using namespace dbtools;
+using namespace ::dbtools;
using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
+namespace connectivity
+{
+
namespace {
static sal_Bool isStorageCompatible(sal_Int32 _eType1, sal_Int32 _eType2)
{
@@ -1809,6 +1812,107 @@ void ORowSetValue::setSigned(sal_Bool _bMod)
}
}
}
+
+// -----------------------------------------------------------------------------
+namespace detail
+{
+ class SAL_NO_VTABLE IValueSource
+ {
+ public:
+ virtual ::rtl::OUString getString() const = 0;
+ virtual sal_Bool getBoolean() const = 0;
+ virtual sal_Int8 getByte() const = 0;
+ virtual sal_Int16 getShort() const = 0;
+ virtual sal_Int32 getInt() const = 0;
+ virtual sal_Int64 getLong() const = 0;
+ virtual float getFloat() const = 0;
+ virtual double getDouble() const = 0;
+ virtual Date getDate() const = 0;
+ virtual Time getTime() const = 0;
+ virtual DateTime getTimestamp() const = 0;
+ virtual Sequence< sal_Int8 > getBytes() const = 0;
+ virtual Reference< XInputStream > getBinaryStream() const = 0;
+ virtual Reference< XInputStream > getCharacterStream() const = 0;
+ virtual sal_Bool wasNull() const = 0;
+
+ virtual ~IValueSource() { }
+ };
+
+ class RowValue : public IValueSource
+ {
+ public:
+ RowValue( const Reference< XRow >& _xRow, const sal_Int32 _nPos )
+ :m_xRow( _xRow )
+ ,m_nPos( _nPos )
+ {
+ }
+
+ // IValueSource
+ virtual ::rtl::OUString getString() const { return m_xRow->getString( m_nPos ); };
+ virtual sal_Bool getBoolean() const { return m_xRow->getBoolean( m_nPos ); };
+ virtual sal_Int8 getByte() const { return m_xRow->getByte( m_nPos ); };
+ virtual sal_Int16 getShort() const { return m_xRow->getShort( m_nPos ); }
+ virtual sal_Int32 getInt() const { return m_xRow->getInt( m_nPos ); }
+ virtual sal_Int64 getLong() const { return m_xRow->getLong( m_nPos ); }
+ virtual float getFloat() const { return m_xRow->getFloat( m_nPos ); };
+ virtual double getDouble() const { return m_xRow->getDouble( m_nPos ); };
+ virtual Date getDate() const { return m_xRow->getDate( m_nPos ); };
+ virtual Time getTime() const { return m_xRow->getTime( m_nPos ); };
+ virtual DateTime getTimestamp() const { return m_xRow->getTimestamp( m_nPos ); };
+ virtual Sequence< sal_Int8 > getBytes() const { return m_xRow->getBytes( m_nPos ); };
+ virtual Reference< XInputStream > getBinaryStream() const { return m_xRow->getBinaryStream( m_nPos ); };
+ virtual Reference< XInputStream > getCharacterStream() const { return m_xRow->getCharacterStream( m_nPos ); };
+ virtual sal_Bool wasNull() const { return m_xRow->wasNull( ); };
+
+ private:
+ const Reference< XRow > m_xRow;
+ const sal_Int32 m_nPos;
+ };
+
+ class ColumnValue : public IValueSource
+ {
+ public:
+ ColumnValue( const Reference< XColumn >& _rxColumn )
+ :m_xColumn( _rxColumn )
+ {
+ }
+
+ // IValueSource
+ virtual ::rtl::OUString getString() const { return m_xColumn->getString(); };
+ virtual sal_Bool getBoolean() const { return m_xColumn->getBoolean(); };
+ virtual sal_Int8 getByte() const { return m_xColumn->getByte(); };
+ virtual sal_Int16 getShort() const { return m_xColumn->getShort(); }
+ virtual sal_Int32 getInt() const { return m_xColumn->getInt(); }
+ virtual sal_Int64 getLong() const { return m_xColumn->getLong(); }
+ virtual float getFloat() const { return m_xColumn->getFloat(); };
+ virtual double getDouble() const { return m_xColumn->getDouble(); };
+ virtual Date getDate() const { return m_xColumn->getDate(); };
+ virtual Time getTime() const { return m_xColumn->getTime(); };
+ virtual DateTime getTimestamp() const { return m_xColumn->getTimestamp(); };
+ virtual Sequence< sal_Int8 > getBytes() const { return m_xColumn->getBytes(); };
+ virtual Reference< XInputStream > getBinaryStream() const { return m_xColumn->getBinaryStream(); };
+ virtual Reference< XInputStream > getCharacterStream() const { return m_xColumn->getCharacterStream(); };
+ virtual sal_Bool wasNull() const { return m_xColumn->wasNull( ); };
+
+ private:
+ const Reference< XColumn > m_xColumn;
+ };
+}
+
+// -----------------------------------------------------------------------------
+void ORowSetValue::fill( const sal_Int32 _nType, const Reference< XColumn >& _rxColumn )
+{
+ detail::ColumnValue aColumnValue( _rxColumn );
+ impl_fill( _nType, sal_True, aColumnValue );
+}
+
+// -----------------------------------------------------------------------------
+void ORowSetValue::fill( sal_Int32 _nPos, sal_Int32 _nType, sal_Bool _bNullable, const Reference< XRow>& _xRow )
+{
+ detail::RowValue aRowValue( _xRow, _nPos );
+ impl_fill( _nType, _bNullable, aRowValue );
+}
+
// -----------------------------------------------------------------------------
void ORowSetValue::fill(sal_Int32 _nPos,
sal_Int32 _nType,
@@ -1819,10 +1923,8 @@ void ORowSetValue::fill(sal_Int32 _nPos,
}
// -----------------------------------------------------------------------------
-void ORowSetValue::fill(sal_Int32 _nPos,
- sal_Int32 _nType,
- sal_Bool _bNullable,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow>& _xRow)
+void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const detail::IValueSource& _rValueSource )
+
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::fill (2)" );
sal_Bool bReadData = sal_True;
@@ -1833,63 +1935,63 @@ void ORowSetValue::fill(sal_Int32 _nPos,
case DataType::DECIMAL:
case DataType::NUMERIC:
case DataType::LONGVARCHAR:
- (*this) = _xRow->getString(_nPos);
+ (*this) = _rValueSource.getString();
break;
case DataType::BIGINT:
if ( isSigned() )
- (*this) = _xRow->getLong(_nPos);
+ (*this) = _rValueSource.getLong();
else
- (*this) = _xRow->getString(_nPos);
+ (*this) = _rValueSource.getString();
break;
case DataType::FLOAT:
- (*this) = _xRow->getFloat(_nPos);
+ (*this) = _rValueSource.getFloat();
break;
case DataType::DOUBLE:
case DataType::REAL:
- (*this) = _xRow->getDouble(_nPos);
+ (*this) = _rValueSource.getDouble();
break;
case DataType::DATE:
- (*this) = _xRow->getDate(_nPos);
+ (*this) = _rValueSource.getDate();
break;
case DataType::TIME:
- (*this) = _xRow->getTime(_nPos);
+ (*this) = _rValueSource.getTime();
break;
case DataType::TIMESTAMP:
- (*this) = _xRow->getTimestamp(_nPos);
+ (*this) = _rValueSource.getTimestamp();
break;
case DataType::BINARY:
case DataType::VARBINARY:
case DataType::LONGVARBINARY:
- (*this) = _xRow->getBytes(_nPos);
+ (*this) = _rValueSource.getBytes();
break;
case DataType::BIT:
case DataType::BOOLEAN:
- (*this) = _xRow->getBoolean(_nPos);
+ (*this) = _rValueSource.getBoolean();
break;
case DataType::TINYINT:
if ( isSigned() )
- (*this) = _xRow->getByte(_nPos);
+ (*this) = _rValueSource.getByte();
else
- (*this) = _xRow->getShort(_nPos);
+ (*this) = _rValueSource.getShort();
break;
case DataType::SMALLINT:
if ( isSigned() )
- (*this) = _xRow->getShort(_nPos);
+ (*this) = _rValueSource.getShort();
else
- (*this) = _xRow->getInt(_nPos);
+ (*this) = _rValueSource.getInt();
break;
case DataType::INTEGER:
if ( isSigned() )
- (*this) = _xRow->getInt(_nPos);
+ (*this) = _rValueSource.getInt();
else
- (*this) = _xRow->getLong(_nPos);
+ (*this) = _rValueSource.getLong();
break;
case DataType::CLOB:
- (*this) = ::com::sun::star::uno::makeAny(_xRow->getCharacterStream(_nPos));
+ (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getCharacterStream());
setTypeKind(DataType::CLOB);
break;
case DataType::BLOB:
- (*this) = ::com::sun::star::uno::makeAny(_xRow->getBinaryStream(_nPos));
+ (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getBinaryStream());
setTypeKind(DataType::BLOB);
break;
default:
@@ -1897,7 +1999,7 @@ void ORowSetValue::fill(sal_Int32 _nPos,
bReadData = false;
break;
}
- if ( bReadData && _bNullable && _xRow->wasNull() )
+ if ( bReadData && _bNullable && _rValueSource.wasNull() )
setNull();
setTypeKind(_nType);
}
@@ -2043,3 +2145,5 @@ void ORowSetValue::fill(const Any& _rValue)
break;
}
}
+
+} // namespace connectivity
diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
index b3cbb4ae67c7..4c3f3db8b754 100644
--- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
+++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx
@@ -145,6 +145,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ
}
}
+ ::connectivity::ODatabaseMetaDataResultSet::ORows aTypeInfoRows;
while( xRet->next() )
{
::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
@@ -169,8 +170,9 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ
else
++aIter;
}
- m_aTypeInfoRows.push_back(aRow);
+ aTypeInfoRows.push_back(aRow);
}
+ m_aTypeInfoRows = aTypeInfoRows;
}
}
::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index 76519aa6a551..e1b49c878ba9 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -44,7 +44,7 @@
#include <com/sun/star/sdbc/DataType.hpp>
/** === end UNO includes === **/
-#include <svtools/syslocale.hxx>
+//#include <unotools/syslocale.hxx>
#include <tools/diagnose_ex.h>
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index 77467dda0bc3..cfcd8b83761b 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -46,7 +46,7 @@
#include <tools/urlobj.hxx>
#include "calc/CPreparedStatement.hxx"
#include "calc/CStatement.hxx"
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <connectivity/dbexception.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/logfile.hxx>
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 91f917224496..ba6d20ac70f5 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -50,7 +50,7 @@
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/text/XText.hpp>
-#include <svtools/converter.hxx>
+#include <svl/converter.hxx>
#include "calc/CConnection.hxx"
#include "calc/CColumns.hxx"
#include "connectivity/sdbcx/VColumn.hxx"
@@ -58,7 +58,7 @@
#include <osl/thread.h>
#include <tools/config.hxx>
#include <comphelper/sequence.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <comphelper/extract.hxx>
#include <connectivity/dbexception.hxx>
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
index 620bcd6a8eee..f4019564ed30 100644
--- a/connectivity/source/drivers/calc/makefile.mk
+++ b/connectivity/source/drivers/calc/makefile.mk
@@ -73,6 +73,7 @@ SHL1STDLIBS=\
$(VOSLIB) \
$(SVLLIB) \
$(TOOLSLIB) \
+ $(UNOTOOLSLIB) \
$(SALLIB) \
$(DBTOOLSLIB) \
$(DBFILELIB) \
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 1db81262e120..e93671441969 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
-#include <svtools/converter.hxx>
+#include <svl/converter.hxx>
#include "dbase/DConnection.hxx"
#include "dbase/DColumns.hxx"
#include <osl/thread.h>
@@ -44,8 +44,8 @@
#include "dbase/DIndexes.hxx"
//#include "file/FDriver.hxx"
#include <comphelper/sequence.hxx>
-#include <svtools/zforlist.hxx>
-#include <svtools/syslocale.hxx>
+#include <svl/zforlist.hxx>
+#include <unotools/syslocale.hxx>
#include <rtl/math.hxx>
#include <stdio.h> //sprintf
#include <ucbhelper/content.hxx>
diff --git a/connectivity/source/drivers/evoab/LFolderList.cxx b/connectivity/source/drivers/evoab/LFolderList.cxx
index a3c031c05c05..5f71303d7e28 100644
--- a/connectivity/source/drivers/evoab/LFolderList.cxx
+++ b/connectivity/source/drivers/evoab/LFolderList.cxx
@@ -36,13 +36,13 @@
#include "LFolderList.hxx"
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
-#include <svtools/converter.hxx>
+#include <svl/converter.hxx>
#include "LConnection.hxx"
#include "LColumns.hxx"
#include <osl/thread.h>
#include <tools/config.hxx>
#include <comphelper/sequence.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <stdio.h> //sprintf
#include <comphelper/extract.hxx>
@@ -59,7 +59,7 @@
#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
#include "LDebug.hxx"
#endif
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
using namespace ::comphelper;
using namespace connectivity;
diff --git a/connectivity/source/drivers/evoab/LTable.cxx b/connectivity/source/drivers/evoab/LTable.cxx
index cbb4bc53e9f4..3d72e1a3946f 100644
--- a/connectivity/source/drivers/evoab/LTable.cxx
+++ b/connectivity/source/drivers/evoab/LTable.cxx
@@ -39,13 +39,13 @@
#ifndef _COM_SUN_STAR_SQLC_XROW_HPP_
//#include <com/sun/star/sdbc/XRow.hpp>
#endif
-#include <svtools/converter.hxx>
+#include <svl/converter.hxx>
#include "LConnection.hxx"
#include "LColumns.hxx"
#include <osl/thread.h>
#include <tools/config.hxx>
#include <comphelper/sequence.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <stdio.h> //sprintf
#include <comphelper/extract.hxx>
@@ -56,7 +56,7 @@
#include <i18npool/mslangid.hxx>
#include "connectivity/dbconversion.hxx"
#include <comphelper/types.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
#include "LDebug.hxx"
#endif
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index d71908e0afd8..c8cda89b503c 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -54,7 +54,7 @@
#include <cppuhelper/typeprovider.hxx>
#include <rtl/string.hxx>
#include <tools/diagnose_ex.h>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <unotools/intlwrapper.hxx>
#include <cstring>
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
index e9bb9fdc4d70..6d7ca92fbdd6 100644
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ b/connectivity/source/drivers/evoab2/makefile.mk
@@ -77,9 +77,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(VOSLIB) \
$(SVLLIB) \
- $(VCLLIB) \
$(TOOLSLIB) \
- $(SVTOOLLIB) \
$(UNOTOOLSLIB) \
$(UCBHELPERLIB) \
$(SALLIB) \
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 52d14e6498cb..caa117037bcf 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -44,7 +44,7 @@
#include <com/sun/star/ucb/XContentIdentifier.hpp>
#include <tools/urlobj.hxx>
#include "file/FCatalog.hxx"
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <ucbhelper/content.hxx>
#include <connectivity/dbcharset.hxx>
#include <connectivity/dbexception.hxx>
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index 4b2865a67aa2..5f967758c125 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -34,8 +34,8 @@
#include <osl/diagnose.h>
#include "connectivity/sqlparse.hxx"
#include <i18npool/mslangid.hxx>
-#include <vcl/svapp.hxx>
#include <tools/debug.hxx>
+#include <tools/string.hxx>
#include "TConnection.hxx"
#include <com/sun/star/sdb/SQLFilterOperator.hpp>
#include <comphelper/types.hxx>
diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx
index abd2d3b51e44..765c42eeeae2 100644
--- a/connectivity/source/drivers/file/quotedstring.cxx
+++ b/connectivity/source/drivers/file/quotedstring.cxx
@@ -152,7 +152,6 @@ namespace connectivity
// Vorzeitiger Abbruch der Schleife moeglich, denn
// wir haben, was wir wollten.
nStartPos = i+1;
- *pData = 0;
break;
}
else
@@ -161,6 +160,7 @@ namespace connectivity
}
}
} // for( xub_StrLen i = nStartPos; i < nLen; ++i )
+ *pData = 0;
_rStr.ReleaseBufferAccess(xub_StrLen(pData - pStart));
}
}
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index fa4f281ea794..149925d06451 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -36,13 +36,13 @@
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <svtools/converter.hxx>
+#include <svl/converter.hxx>
#include "flat/EConnection.hxx"
#include "flat/EColumns.hxx"
#include <osl/thread.h>
#include <tools/config.hxx>
#include <comphelper/sequence.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/zforlist.hxx>
#include <rtl/math.hxx>
#include <stdio.h> //sprintf
#include <comphelper/extract.hxx>
@@ -54,7 +54,7 @@
#include "connectivity/dbconversion.hxx"
#include <comphelper/types.hxx>
#include "file/quotedstring.hxx"
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <rtl/logfile.hxx>
using namespace ::comphelper;
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index d044eab2796a..071c8c0cc976 100644
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -84,7 +84,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(VOSLIB) \
$(TOOLSLIB) \
- $(SVTOOLLIB) \
+ $(SVLLIB) \
$(UNOTOOLSLIB) \
$(SALLIB) \
$(DBTOOLSLIB) \
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 1e80a96cf682..7e97d27e1d86 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -55,6 +55,7 @@
#include <connectivity/dbexception.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <unotools/confignode.hxx>
+#include <unotools/ucbstreamhelper.hxx>
#include "resource/hsqldb_res.hrc"
#include "resource/sharedresources.hxx"
@@ -70,6 +71,8 @@ namespace connectivity
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::embed;
+ using namespace ::com::sun::star::io;
+ using namespace ::com::sun::star::task;
using namespace ::com::sun::star::reflection;
namespace hsqldb
@@ -260,6 +263,50 @@ namespace connectivity
);
aProperties.put( "SystemProperties", Sequence< NamedValue >( &aPermittedClasses, 1 ) );
+ const ::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM( "properties" ) );
+ ::rtl::OUString sMessage;
+ try
+ {
+ if ( !bIsNewDatabase && xStorage->isStreamElement(sProperties) )
+ {
+ Reference<XStream > xStream = xStorage->openStreamElement(sProperties,ElementModes::READ);
+ if ( xStream.is() )
+ {
+ ::std::auto_ptr<SvStream> pStream( ::utl::UcbStreamHelper::CreateStream(xStream) );
+ if ( pStream.get() )
+ {
+ ByteString sLine;
+ while ( pStream->ReadLine(sLine) )
+ {
+ if ( sLine.Equals("version=",0,sizeof("version=")-1) )
+ {
+ sLine = sLine.GetToken(1,'=');
+ const sal_Int32 nMajor = sLine.GetToken(0,'.').ToInt32();
+ const sal_Int32 nMinor = sLine.GetToken(1,'.').ToInt32();
+ const sal_Int32 nMicro = sLine.GetToken(2,'.').ToInt32();
+ if ( nMajor > 1
+ || ( nMajor == 1 && nMinor > 8 )
+ || ( nMajor == 1 && nMinor == 8 && nMicro > 0 ) )
+ {
+ ::connectivity::SharedResources aResources;
+ sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION);
+ }
+ break;
+ }
+ }
+ }
+ } // if ( xStream.is() )
+ ::comphelper::disposeComponent(xStream);
+ }
+ }
+ catch(Exception&)
+ {
+ }
+ if ( sMessage.getLength() )
+ {
+ ::dbtools::throwGenericSQLException(sMessage ,*this);
+ }
+
// readonly?
Reference<XPropertySet> xProp(xStorage,UNO_QUERY);
if ( xProp.is() )
diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk
index 9ed5acb17d4c..c61e4b297ba4 100644
--- a/connectivity/source/drivers/hsqldb/makefile.mk
+++ b/connectivity/source/drivers/hsqldb/makefile.mk
@@ -102,6 +102,7 @@ SHL1STDLIBS=\
$(DBTOOLSLIB) \
$(JVMFWKLIB) \
$(COMPHELPERLIB) \
+ $(TOOLSLIB) \
$(UNOTOOLSLIB)
diff --git a/connectivity/source/drivers/kab/KConnection.cxx b/connectivity/source/drivers/kab/KConnection.cxx
index 1df3315f559d..356d43822be4 100644
--- a/connectivity/source/drivers/kab/KConnection.cxx
+++ b/connectivity/source/drivers/kab/KConnection.cxx
@@ -39,7 +39,7 @@
#include "KCatalog.hxx"
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
using namespace connectivity::kab;
using namespace com::sun::star::uno;
diff --git a/connectivity/source/drivers/kab/KDEInit.cxx b/connectivity/source/drivers/kab/KDEInit.cxx
index 3e7c69166b1b..2736cb5c6fbc 100644
--- a/connectivity/source/drivers/kab/KDEInit.cxx
+++ b/connectivity/source/drivers/kab/KDEInit.cxx
@@ -33,7 +33,7 @@
#include "KDEInit.h"
#include <osl/diagnose.h>
#include <osl/process.h>
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
namespace connectivity
{
diff --git a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
index c210b52ec4bc..127c70cb4207 100644
--- a/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/kab/KDatabaseMetaData.cxx
@@ -34,7 +34,7 @@
#include "KDatabaseMetaData.hxx"
#include "kfields.hxx"
#include "KDEInit.h"
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
#include "FDatabaseMetaDataResultSet.hxx"
#include "OTypeInfo.hxx"
#include <com/sun/star/sdbc/ColumnValue.hpp>
diff --git a/connectivity/source/drivers/kab/KResultSet.hxx b/connectivity/source/drivers/kab/KResultSet.hxx
index 72b1e618be28..51321b106042 100644
--- a/connectivity/source/drivers/kab/KResultSet.hxx
+++ b/connectivity/source/drivers/kab/KResultSet.hxx
@@ -33,7 +33,7 @@
#include "KStatement.hxx"
#include "KResultSetMetaData.hxx"
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
#include <com/sun/star/sdbc/XColumnLocate.hpp>
diff --git a/connectivity/source/drivers/kab/kcondition.hxx b/connectivity/source/drivers/kab/kcondition.hxx
index bb219fcf443b..0621eef7fb8b 100644
--- a/connectivity/source/drivers/kab/kcondition.hxx
+++ b/connectivity/source/drivers/kab/kcondition.hxx
@@ -34,7 +34,7 @@
#ifndef _COMPHELPER_TYPES_H_
#include <comphelper/types.hxx>
#endif
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
#include <connectivity/dbexception.hxx>
namespace connectivity
diff --git a/connectivity/source/drivers/kab/kfields.hxx b/connectivity/source/drivers/kab/kfields.hxx
index d6f8622398b4..e73660ad7858 100644
--- a/connectivity/source/drivers/kab/kfields.hxx
+++ b/connectivity/source/drivers/kab/kfields.hxx
@@ -31,7 +31,7 @@
#ifndef _CONNECTIVITY_KAB_FIELDS_HXX_
#define _CONNECTIVITY_KAB_FIELDS_HXX_
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
#include <connectivity/dbexception.hxx>
#include <rtl/ustring.hxx>
diff --git a/connectivity/source/drivers/kab/korder.hxx b/connectivity/source/drivers/kab/korder.hxx
index 41a280050c06..dd93066074bf 100644
--- a/connectivity/source/drivers/kab/korder.hxx
+++ b/connectivity/source/drivers/kab/korder.hxx
@@ -32,7 +32,7 @@
#define _CONNECTIVITY_KAB_ORDER_HXX_
#include "rtl/ustring.hxx"
-#include <vcl/kde_headers.h>
+#include <shell/kde_headers.h>
#include <vector>
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 9b4b05868cd2..00f76ddeb8fd 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -30,37 +30,35 @@
#*************************************************************************
CALL_CDECL=TRUE
-#mozilla specific stuff.
-MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
-MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
-#End of mozilla specific stuff.
-
PRJ=..$/..$/..$/..
PRJINC=..$/..$/..
PRJNAME=connectivity
TARGET=mozbootstrap
-USE_DEFFILE=TRUE
-ENABLE_EXCEPTIONS=TRUE
-VISIBILITY_HIDDEN=TRUE
-
.IF "$(OS)" == "OS2"
all:
@echo " Not building under OS/2"
.ENDIF
# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
+USE_DEFFILE=TRUE
+ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
+
+# --- begin of mozilla specific stuff
+MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
+MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
+# --- end of mozilla specific stuff
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : ../makefile_mozab.mk
+
+INCPRE += -I../mozillasrc
-#mozilla specific stuff.
# --- Files -------------------------------------
SLOFILES += \
@@ -93,95 +91,6 @@ SLOFILES += \
$(SLO)$/MNSProfileDirServiceProvider.obj
.ENDIF
-CDEFS += -DMOZILLA_INTERNAL_API
-
-.IF "$(GUI)"=="UNX"
-.IF "$(COMNAME)"=="sunpro5"
-CFLAGS += -features=tmplife
-#This flag is needed to build mozilla 1.7 code
-.ENDIF # "$(COMNAME)"=="sunpro5"
-.ENDIF
-
-MOZINC = . -I.. -I..$/mozillasrc -I$(MOZ_INC) -I$(MOZ_INC)$/nspr -I$(MOZ_INC)$/xpcom \
- -I$(MOZ_INC)$/string -I$(MOZ_INC)$/rdf -I$(MOZ_INC)$/msgbase \
- -I$(MOZ_INC)$/addrbook -I$(MOZ_INC)$/mork -I$(MOZ_INC)$/locale \
- -I$(MOZ_INC)$/pref -I$(MOZ_INC)$/mime -I$(MOZ_INC)$/chrome \
- -I$(MOZ_INC)$/necko -I$(MOZ_INC)$/intl -I$(MOZ_INC)$/profile \
- -I$(MOZ_INC)$/embed_base -I$(MOZ_INC)$/mozldap -I$(MOZ_INC)$/uconv\
- -I$(MOZ_INC)$/xpcom_obsolete -I$(MOZ_INC)$/content
-
-.IF "$(GUI)" == "WNT"
-.IF "$(COM)" == "GCC"
-INCPOST += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL
-CFLAGSCXX += \
- -fno-rtti -Wall -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long
-.ELSE
-.IF "$(DBG_LEVEL)" == "0"
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -GR- -W3 -Gy -MD -UDEBUG
-.ELSE
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DDEVELOPER_DEBUG -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DDEBUG_Administrator -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -Zi -GR- -W3 -Gy -MDd -UDEBUG
-.IF "$(CCNUMVER)" >= "001399999999"
-CDEFS += -D_STL_NOFORCE_MANIFEST
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-.IF "$(GUI)" == "UNX"
-INCPOST += $(MOZINC)
-CDEFS+= -DMOZILLA_CLIENT \
- -DXP_UNIX
-.IF "$(OS)" == "LINUX"
-CFLAGS += -fPIC -g
-CDEFS+= -DOJI
-
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -pthread
-CDEFS += -DTRACING
-.ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
-CFLAGS += -fPIC
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -Wno-deprecated
-CDEFS += -DTRACING
-.ENDIF
-
-SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
-
-.ENDIF # MACOSX
-
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index 677e605096c4..76161dc32119 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -43,38 +43,28 @@ all:
@echo " see http://www.mozilla.org/issues/show_bug.cgi?id=91209"
.ENDIF
-#mozilla specific stuff.
+# --- begin of mozilla specific stuff
MOZ_LIB=$(SOLARVERSION)$/$(INPATH)$/lib$(UPDMINOREXT)
MOZ_INC=$(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla
.IF "$(OS)"=="WNT"
-.IF "$(USE_SHELL)"=="4nt"
-MOZ_EMBED_LIB := $(shell @+-dir /ba:f $(MOZ_LIB)$/embed_base_s.lib 2>NUL )
-MOZ_REG_LIB := $(shell @+-dir /ba:f $(MOZ_LIB)$/mozreg_s.lib 2>NUL )
-.ELSE #"$(USE_SHELL)"=="4nt"
-MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib )
-MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib )
-.ENDIF
+ MOZ_EMBED_LIB := $(shell @-test -f $(MOZ_LIB)$/embed_base_s.lib && echo $(MOZ_LIB)$/embed_base_s.lib )
+ MOZ_REG_LIB := $(shell @-test -f $(MOZ_LIB)$/mozreg_s.lib && echo $(MOZ_LIB)$/mozreg_s.lib )
-.IF X"$(MOZ_EMBED_LIB)"=="X"
-MOZ_EMBED_LIB := $(MOZ_LIB)$/baseembed_s.lib
-.ENDIF
-.IF X"$(MOZ_REG_LIB)" == "X"
-MOZ_REG_LIB := $(MOZ_LIB)$/mozreg.lib
-.ENDIF
-.ENDIF
+ MOZ_EMBED_LIB *:= $(MOZ_LIB)$/baseembed_s.lib
+ MOZ_REG_LIB *:= $(MOZ_LIB)$/mozreg.lib
+
+ .IF "$(COM)"=="GCC"
+ MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
+ .ELSE
+ LIB += $(MOZ_LIB)
+ MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
+ .ENDIF
-.IF "$(OS)"=="WNT"
-.IF "$(COM)"=="GCC"
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
-.ELSE
-LIB += $(MOZ_LIB)
-MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
-.ENDIF
.ELSE "$(OS)"=="WNT"
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
+ MOZ_LIB_XPCOM = -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
.ENDIF
-#End of mozilla specific stuff.
+# --- end of mozilla specific stuff
USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
@@ -87,10 +77,6 @@ COMPONENT_CONFIG_SCHEMA=$(TARGET)2.xcs
# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
.INCLUDE : $(PRJ)$/makefile.pmk
.INCLUDE : $(PRJ)$/version.mk
@@ -121,7 +107,6 @@ DEF1NAME= $(SHL1TARGET)
DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
$(SLB)$/$(TARGET).lib
DEFLIB1NAME=$(TARGET)
-#DEF1EXPORTFILE= exports.dxp
# --- Files -------------------------------------
@@ -165,6 +150,7 @@ DEPOBJFILES=$(SLO2FILES)
# --- MOZAB BASE Library -----------------------------------
SHL2VERSIONMAP= $(TARGET2).map
+SHL2NOCHECK=TRUE
SHL2TARGET= $(TARGET2)$(DLLPOSTFIX)
SHL2OBJS=$(SLO2FILES)
SHL2STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/makefile_mozab.mk b/connectivity/source/drivers/mozab/makefile_mozab.mk
new file mode 100644
index 000000000000..28b56ec2a84a
--- /dev/null
+++ b/connectivity/source/drivers/mozab/makefile_mozab.mk
@@ -0,0 +1,128 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+CDEFS += -DMOZILLA_INTERNAL_API
+
+.IF "$(GUI)"=="UNX"
+ .IF "$(COMNAME)"=="sunpro5"
+ CFLAGS += -features=tmplife
+ #This flag is needed to build mozilla 1.7 code
+ .ENDIF # "$(COMNAME)"=="sunpro5"
+.ENDIF
+
+MOZINC = . \
+ -I.. \
+ -I$(MOZ_INC) \
+ -I$(MOZ_INC)$/nspr \
+ -I$(MOZ_INC)$/xpcom \
+ -I$(MOZ_INC)$/string \
+ -I$(MOZ_INC)$/rdf \
+ -I$(MOZ_INC)$/msgbase \
+ -I$(MOZ_INC)$/addrbook \
+ -I$(MOZ_INC)$/mork \
+ -I$(MOZ_INC)$/locale \
+ -I$(MOZ_INC)$/pref \
+ -I$(MOZ_INC)$/mime \
+ -I$(MOZ_INC)$/chrome \
+ -I$(MOZ_INC)$/necko \
+ -I$(MOZ_INC)$/intl \
+ -I$(MOZ_INC)$/profile \
+ -I$(MOZ_INC)$/embed_base \
+ -I$(MOZ_INC)$/mozldap \
+ -I$(MOZ_INC)$/uconv \
+ -I$(MOZ_INC)$/xpcom_obsolete \
+ -I$(MOZ_INC)$/content
+
+.IF "$(GUI)" == "WNT"
+ CDEFS += \
+ -DMOZILLA_CLIENT \
+ -DXP_PC \
+ -DXP_WIN \
+ -DXP_WIN32 \
+ -DOJI \
+ -DWIN32 \
+ -D_X86_ \
+ -D_WINDOWS \
+ -DMOZ_XUL \
+ -DMOZ_REFLOW_PERF \
+ -DMOZ_REFLOW_PERF_DSP
+ .IF "$(COM)" == "GCC"
+ INCPOST += $(MOZINC)
+ CFLAGSCXX += \
+ -fno-rtti \
+ -Wall \
+ -Wconversion \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Woverloaded-virtual \
+ -Wsynth \
+ -Wno-long-long
+ .ELSE # .IF "$(COM)" == "GCC"
+ INCPRE += $(MOZINC)
+ .IF "$(DBG_LEVEL)" != "0"
+ .IF "$(CCNUMVER)" >= "001399999999"
+ CDEFS += -D_STL_NOFORCE_MANIFEST
+ .ENDIF # .IF "$(CCNUMVER)" >= "001399999999"
+ .ENDIF # .IF "$(DBG_LEVEL)" != "0"
+ .ENDIF # .IF "$(COM)" == "GCC"
+.ENDIF # .IF "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "UNX"
+ INCPOST += $(MOZINC)
+ CDEFS+= -DMOZILLA_CLIENT \
+ -DXP_UNIX
+ .IF "$(OS)" == "LINUX"
+ CFLAGS += -fPIC -g
+ CDEFS += -DOJI
+ CFLAGSCXX += \
+ -fno-rtti \
+ -Wconversion \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Woverloaded-virtual \
+ -Wsynth \
+ -Wno-long-long \
+ -pthread
+ CDEFS += -DTRACING
+ .ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
+ CFLAGS += -fPIC
+ CFLAGSCXX += \
+ -fno-rtti \
+ -Wconversion \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Woverloaded-virtual \
+ -Wsynth \
+ -Wno-long-long \
+ -Wno-deprecated
+ CDEFS += -DTRACING
+ .ENDIF # "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
+
+ SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
+
+.ENDIF # "$(GUI)" == "UNX"
+
diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
index e31d4c7e412b..1e5b39e0f140 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
+++ b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk
@@ -40,16 +40,12 @@ PRJINC=..$/..$/..
PRJNAME=connectivity
TARGET=mozabsrc
+# --- Settings ----------------------------------
+
USE_DEFFILE=TRUE
ENABLE_EXCEPTIONS=TRUE
VISIBILITY_HIDDEN=TRUE
-# --- Settings ----------------------------------
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-
.INCLUDE : settings.mk
.IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || "$(OS)" == "OS2"
@@ -61,8 +57,10 @@ dummy:
.INCLUDE : $(PRJ)$/version.mk
+.INCLUDE : ../makefile_mozab.mk
+
+INCPRE += -I../bootstrap
-#mozilla specific stuff.
# --- Files -------------------------------------
SLOFILES = \
@@ -74,98 +72,9 @@ SLOFILES = \
$(SLO)$/MNSMozabProxy.obj \
$(SLO)$/MNSTerminateListener.obj \
$(SLO)$/MLdapAttributeMap.obj \
-
-
-CDEFS += -DMOZILLA_INTERNAL_API
-.IF "$(GUI)"=="UNX"
-.IF "$(COMNAME)"=="sunpro5"
-CFLAGS += -features=tmplife
-#This flag is needed to build mozilla 1.7 code
-.ENDIF # "$(COMNAME)"=="sunpro5"
.ENDIF
-MOZINC = . -I.. -I..$/bootstrap -I$(MOZ_INC) -I$(MOZ_INC)$/nspr -I$(MOZ_INC)$/xpcom \
- -I$(MOZ_INC)$/string -I$(MOZ_INC)$/rdf -I$(MOZ_INC)$/msgbase \
- -I$(MOZ_INC)$/addrbook -I$(MOZ_INC)$/mork -I$(MOZ_INC)$/locale \
- -I$(MOZ_INC)$/pref -I$(MOZ_INC)$/mime -I$(MOZ_INC)$/chrome \
- -I$(MOZ_INC)$/necko -I$(MOZ_INC)$/intl -I$(MOZ_INC)$/profile \
- -I$(MOZ_INC)$/embed_base -I$(MOZ_INC)$/mozldap -I$(MOZ_INC)$/uconv\
- -I$(MOZ_INC)$/xpcom_obsolete -I$(MOZ_INC)$/content
-
-.IF "$(GUI)" == "WNT"
-.IF "$(COM)"=="GCC"
-INCPOST += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL
-CFLAGSCXX += \
- -fno-rtti -Wall -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long
-.ELSE
-.IF "$(DBG_LEVEL)" == "0"
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -GR- -W3 -Gy -MD -UDEBUG
-.ELSE
-INCPRE += $(MOZINC)
-CDEFS += -DWINVER=0x400 -DMOZILLA_CLIENT \
- -DNS_NET_FILE -DCookieManagement -DSingleSignon -DClientWallet \
- -DTRACING -DXP_PC -DXP_WIN -DXP_WIN32 -DHW_THREADS \
- -DDMSVC4 -DDEVELOPER_DEBUG -DNS_MT_SUPPORTED -DNETLIB_THREAD \
- -DOJI -DWIN32 -D_X86_ -D_WINDOWS \
- -DMOZ_XUL -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP \
- -DDEBUG_Administrator -DNSPR20 -DOS_HAS_DLL -DNO_JNI_STUBS \
- -DNETSCAPE -DMOZILLA_CLIENT -DJS_THREADSAFE -DNECKO -DINCLUDE_XUL \
- -UDEBUG
-CFLAGS += -Zi -GR- -W3 -Gy -MDd -UDEBUG
-.IF "$(CCNUMVER)" >= "001399999999"
-CDEFS += -D_STL_NOFORCE_MANIFEST
-.ENDIF
-.ENDIF
-.ENDIF
-.ENDIF
-.IF "$(GUI)" == "UNX"
-INCPOST += $(MOZINC)
-CDEFS+= -DMOZILLA_CLIENT \
- -DXP_UNIX
-.IF "$(OS)" == "LINUX"
-CFLAGS += -fPIC -g
-CDEFS+= -DOJI
-
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -pthread
-CDEFS += -DTRACING
-.ELIF "$(OS)" == "NETBSD" || "$(OS)" == "MACOSX"
-CFLAGS += -fPIC
-CFLAGSCXX += \
- -fno-rtti -Wconversion -Wpointer-arith \
- -Wcast-align -Woverloaded-virtual -Wsynth \
- -Wno-long-long -Wno-deprecated
-CDEFS += -DTRACING
-.ENDIF
-.ENDIF
-
-SHL1TARGET_NAME=$(TARGET)$(MOZAB_MAJOR)
-
-.ENDIF # MACOSX
-
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/source/inc/resource/hsqldb_res.hrc b/connectivity/source/inc/resource/hsqldb_res.hrc
index 3b7b9ef15c0a..b9066488d425 100644
--- a/connectivity/source/inc/resource/hsqldb_res.hrc
+++ b/connectivity/source/inc/resource/hsqldb_res.hrc
@@ -44,6 +44,7 @@
#define STR_NO_TABLE_EDITOR_DIALOG ( STR_HSQLDB_BASE + 3 )
#define STR_NO_TABLENAME ( STR_HSQLDB_BASE + 4 )
#define STR_NO_DOCUMENTUI ( STR_HSQLDB_BASE + 5 )
+#define STR_ERROR_NEW_VERSION ( STR_HSQLDB_BASE + 6 )
#endif // CONNECTIVITY_RESOURCE_HSQLDB_HRC
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index a1fd44014314..8d869c2dea0a 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2074,18 +2074,18 @@ void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition)
if ( SQL_ISRULE(p2ndSearch,boolean_primary) )
p2ndSearch = p2ndSearch->getChild(1);
- if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) )
+ if ( *p2ndSearch->getChild(0) == *pSearchCondition->getChild(2-nPos) ) // a and ( a or b) -> a or b
{
pNewNode = pSearchCondition->removeAt((sal_uInt32)0);
replaceAndReset(pSearchCondition,pNewNode);
}
- else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) )
+ else if ( *p2ndSearch->getChild(2) == *pSearchCondition->getChild(2-nPos) ) // a and ( b or a) -> a or b
{
pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
replaceAndReset(pSearchCondition,pNewNode);
}
- else if ( p2ndSearch->getByRule(OSQLParseNode::boolean_term) )
+ else if ( p2ndSearch->getByRule(OSQLParseNode::search_condition) )
{
// a and ( b or c ) -> ( a and b ) or ( a and c )
// ( b or c ) and a -> ( a and b ) or ( a and c )
@@ -2096,7 +2096,13 @@ void OSQLParseNode::absorptions(OSQLParseNode*& pSearchCondition)
OSQLParseNode* p1stAnd = MakeANDNode(pA,pB);
OSQLParseNode* p2ndAnd = MakeANDNode(new OSQLParseNode(*pA),pC);
pNewNode = MakeORNode(p1stAnd,p2ndAnd);
- replaceAndReset(pSearchCondition,pNewNode);
+ OSQLParseNode* pNode = new OSQLParseNode(::rtl::OUString(),SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::boolean_primary));
+ pNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii("("),SQL_NODE_PUNCTUATION));
+ pNode->append(pNewNode);
+ pNode->append(new OSQLParseNode(::rtl::OUString::createFromAscii(")"),SQL_NODE_PUNCTUATION));
+ OSQLParseNode::eraseBraces(p1stAnd);
+ OSQLParseNode::eraseBraces(p2ndAnd);
+ replaceAndReset(pSearchCondition,pNode);
}
}
// a or a and b || a or b and a
diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src
index d143dad1ba0f..48ab06f0f635 100644
--- a/connectivity/source/resource/conn_shared_res.src
+++ b/connectivity/source/resource/conn_shared_res.src
@@ -645,3 +645,8 @@ String STR_NO_DOCUMENTUI
{
Text [ en-US ] = "The provided DocumentUI is not allowed to be NULL.";
};
+String STR_ERROR_NEW_VERSION
+{
+ Text = "The connection could not be established. The database was created by a newer version of %PRODUCTNAME.";
+};
+
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 995c7e65e999..353a3e045719 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -186,6 +186,7 @@ class Desktop : public Application
static sal_Bool _bTasksSaved;
static void retrieveCrashReporterState();
+ static sal_Bool isUIOnSessionShutdownAllowed();
// on-demand acceptors
static void createAcceptor(const OUString& aDescription);
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index ce2ed07f57e4..d9213aed12d6 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : l10n sfx2 stoc uui BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg NULL
+dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
@@ -21,7 +21,7 @@ dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL
dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL
dt desktop\source\pagein nmake - u dt_pagein dt_inc NULL
dt desktop\source\pkgchk\unopkg nmake - all dt_unopkg dt_dp_misc dt_app dt_inc dt_guiloader.w NULL
-dt desktop\source\deployment nmake - all dt_deployment dt_dp_manager dt_dp_registry dt_dp_registry_package dt_dp_registry_executable dt_dp_registry_help dt_dp_registry_script dt_dp_registry_sfwk dt_dp_registry_component dt_dp_registry_configuration dt_dp_migration dt_dp_unopkg dt_inc NULL
+dt desktop\source\deployment nmake - all dt_deployment dt_dp_manager dt_dp_registry dt_dp_registry_package dt_dp_registry_executable dt_dp_registry_help dt_dp_registry_script dt_dp_registry_sfwk dt_dp_registry_component dt_dp_registry_configuration dt_dp_migration dt_dp_unopkg dt_inc dt_dp_misc NULL
dt desktop\source\deployment\misc nmake - all dt_dp_misc dt_inc NULL
dt desktop\source\deployment\unopkg nmake - all dt_dp_unopkg dt_inc NULL
dt desktop\source\deployment\migration nmake - all dt_dp_migration dt_inc NULL
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index fe688e2c4b44..5ec84bca7d37 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -93,7 +93,7 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res
-..\%__SRC%\misc\soffice.sh %_DEST%\bin%_EXT%\soffice
+..\%__SRC%\misc\soffice.sh-expanded %_DEST%\bin%_EXT%\soffice
..\%__SRC%\misc\sbase.sh %_DEST%\bin%_EXT%\sbase
..\%__SRC%\misc\scalc.sh %_DEST%\bin%_EXT%\scalc
..\%__SRC%\misc\sdraw.sh %_DEST%\bin%_EXT%\sdraw
diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk
index 39e80ddb1c76..f673f27e49cb 100644
--- a/desktop/qa/deployment_misc/makefile.mk
+++ b/desktop/qa/deployment_misc/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ DLLPRE = # no leading "lib" on .so files
SHL1TARGET = $(TARGET)
SHL1OBJS = $(SLO)$/test_dp_version.obj
-SHL1STDLIBS = $(CPPUNITLIB) $(DEPLOYMENTMISCLIB) $(SALLIB)
+SHL1STDLIBS = $(CPPUNITLIB) $(DEPLOYMENTMISCLIB) $(SALLIB) $(TESTSHL2LIB)
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
@@ -54,4 +54,4 @@ SLOFILES = $(SHL1OBJS)
ALLTAR: test
test .PHONY: $(SHL1TARGETN)
- testshl2 $(SHL1TARGETN)
+ $(TESTSHL2) $(SHL1TARGETN)
diff --git a/desktop/qa/deployment_misc/test_dp_version.cxx b/desktop/qa/deployment_misc/test_dp_version.cxx
index b1de394e0cd6..728ed52c37b1 100644
--- a/desktop/qa/deployment_misc/test_dp_version.cxx
+++ b/desktop/qa/deployment_misc/test_dp_version.cxx
@@ -35,7 +35,7 @@
#include <cstddef>
-#include "cppunit/simpleheader.hxx"
+#include "testshl/simpleheader.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
diff --git a/desktop/scripts/makefile.mk b/desktop/scripts/makefile.mk
index 52750ca0b44f..001ead351928 100644
--- a/desktop/scripts/makefile.mk
+++ b/desktop/scripts/makefile.mk
@@ -54,7 +54,18 @@ UNIXTEXT= \
$(MISC)$/unopkg.sh
.IF "$(OS)" != "MACOSX"
+
+ALLTAR: $(MISC)$/soffice.sh-expanded
+
+$(MISC)/soffice.sh-expanded: $(MISC)/soffice.sh
+.IF "$(OS)" == "LINUX" && "$(CPUNAME)" == "POWERPC"
+ $(SED) 's/^#@# //' $< > $@
+.ELSE
+ $(COPY) $< $@
+.ENDIF
+
UNIXTEXT+= $(MISC)$/soffice.sh
+
.ENDIF
.INCLUDE : target.mk
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 7895d3ed1cd9..0690e9647f35 100644
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -43,11 +43,8 @@ export SAL_ENABLE_FILE_LOCKING
# working on your system.
# SAL_NOOPENGL=true; export SAL_NOOPENGL
-# the following test is needed on Linux PPC with IBM j2sdk142
-if [ "`uname -s`" = "Linux" -a "`uname -m`" = "ppc" ] ; then
- JITC_PROCESSOR_TYPE=6
- export JITC_PROCESSOR_TYPE
-fi
+# The following is needed on Linux PPC with IBM j2sdk142:
+#@# export JITC_PROCESSOR_TYPE=6
# resolve installation directory
sd_cwd="`pwd`"
@@ -129,11 +126,13 @@ export PATH
"$sd_prog/$sd_binary" "$@" &
trap 'kill -9 $!' TERM
wait $!
+sd_ret=$?
-while [ $? -eq 79 ]
+while [ $sd_ret -eq 79 ]
do
"$sd_prog/$sd_binary" ""$BOOTSTRAPVARS"" &
wait $!
+ sd_ret=$?
done
-exit
+exit $sd_ret
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index d4e0a91c1d17..14422298b2aa 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -114,18 +114,19 @@
#include <unotools/ucbhelper.hxx>
#include <tools/tempfile.hxx>
#include <tools/urlobj.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <osl/module.h>
#include <osl/file.hxx>
#include <osl/signal.h>
#include <rtl/uuid.h>
-#include <svtools/pathoptions.hxx>
-#include <svtools/languageoptions.hxx>
-#include <svtools/internaloptions.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svl/languageoptions.hxx>
+#include <unotools/internaloptions.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/menuoptions.hxx>
-#include <svtools/syslocaleoptions.hxx>
-#include <svtools/folderrestriction.hxx>
+#include <unotools/syslocaleoptions.hxx>
+#include <unotools/syslocale.hxx>
+#include <svl/folderrestriction.hxx>
#include <unotools/tempfile.hxx>
#include <rtl/logfile.hxx>
#include <rtl/ustrbuf.hxx>
@@ -147,9 +148,9 @@
#include <svtools/fontsubstconfig.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <svtools/apearcfg.hxx>
-#include <svtools/misccfg.hxx>
+#include <unotools/misccfg.hxx>
#include <svtools/filter.hxx>
-#include <svtools/regoptions.hxx>
+#include <unotools/regoptions.hxx>
#include "langselect.hxx"
@@ -937,6 +938,29 @@ void Desktop::retrieveCrashReporterState()
_bCrashReporterEnabled = bEnabled;
}
+sal_Bool Desktop::isUIOnSessionShutdownAllowed()
+{
+ static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
+ static const ::rtl::OUString CFG_PATH_SESSION = ::rtl::OUString::createFromAscii("SessionShutdown" );
+ static const ::rtl::OUString CFG_ENTRY_UIENABLED = ::rtl::OUString::createFromAscii("DocumentStoreUIEnabled" );
+
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
+
+ sal_Bool bResult = sal_False;
+ if ( xSMGR.is() )
+ {
+ css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
+ xSMGR,
+ CFG_PACKAGE_RECOVERY,
+ CFG_PATH_SESSION,
+ CFG_ENTRY_UIENABLED,
+ ::comphelper::ConfigurationHelper::E_READONLY);
+ aVal >>= bResult;
+ }
+
+ return bResult;
+}
+
//-----------------------------------------------
/** @short check if crash reporter feature is enabled or
disabled.
@@ -1323,13 +1347,15 @@ void Desktop::Main()
}
String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
delete pLabelResMgr;
-
+/*
+ // locale and UI locale in AppSettings are now retrieved from configuration or system directly via SvtSysLocale
+ // no reason to set while starting
// set UI language and locale
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ set locale settings" );
//LanguageSelection langselect;
OUString aUILocaleString = LanguageSelection::getLanguageString();
Locale aUILocale = LanguageSelection::IsoStringToLocale(aUILocaleString);
- LanguageType eLanguage = SvtSysLocaleOptions().GetLocaleLanguageType();
+ LanguageType eLanguage = SvtSysLocale().GetLanguage();
// #i39040#, do not call anything between GetSettings and SetSettings that might have
// a side effect on the settings (like, eg, SvtSysLocaleOptions().GetLocaleLanguageType(),
@@ -1339,7 +1365,7 @@ void Desktop::Main()
aSettings.SetLanguage( eLanguage );
Application::SetSettings( aSettings );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} set locale settings" );
-
+*/
// Check for StarOffice/Suite specific extensions runs also with OpenOffice installation sets
OUString aTitleString( aTitle );
@@ -1349,7 +1375,7 @@ void Desktop::Main()
else
aTitle = aTitleString;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
//include version ID in non product builds
::rtl::OUString aDefault;
aTitle += DEFINE_CONST_UNICODE(" [");
@@ -1400,7 +1426,7 @@ void Desktop::Main()
if (IsFirstStartWizardNeeded())
{
- ::svt::RegOptions().removeReminder(); // remove patch registration reminder
+ ::utl::RegOptions().removeReminder(); // remove patch registration reminder
Reference< XJob > xFirstStartJob( xSMgr->createInstance(
DEFINE_CONST_UNICODE( "com.sun.star.comp.desktop.FirstStart" ) ), UNO_QUERY );
if (xFirstStartJob.is())
@@ -1468,6 +1494,13 @@ void Desktop::Main()
xContainerWindow = xBackingFrame->getContainerWindow();
if (xContainerWindow.is())
{
+ // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
+ // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+ // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
+
SetSplashScreenProgress(75);
Sequence< Any > lArgs(1);
lArgs[0] <<= xContainerWindow;
@@ -1738,8 +1771,15 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
aSeq[0] <<= bQuickstart;
// Try to instanciate quickstart service. This service is not mandatory, so
- // do nothing if service is not available.
+ // do nothing if service is not available
+
+ // #i105753# the following if was invented for performance
+ // unfortunately this broke the QUARTZ behavior which is to always run
+ // in quickstart mode since Mac applications do not usually quit
+ // when the last document closes
+ #ifndef QUARTZ
if ( bQuickstart )
+ #endif
{
Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
@@ -1820,10 +1860,6 @@ void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* )
hStyleSettings.SetDragFullOptions( nDragFullOptions );
rSettings.SetStyleSettings ( hStyleSettings );
-
- MiscSettings aMiscSettings( rSettings.GetMiscSettings() );
- aMiscSettings.SetTwoDigitYearStart( (USHORT) SfxMiscCfg().GetYear2000() );
- rSettings.SetMiscSettings( aMiscSettings );
}
// ========================================================================
@@ -2444,7 +2480,15 @@ void Desktop::OpenClients()
{
xSessionListener = Reference< XInitialization >(::comphelper::getProcessServiceFactory()->createInstance(
OUString::createFromAscii("com.sun.star.frame.SessionListener")), UNO_QUERY_THROW);
- xSessionListener->initialize(Sequence< Any >(0));
+
+ // specifies whether the UI-interaction on Session shutdown is allowed
+ sal_Bool bAllowUI = isUIOnSessionShutdownAllowed();
+ css::beans::NamedValue aProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowUserInteractionOnQuit" ) ),
+ css::uno::makeAny( bAllowUI ) );
+ css::uno::Sequence< css::uno::Any > aArgs( 1 );
+ aArgs[0] <<= aProperty;
+
+ xSessionListener->initialize( aArgs );
}
catch(const com::sun::star::uno::Exception& e)
{
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index e87701b4addf..b81923a48d9c 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -75,9 +75,9 @@
#include <unotools/tempfile.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <vcl/svapp.hxx>
-#include <svtools/startoptions.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/internaloptions.hxx>
+#include <unotools/startoptions.hxx>
+#include <unotools/pathoptions.hxx>
+#include <unotools/internaloptions.hxx>
#define DEFINE_CONST_OUSTRING(CONSTASCII) OUString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 0f1b62d707f2..5220d60bc02c 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -41,7 +41,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include "tools/getprocessworkingdir.hxx"
-#include <svtools/documentlockfile.hxx>
+#include <svl/documentlockfile.hxx>
using namespace rtl;
using namespace com::sun::star::lang;
diff --git a/desktop/source/app/copyright_ascii_ooo.c b/desktop/source/app/copyright_ascii_ooo.c
index 6c49ba9d9f86..7b58f1a60f7e 100644
--- a/desktop/source/app/copyright_ascii_ooo.c
+++ b/desktop/source/app/copyright_ascii_ooo.c
@@ -9,8 +9,8 @@ extern const char copyright_text_2[];
extern const char copyright_text_21[];
extern const char copyright_text_22[];
-const char copyright_text_1[] = "Copyright 2008 Sun Microsystems, Inc., All rights reserved.";
+const char copyright_text_1[] = "Copyright 2010 Sun Microsystems, Inc., All rights reserved.";
const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.";
-const char copyright_text_21[] = "Copyright 2008 Sun Microsystems, Tous droits rservs.";
+const char copyright_text_21[] = "Copyright 2010 Sun Microsystems, Tous droits rservs.";
const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de proprit intellectuels relatants la technologie incorpore dans ce produit. En particulier, et sans la limitation, ces droits de proprit intellectuels peuvent inclure un ou plus des brevets amricains numrs http://www.sun.com/patents et un ou les brevets plus supplmentaires ou les applications de brevet en attente dans les tats - Unis et les autres pays.";
diff --git a/desktop/source/app/copyright_ascii_sun.c b/desktop/source/app/copyright_ascii_sun.c
index 70d7d53f4b9c..6284744db94f 100644
--- a/desktop/source/app/copyright_ascii_sun.c
+++ b/desktop/source/app/copyright_ascii_sun.c
@@ -4,12 +4,12 @@
*
*/
-const char copyright_text_1[] = "Copyright 2008 Sun Microsystems, Inc., All rights reserved.";
+const char copyright_text_1[] = "Copyright 2010 Sun Microsystems, Inc., All rights reserved.";
const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.";
const char copyright_text_3[] = "U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms.";
const char copyright_text_4[] = "This distribution may include materials developed by third parties.Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries.";
const char copyright_text_5[] = "UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.";
-const char copyright_text_21[] = "Copyright 2008 Sun Microsystems, Tous droits rservs.";
+const char copyright_text_21[] = "Copyright 2010 Sun Microsystems, Tous droits rservs.";
const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de proprit intellectuels relatants la technologie incorpore dans ce produit. En particulier, et sans la limitation, ces droits de proprit intellectuels peuvent inclure un ou plus des brevets amricains numrs http://www.sun.com/patents et un ou les brevets plus supplmentaires ou les applications de brevet en attente dans les tats - Unis et les autres pays.";
const char copyright_text_23[] = "Ce produit ou document est protg par un copyright et distribu avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la dcompilation. Aucune partie de ce produit ou document ne peut tre reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation pralable et crite de Sun et de ses bailleurs de licence, s'il y ena.";
const char copyright_text_24[] = "L'utilisation est soumise aux termes du contrat de licence.";
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index e9a39207cb50..e8b50cdd295e 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -39,7 +39,7 @@
#include <rtl/string.hxx>
#endif
#ifndef _SVTOOLS_PATHOPTIONS_HXX
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#endif
#include <tools/resid.hxx>
#include <i18npool/mslangid.hxx>
@@ -143,6 +143,18 @@ bool LanguageSelection::prepareLanguage()
xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
+ MsLangId::setConfiguredSystemUILanguage( MsLangId::convertLocaleToLanguage(loc) );
+
+ OUString sLocale;
+ xProp->getPropertyValue(OUString::createFromAscii("ooSetupSystemLocale")) >>= sLocale;
+ if ( sLocale.getLength() )
+ {
+ loc = LanguageSelection::IsoStringToLocale(aLocaleString);
+ MsLangId::setConfiguredSystemLanguage( MsLangId::convertLocaleToLanguage(loc) );
+ }
+ else
+ MsLangId::setConfiguredSystemLanguage( MsLangId::getSystemLanguage() );
+
bSuccess = sal_True;
}
catch ( PropertyVetoException& )
diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx
index d0867529ab1b..e9753ae4ab73 100644
--- a/desktop/source/app/langselect.hxx
+++ b/desktop/source/app/langselect.hxx
@@ -33,14 +33,10 @@
#include <tools/string.hxx>
#include <rtl/ustring.hxx>
#include <tools/resid.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
namespace desktop
{
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index 238685649cf9..ffaf68c0fbad 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -50,7 +50,6 @@ SHL1OBJS = \
$(SLO)$/appfirststart.obj \
$(SLO)$/appinit.obj \
$(SLO)$/appsys.obj \
- $(SLO)$/cfgfilter.obj \
$(SLO)$/checkinstall.obj \
$(SLO)$/check_ext_deps.obj \
$(SLO)$/cmdlineargs.obj \
@@ -62,12 +61,12 @@ SHL1OBJS = \
$(SLO)$/langselect.obj \
$(SLO)$/lockfile.obj \
$(SLO)$/lockfile2.obj \
- $(SLO)$/migration.obj \
$(SLO)$/officeipcthread.obj \
- $(SLO)$/pages.obj \
$(SLO)$/sofficemain.obj \
- $(SLO)$/userinstall.obj \
- $(SLO)$/wizard.obj
+ $(SLO)$/userinstall.obj
+
+SHL1LIBS = $(SLB)$/mig.lib
+
SHL1STDLIBS = \
$(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index cb2856fb897d..6777bbd52fe6 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -47,7 +47,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/instance.hxx>
#include <osl/conditn.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 920da5613382..ccdeadbd7c53 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -50,9 +50,9 @@
#include <tools/resmgr.hxx>
#endif
#include <unotools/bootstrap.hxx>
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
#ifndef _SVTOOLS_SYSLOCALEOPTIONSOPTIONS_HXX
-#include <svtools/syslocaleoptions.hxx>
+#include <unotools/syslocaleoptions.hxx>
#endif
#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index 39ea6f016dbf..75005b728465 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.cxx
@@ -104,7 +104,7 @@ PersistentMap::PersistentMap( OUString const & url_, bool readOnly )
OSL_ASSERT( false );
}
OString cstr_sysPath(
- OUStringToOString( m_sysPath, osl_getThreadTextEncoding() ) );
+ OUStringToOString( m_sysPath, RTL_TEXTENCODING_UTF8 ) );
char const * pcstr_sysPath = cstr_sysPath.getStr();
u_int32_t flags = DB_CREATE;
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
index 7338a377de5d..9a0b76773f27 100644
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
+++ b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
@@ -33,7 +33,7 @@
#include "svtools/svmedit2.hxx"
-#include "svtools/lstner.hxx"
+#include "svl/lstner.hxx"
#include "svtools/xtextedt.hxx"
#include "vcl/scrbar.hxx"
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
index 98fa0050584a..3353bd42f04d 100644
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
+++ b/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
@@ -31,7 +31,7 @@
#define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_AUTOSCROLLEDIT_HXX
#include "svtools/svmedit2.hxx"
-#include "svtools/lstner.hxx"
+#include "svl/lstner.hxx"
namespace dp_gui {
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index f09d906a840e..b2620703a44a 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -34,7 +34,7 @@
#include "dp_gui.hrc"
#include "svtools/controldims.hrc"
-#include "svtools/svtools.hrc"
+#include "svl/svtools.hrc"
#include "dp_gui.h"
#include "dp_gui_dialog2.hxx"
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index f4473c2c6fd8..36f08dbf5b32 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -1141,7 +1141,7 @@ void ExtensionBox_Impl::checkEntries()
//------------------------------------------------------------------------------
bool ExtensionBox_Impl::isHCMode()
{
- return (bool)GetDisplayBackground().GetColor().IsDark();
+ return (bool)GetSettings().GetStyleSettings().GetHighContrastMode();
}
//------------------------------------------------------------------------------
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 0e1955359bbc..58e2cbd9bd0a 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -284,8 +284,8 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_context;
UpdateDialog & m_dialog;
std::vector< dp_gui::TUpdateListEntry > m_vExtensionList;
- css::uno::Reference< css::deployment::XUpdateInformationProvider >
- m_updateInformation;
+ css::uno::Reference< css::deployment::XUpdateInformationProvider > m_updateInformation;
+ css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHdl;
// guarded by Application::GetSolarMutex():
css::uno::Reference< css::task::XAbortChannel > m_abort;
@@ -302,7 +302,21 @@ UpdateDialog::Thread::Thread(
m_updateInformation(
css::deployment::UpdateInformationProvider::create(context)),
m_stop(false)
-{}
+{
+ if( m_context.is() )
+ {
+ css::uno::Reference< css::lang::XMultiComponentFactory > xServiceManager( m_context->getServiceManager() );
+
+ if( xServiceManager.is() )
+ {
+ m_xInteractionHdl = css::uno::Reference< css::task::XInteractionHandler > (
+ xServiceManager->createInstanceWithContext( OUSTR( "com.sun.star.task.InteractionHandler" ), m_context),
+ css::uno::UNO_QUERY );
+ if ( m_xInteractionHdl.is() )
+ m_updateInformation->setInteractionHandler( m_xInteractionHdl );
+ }
+ }
+}
void UpdateDialog::Thread::stop() {
css::uno::Reference< css::task::XAbortChannel > abort;
@@ -327,7 +341,11 @@ UpdateDialog::Thread::Entry::Entry(
version(theVersion)
{}
-UpdateDialog::Thread::~Thread() {}
+UpdateDialog::Thread::~Thread()
+{
+ if ( m_xInteractionHdl.is() )
+ m_updateInformation->setInteractionHandler( css::uno::Reference< css::task::XInteractionHandler > () );
+}
void UpdateDialog::Thread::execute()
{
@@ -1260,7 +1278,7 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
{
css::uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute(
m_context->getServiceManager()->createInstanceWithContext(
- ::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" ),
+ OUSTR( "com.sun.star.system.SystemShellExecute" ),
m_context), css::uno::UNO_QUERY_THROW);
//throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
xSystemShellExecute->execute(
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index bbc6a983c1fd..5a503b57c89d 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -43,7 +43,7 @@
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/task/XJobExecutor.hpp"
#include "svtools/svmedit.hxx"
-#include "svtools/lstner.hxx"
+#include "svl/lstner.hxx"
#include "svtools/xtextedt.hxx"
#include <vcl/scrbar.hxx>
#include "vcl/threadex.hxx"
@@ -215,7 +215,7 @@ LicenseDialogImpl::LicenseDialogImpl(
{
- if (GetBackground().GetColor().IsDark())
+ if (GetSettings().GetStyleSettings().GetHighContrastMode())
{
// high contrast mode needs other images
m_fiArrow1.SetImage(Image(DpGuiResId(IMG_LICENCE_ARROW_HC)));
diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk
index 8ee3efd34f63..f63661df4cd5 100644
--- a/desktop/source/deployment/makefile.mk
+++ b/desktop/source/deployment/makefile.mk
@@ -82,6 +82,7 @@ SHL1STDLIBS = \
$(TOOLSLIB) \
$(XMLSCRIPTLIB) \
$(SVLLIB) \
+ $(UNOTOOLSLIB) \
$(DEPLOYMENTMISCLIB) \
$(HELPLINKERLIB)
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index d7177f90dc77..f0635eec3d72 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -49,7 +49,7 @@
#include "comphelper/servicedecl.hxx"
#include "comphelper/sequence.hxx"
#include "xmlscript/xml_helper.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include "com/sun/star/lang/DisposedException.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/beans/UnknownPropertyException.hpp"
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index e9f8a07a96ae..361004b353a3 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -45,7 +45,7 @@
#include "comphelper/servicedecl.hxx"
#include "comphelper/sequence.hxx"
#include "xmlscript/xml_helper.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/container/XNameContainer.hpp"
#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index b24000d43dbb..b1c67f642efb 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -45,7 +45,7 @@
#include "comphelper/anytostring.hxx"
#include "comphelper/servicedecl.hxx"
#include "xmlscript/xml_helper.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include "com/sun/star/ucb/NameClash.hpp"
#include "com/sun/star/io/XActiveDataSink.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index 3afcb8d35636..690549db0119 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.cxx
@@ -38,7 +38,7 @@
#include "osl/file.hxx"
#include "ucbhelper/content.hxx"
#include "comphelper/servicedecl.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include "cppuhelper/implbase1.hxx"
using namespace ::com::sun::star;
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index dd9e009e90cc..7daa9adb277e 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -38,7 +38,8 @@
#include "osl/file.hxx"
#include "ucbhelper/content.hxx"
#include "comphelper/servicedecl.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
+#include "unotools/pathoptions.hxx"
#include <transex3/compilehelp.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
@@ -350,8 +351,12 @@ void BackendImpl::implProcessHelp
pXhpFiles[iXhp] = aXhpRelFile;
}
+ rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
+ rtl::OUString aOfficeHelpPathFileURL;
+ ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
+
HelpProcessingErrorInfo aErrorInfo;
- bool bSuccess = compileExtensionHelp( aHelpStr, aLangURL,
+ bool bSuccess = compileExtensionHelp( aOfficeHelpPathFileURL, aHelpStr, aLangURL,
nXhpFileCount, pXhpFiles, aErrorInfo );
if( bSuccess && xInvocation.is() )
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 14075d0fca38..1771cc93ec07 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -44,7 +44,7 @@
#include "cppuhelper/exc_hlp.hxx"
#include "cppuhelper/implbase1.hxx"
#include "ucbhelper/content.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include "comphelper/anytostring.hxx"
#include "comphelper/makesequence.hxx"
#include "comphelper/sequence.hxx"
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index ba8a972d0624..dbc644e60f44 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -40,7 +40,7 @@
#include "cppuhelper/exc_hlp.hxx"
#include "cppuhelper/implbase1.hxx"
#include "comphelper/servicedecl.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include "com/sun/star/util/XUpdatable.hpp"
#include "com/sun/star/script/XLibraryContainer.hpp"
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index ff17da268dff..de515dd78372 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -38,7 +38,7 @@
#include "ucbhelper/content.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "comphelper/servicedecl.hxx"
-#include "svtools/inettype.hxx"
+#include "svl/inettype.hxx"
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <memory>
diff --git a/desktop/source/migration/makefile.mk b/desktop/source/migration/makefile.mk
index d5aaf884ac5e..31af71f83fee 100644
--- a/desktop/source/migration/makefile.mk
+++ b/desktop/source/migration/makefile.mk
@@ -33,7 +33,6 @@ PRJ=..$/..
PRJNAME=desktop
TARGET=mig
-LIBTARGET=NO
AUTOSEG=true
ENABLE_EXCEPTIONS=TRUE
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index 80c5849ee4d9..c21767a0f83d 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -43,8 +43,8 @@
#include <osl/file.hxx>
#include <unotools/bootstrap.hxx>
#include <unotools/configmgr.hxx>
-#include <svtools/regoptions.hxx>
-#include <svtools/useroptions.hxx>
+#include <unotools/regoptions.hxx>
+#include <unotools/useroptions.hxx>
#include <sfx2/basedlgs.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -373,9 +373,11 @@ UserPage::UserPage( svt::OWizardMachine* parent, const ResId& resid)
SvtUserOptions aUserOpt;
m_edFirst.SetText(aUserOpt.GetFirstName());
m_edLast.SetText(aUserOpt.GetLastName());
+#if 0
rtl::OUString aUserName;
vos::OSecurity().getUserName( aUserName );
aUserOpt.SetID( aUserName );
+#endif
m_edInitials.SetText(aUserOpt.GetID());
if (m_lang == LANGUAGE_RUSSIAN)
@@ -546,7 +548,7 @@ sal_Bool RegistrationPage::commitPage( CommitPageReason _eReason )
{
if ( _eReason == eFinish )
{
- ::svt::RegOptions aOptions;
+ ::utl::RegOptions aOptions;
rtl::OUString aEvent;
if ( m_rbNow.IsChecked())
@@ -603,7 +605,7 @@ void RegistrationPage::prepareSingleMode()
bool RegistrationPage::hasReminderDateCome()
{
- return ::svt::RegOptions().hasReminderDateCome();
+ return ::utl::RegOptions().hasReminderDateCome();
}
void RegistrationPage::executeSingleMode()
@@ -620,7 +622,7 @@ void RegistrationPage::executeSingleMode()
if ( eMode == RegistrationPage::rmNow || eMode == RegistrationPage::rmLater )
pPage->commitPage( IWizardPage::eFinish );
if ( eMode != RegistrationPage::rmLater )
- ::svt::RegOptions().removeReminder();
+ ::utl::RegOptions().removeReminder();
}
// -----------------------------------------------------------------------
diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx
index 97d4282d1d76..b5e89860792c 100644
--- a/desktop/source/migration/pages.hxx
+++ b/desktop/source/migration/pages.hxx
@@ -38,7 +38,7 @@
#include <vcl/scrbar.hxx>
#include <svtools/wizardmachine.hxx>
#include <svtools/svmedit.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <svtools/xtextedt.hxx>
namespace desktop
diff --git a/desktop/source/pagein/makefile.mk b/desktop/source/pagein/makefile.mk
index 85cbb4d3c9fd..626412877250 100644
--- a/desktop/source/pagein/makefile.mk
+++ b/desktop/source/pagein/makefile.mk
@@ -81,21 +81,25 @@ $(MISC)$/$(TARGET)-calc : makefile.mk
@echo Making: $@
@-echo $(DLLPRE)sc$(DFTDLLPOST) > $@
@-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@
+ @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@
$(MISC)$/$(TARGET)-draw : makefile.mk
@echo Making: $@
@-echo $(DLLPRE)sd$(DFTDLLPOST) > $@
@-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@
+ @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@
$(MISC)$/$(TARGET)-impress : makefile.mk
@echo Making: $@
@-echo $(DLLPRE)sd$(DFTDLLPOST) > $@
@-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@
+ @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@
$(MISC)$/$(TARGET)-writer : makefile.mk
@echo Making: $@
@-echo $(DLLPRE)sw$(DFTDLLPOST) > $@
@-echo $(DLLPRE)svx$(DFTDLLPOST) >> $@
+ @-echo $(DLLPRE)svxcore$(DFTDLLPOST) >> $@
# sorted in approx. reverse load order (ld.so.1)
$(MISC)$/$(TARGET)-common : makefile.mk
@@ -121,7 +125,7 @@ $(MISC)$/$(TARGET)-common : makefile.mk
@-echo $(DLLPRE)ucb1$(DLLPOST) >> $@
@-echo configmgr2$(UNODLLPOST) >> $@
#
- @-echo $(DLLPRE)dtransX11$(DFTDLLPOST) >> $@
+ @-echo $(DLLPRE)dtrans$(DLLPOST) >> $@
@-echo $(DLLPRE)vclplug_gen$(DFTDLLPOST) >> $@
.IF "$(ENABLE_GTK)" != ""
@-echo $(DLLPRE)vclplug_gtk$(DFTDLLPOST) >> $@
@@ -130,7 +134,6 @@ $(MISC)$/$(TARGET)-common : makefile.mk
@-echo $(DLLPRE)vclplug_kde$(DFTDLLPOST) >> $@
.ENDIF # ENABLE_KDE
#
- @-echo $(DLLPRE)psp$(DFTDLLPOST) >> $@
@-echo $(DLLPRE)basegfx$(DFTDLLPOST) >> $@
@-echo $(DLLPRE)sot$(DFTDLLPOST) >> $@
@-echo $(DLLPRE)xcr$(DFTDLLPOST) >> $@
diff --git a/desktop/source/pkgchk/unopkg/makefile.mk b/desktop/source/pkgchk/unopkg/makefile.mk
index 3562fad961d9..4a1f409f4564 100644
--- a/desktop/source/pkgchk/unopkg/makefile.mk
+++ b/desktop/source/pkgchk/unopkg/makefile.mk
@@ -49,6 +49,7 @@ PRJINC += ..$/..$/deployment ..$/..
CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES)
.ENDIF
+.IF "$(LINK_SO)"!=""
APP1TARGET = so$/unopkg
APP1OBJS = $(OBJFILES)
APP1STDLIBS = $(SALLIB) $(UNOPKGAPPLIB)
@@ -59,6 +60,7 @@ APP1RPATH = BRAND
APP1ICON = $(SOLARRESDIR)$/icons/so9_main_app.ico
APP1LINKRES = $(MISC)$/$(TARGET)1.res
.ENDIF
+.ENDIF # "$(LINK_SO)"!=""
APP2TARGET = unopkg
APP2OBJS = $(OBJFILES)
diff --git a/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java b/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java
index c97d5f2cd4f0..060ef6cb7f6d 100644
--- a/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java
+++ b/desktop/source/registration/com/sun/star/servicetag/BrowserSupport.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: BrowserSupport.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/Installer.java b/desktop/source/registration/com/sun/star/servicetag/Installer.java
index 02825dfec69d..e4daf959c19d 100644
--- a/desktop/source/registration/com/sun/star/servicetag/Installer.java
+++ b/desktop/source/registration/com/sun/star/servicetag/Installer.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: Installer.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -794,7 +793,7 @@ public class Installer {
reader.close();
}
- String resourceFilename = "/com/sun/star/servicetag/resources/register";
+ String resourceFilename = "/com/sun/servicetag/resources/register";
for (Locale locale : supportedLocales) {
String name = REGISTRATION_HTML_NAME;
String resource = resourceFilename;
diff --git a/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java
index 90e38021c103..4129e440099f 100644
--- a/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java
+++ b/desktop/source/registration/com/sun/star/servicetag/LinuxSystemEnvironment.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: LinuxSystemEnvironment.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -29,6 +28,7 @@
*
************************************************************************/
+
package com.sun.star.servicetag;
// The Service Tags team maintains the latest version of the implementation
@@ -40,6 +40,7 @@ package com.sun.star.servicetag;
// (e.g. NetBeans and SunStudio) will use the version in JDK.
import java.io.*;
+import java.util.*;
/**
* Linux implementation of the SystemEnvironment class.
@@ -47,16 +48,25 @@ import java.io.*;
class LinuxSystemEnvironment extends SystemEnvironment {
LinuxSystemEnvironment() {
setHostId(getLinuxHostId());
- setSystemModel(getCommandOutput("/bin/uname", "-i"));
+
+ setSystemModel(getLinuxModel());
setSystemManufacturer(getLinuxSystemManufacturer());
setCpuManufacturer(getLinuxCpuManufacturer());
setSerialNumber(getLinuxSN());
+ setPhysMem(getLinuxPhysMem());
+ setSockets(getLinuxSockets());
+ setCores(getLinuxCores());
+ setVirtCpus(getLinuxVirtCpus());
+ setCpuName(getLinuxCpuName());
+ setClockRate(getLinuxClockRate());
}
private String dmiInfo = null;
+ private String kstatCpuInfo = null;
private static final int SN = 1;
private static final int SYS = 2;
private static final int CPU = 3;
+ private static final int MODEL = 4;
private String getLinuxHostId() {
String output = getCommandOutput("/usr/bin/hostid");
@@ -91,6 +101,21 @@ class LinuxSystemEnvironment extends SystemEnvironment {
return getLinuxDMIInfo("dmi type 4", "manufacturer");
}
+ private String getLinuxModel() {
+ String tmp = getLinuxPSNInfo(MODEL);
+ if (tmp.length() > 0) {
+ return tmp + "::" + getCommandOutput("/bin/uname","-v");
+ }
+
+ tmp = getLinuxDMIInfo("dmi type 1", "product name");
+ if (tmp.length() > 0) {
+ return tmp + "::" + getCommandOutput("/bin/uname","-v");
+ }
+
+ return getCommandOutput("/bin/uname","-i")
+ + "::" + getCommandOutput("/bin/uname","-v");
+ }
+
/**
* Tries to obtain and return the system manufacturer.
@@ -158,7 +183,7 @@ class LinuxSystemEnvironment extends SystemEnvironment {
dmidecodeThread.start();
try {
- dmidecodeThread.join(2000);
+ dmidecodeThread.join(3000);
if (dmidecodeThread.isAlive()) {
dmidecodeThread.interrupt();
dmiInfo = "";
@@ -191,4 +216,111 @@ class LinuxSystemEnvironment extends SystemEnvironment {
return "";
}
+ private String getLinuxClockRate() {
+ String contents = getFileContent("/proc/cpuinfo");
+ String token = "cpu MHz";
+ for (String line : contents.split("\n")) {
+ if (line.contains(token)) {
+ String[] key = line.split(":", 2);
+ if (key.length > 1) {
+ return key[1].trim();
+ }
+ }
+ }
+ return "";
+ }
+
+ private String getLinuxCpuName() {
+ String contents = getFileContent("/proc/cpuinfo");
+ String token = "model name";
+ for (String line : contents.split("\n")) {
+ if (line.contains(token)) {
+ String[] key = line.split(":", 2);
+ if (key.length > 1) {
+ return key[1].trim();
+ }
+ }
+ }
+ return "";
+ }
+
+ private String getLinuxVirtCpus() {
+ Set<String> set = new HashSet<String>();
+ String contents = getFileContent("/proc/cpuinfo");
+ String token = "processor";
+ for (String line : contents.split("\n")) {
+ if (line.contains(token)) {
+ String[] key = line.split(":", 2);
+ if (key.length > 1) {
+ set.add(key[1].trim());
+ }
+ }
+ }
+ return "" + set.size();
+ }
+
+ private String getLinuxCores() {
+ Set<String> set = new HashSet<String>();
+ String contents = getFileContent("/proc/cpuinfo");
+ String token = "core id";
+ for (String line : contents.split("\n")) {
+ if (line.contains(token)) {
+ String[] key = line.split(":", 2);
+ if (key.length > 1) {
+ set.add(key[1].trim());
+ }
+ }
+ }
+ if (set.size() == 0) {
+ return "1";
+ }
+ return "" + set.size();
+ }
+
+ private String getLinuxPhysMem() {
+ String contents = getFileContent("/proc/meminfo");
+ for (String line : contents.split("\n")) {
+ if (line.contains("MemTotal")) {
+ String[] total = line.split(":", 2);
+ if (total.length > 1) {
+ String[] mem = total[1].trim().split(" ");
+ if (mem.length >= 1) {
+ return mem[0].trim();
+ } else {
+ return total[1].trim();
+ }
+ }
+ }
+ }
+
+ return "";
+ }
+
+ private String getLinuxSockets() {
+ Set<String> physIdSet = new HashSet<String>();
+ Set<String> procSet = new HashSet<String>();
+ String contents = getFileContent("/proc/cpuinfo");
+ String physIdToken = "physical id";
+ String procToken = "processor";
+
+ for (String line : contents.split("\n")) {
+ if (line.contains(physIdToken)) {
+ String[] key = line.split(":", 2);
+ if (key.length > 1) {
+ physIdSet.add(key[1].trim());
+ }
+ }
+
+ if (line.contains(procToken)) {
+ String[] key = line.split(":", 2);
+ if (key.length > 1) {
+ procSet.add(key[1].trim());
+ }
+ }
+ }
+ if (physIdSet.size() != 0) {
+ return "" + physIdSet.size();
+ }
+ return "" + procSet.size();
+ }
}
diff --git a/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java b/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java
index 57be724a78a3..c58d83a33dd8 100644
--- a/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java
+++ b/desktop/source/registration/com/sun/star/servicetag/RegistrationData.java
@@ -1,473 +1,531 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: RegistrationData.java,v $
- *
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package com.sun.star.servicetag;
-
-import java.io.*;
-import java.net.UnknownHostException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import static com.sun.star.servicetag.RegistrationDocument.*;
-
-/**
- * A {@code RegistrationData} object is a container of one or more
- * {@link #getServiceTags service tags} that identify the
- * components for product registration.
- * Each {@code RegistrationData} object has a {@link #getRegistrationURN
- * uniform resource name} (URN) as its identifier.
- * <a name="EnvMap"></a>
- * It also has an <i>environment map</i> with
- * the following elements:
- * <blockquote>
- * <table border=0>
- * <tr>
- * <td><tt>hostname</tt></td>
- * <td>Hostname of the system</td>
- * <td>e.g. woody</td>
- * </tr>
- * <tr>
- * <td><tt>hostId</tt></td>
- * <td>Host ID of the system</td>
- * <td>e.g. 83abc1ab</td>
- * </tr>
- * <tr>
- * <td><tt>osName</tt></td>
- * <td>Operating system name</td>
- * <td> e.g. SunOS</td>
- * </tr>
- * <tr>
- * <td><tt>osVersion</tt></td>
- * <td>Operating system version</td>
- * <td> e.g. 5.10</td>
- * </tr>
- * <tr>
- * <td><tt>osArchitecture</tt></td>
- * <td>Operating system architecture</td>
- * <td> e.g. sparc</td>
- * </tr>
- * <tr>
- * <td><tt>systemModel</tt></td>
- * <td>System model</td>
- * <td> e.g. SUNW,Sun-Fire-V440</td>
- * </tr>
- * <tr>
- * <td><tt>systemManufacturer</tt></td>
- * <td>System manufacturer</td>
- * <td> e.g. Sun Microsystems</td>
- * </tr>
- * <tr>
- * <td><tt>cpuManufacturer</tt></td>
- * <td>CPU manufacturer</td>
- * <td> e.g. Sun Microsystems</td>
- * </tr>
- * <tr>
- * <td><tt>serialNumber</tt></td>
- * <td>System serial number</td>
- * <td> e.g. BEL078932</td>
- * </tr>
- * </table>
- * </blockquote>
- * The <tt>hostname</tt> and <tt>osName</tt> element must have a non-empty value.
- * If an element is not available on a system and their value will be
- * empty.
- * <p>
- * <a name="XMLSchema">
- * <b>Registration XML Schema</b></a>
- * <p>
- * A {@code RegistrationData} object can be {@link #loadFromXML loaded} from
- * and {@link #storeToXML stored} into an XML file in the format described
- * by the
- * <a href="https://sn-tools.central.sun.com/twiki/pub/ServiceTags/RegistrationRelayService/product_registration.xsd">
- * registration data schema</a>. The registration data schema is defined by the
- * Service Tags Technology.
- * <p>
- * Typically the registration data is constructed at installation time
- * and stored in an XML file for later service tag lookup or registration.
- *
- * <p>
- * <b>Example Usage</b>
- * <p>
- * The examples below show how the {@code RegistrationData} can be
- * used for product registration.
- * Exception handling is not shown in these examples for clarity.
- * <ol>
- * <li>This example shows how the JDK creates a JDK service tag, installs it
- * in the system service tag registry and adds it to the registration data.
- * <br>
- * <blockquote><pre>
- * // create a service tag object with an instance_urn
- * ServiceTag st = ServiceTag.newInstance(ServiceTag.generateInstanceURN(),
- * ....);
- * // Adds to the system service tag registry if supported
- * if (Registry.isSupported()) {
- * Registry.getSystemRegistry().addServiceTag(st);
- * }
- *
- * // add to the registration data
- * RegistrationData registration = new RegistrationData();
- * registration.addServiceTag(st);
- * </pre></blockquote>
- * </li>
- * <li>At this point, the registration data is ready to
- * send to Sun Connection for registration. This example shows how to register
- * the JDK via the <i>Registration Relay Service</i>.
- * <p>
- * There are several registration services for Sun Connection. For example,
- * the <a href="https://sn-tools.central.sun.com/twiki/bin/view/ServiceTags/RegistrationRelayService">
- * Registration Relay Service</a> is a web application interface that
- * processes the registration data payload sent via HTTP post
- * and hosts the registration user interface for a specified
- * registration URL. Refer to the
- * Registration Relay Service Specification for details.
- * <p>
- * <blockquote><pre>
- * // Open the connection to the URL of the registration service
- * HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
- * con.setDoInput(true);
- * con.setDoOutput(true);
- * con.setUseCaches(false);
- * con.setAllowUserInteraction(false);
- * con.setRequestMethod("POST");
- * con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
- * con.connect();
- *
- * // send the registration data to the registration service
- * OutputStream out = con.getOutputStream();
- * registration.storeToXML(out);
- * out.close();
- * </pre></blockquote>
- * </li>
- * <li>This example shows how to store the registration data in an XML file.
- * for later service tag lookup or registration.
- * <br>
- * <blockquote><pre>
- * BufferedOutputStream out = new BufferedOutputStream(
- * new FileOutputStream(""&lt;JAVA_HOME&gt;/lib/servicetag/registration.xml"));
- * registration.storeToXML(out);
- * out.close();
- * </pre></blockquote>
- * </li>
- * <li>This example shows how to install service tags that are in the
- * registration data in the system service tag registry when determined
- * to be available. The system service tag registry might not have existed
- * when the registration data was constructed.
- * <br>
- * <blockquote><pre>
- * if (Registry.isSupported()) {
- * Set&lt;ServiceTag&gt; svctags = registration.getServiceTags();
- * for (ServiceTag st : svctags) {
- * Registry.getSystemRegistry().addServiceTag(st);
- * }
- * }
- * </pre></blockquote>
- * </li>
- * </ol>
- *
- * @see <a href="https://sunconnection.sun.com/inventory">Sun Connection Inventory Channel</a>
- */
-public class RegistrationData {
- private final Map<String, String> environment;
- private final Map<String, ServiceTag> svcTagMap;
- private final String urn;
-
- /**
- * Creates a {@code RegistrationData} object with a generated
- * {@link #getRegistrationURN registration URN}.
- * The following keys in the {@link #getEnvironmentMap environment map}
- * will be initialized for the configuration of the
- * running system:
- * <blockquote>
- * <tt>hostname</tt>, <tt>osName</tt>, <tt>osVersion</tt> and
- * <tt>osArchitecture</tt>
- * </blockquote>
- * and the value of other keys may be empty.
- */
- public RegistrationData() {
- this(Util.generateURN());
- }
-
- // package private
- RegistrationData(String urn) {
- this.urn = urn;
- this.environment = initEnvironment();
- this.svcTagMap = new LinkedHashMap<String, ServiceTag>();
- }
-
- private Map<String, String> initEnvironment() {
- Map<String, String> map = new LinkedHashMap<String, String>();
- SystemEnvironment sysEnv = SystemEnvironment.getSystemEnvironment();
- map.put(ST_NODE_HOSTNAME, sysEnv.getHostname());
- map.put(ST_NODE_HOST_ID, sysEnv.getHostId());
- map.put(ST_NODE_OS_NAME, sysEnv.getOsName());
- map.put(ST_NODE_OS_VERSION, sysEnv.getOsVersion());
- map.put(ST_NODE_OS_ARCH, sysEnv.getOsArchitecture());
- map.put(ST_NODE_SYSTEM_MODEL, sysEnv.getSystemModel());
- map.put(ST_NODE_SYSTEM_MANUFACTURER, sysEnv.getSystemManufacturer());
- map.put(ST_NODE_CPU_MANUFACTURER, sysEnv.getCpuManufacturer());
- map.put(ST_NODE_SERIAL_NUMBER, sysEnv.getSerialNumber());
- return map;
- }
-
- /**
- * Returns the uniform resource name of this registration data
- * in this format:
- * <tt>urn:st:&lt;32-char {@link java.util.UUID uuid}&gt;</tt>
- *
- * @return the URN of this registration data.
- */
- public String getRegistrationURN() {
- return urn;
- }
-
- /**
- * Returns a map containing the environment information for this
- * registration data. See the set of <a href="#EnvMap">keys</a>
- * in the environment map. Subsequent update to the environment
- * map via the {@link #setEnvironment setEnvironment} method will not be reflected
- * in the returned map.
- *
- * @return an environment map for this registration data.
- */
- public Map<String, String> getEnvironmentMap() {
- return new LinkedHashMap<String,String>(environment);
- }
-
- /**
- * Sets an element of the specified {@code name} in the environment map
- * with the given {@code value}.
- *
- * @throws IllegalArgumentException if {@code name} is not a valid key
- * in the environment map, or {@code value} is not valid.
- */
- public void setEnvironment(String name, String value) {
- if (name == null) {
- throw new NullPointerException("name is null");
- }
- if (value == null) {
- throw new NullPointerException("value is null");
- }
- if (environment.containsKey(name)) {
- if (name.equals(ST_NODE_HOSTNAME) || name.equals(ST_NODE_OS_NAME)) {
- if (value.length() == 0) {
- throw new IllegalArgumentException("\"" +
- name + "\" requires non-empty value.");
- }
- }
- environment.put(name, value);
- } else {
- throw new IllegalArgumentException("\"" +
- name + "\" is not an environment element.");
- }
- }
-
- /**
- * Returns all service tags in this registration data.
- *
- * @return a {@link Set Set} of the service tags
- * in this registration data.
- */
- public Set<ServiceTag> getServiceTags() {
- return new HashSet<ServiceTag>(svcTagMap.values());
- }
-
- /**
- * Adds a service tag to this registration data.
- * If the given service tag has an empty <tt>instance_urn</tt>,
- * this method will generate a URN and place it in the copy
- * of the service tag in this registration data.
- * This method will return the {@code ServiceTag} object
- * added to this registration data.
- *
- * @param st {@code ServiceTag} object to be added.
- * @return a {@code ServiceTag} object added to this registration data.
- *
- * @throws IllegalArgumentException if
- * a service tag of the same {@link ServiceTag#getInstanceURN
- * <tt>instance_urn</tt>} already exists in the registry.
- */
- public synchronized ServiceTag addServiceTag(ServiceTag st) {
- ServiceTag svcTag = ServiceTag.newInstanceWithUrnTimestamp(st);
-
- String instanceURN = svcTag.getInstanceURN();
- if (svcTagMap.containsKey(instanceURN)) {
- throw new IllegalArgumentException("Instance_urn = " + instanceURN +
- " already exists in the registration data.");
- } else {
- svcTagMap.put(instanceURN, svcTag);
- }
- return svcTag;
- }
-
- /**
- * Returns a service tag of the given <tt>instance_urn</tt> in this registration
- * data.
- *
- * @param instanceURN the <tt>instance_urn</tt> of the service tag
- * @return the {@code ServiceTag} object of the given <tt>instance_urn</tt>
- * if exists; otherwise return {@code null}.
- */
- public synchronized ServiceTag getServiceTag(String instanceURN) {
- if (instanceURN == null) {
- throw new NullPointerException("instanceURN is null");
- }
- return svcTagMap.get(instanceURN);
- }
-
- /**
- * Removes a service tag of the given <tt>instance_urn</tt> from this
- * registration data.
- *
- * @param instanceURN the <tt>instance_urn</tt> of
- * the service tag to be removed.
- *
- * @return the removed {@code ServiceTag} object;
- * or {@code null} if the service tag does not exist in this
- * registration data.
- */
- public synchronized ServiceTag removeServiceTag(String instanceURN) {
- if (instanceURN == null) {
- throw new NullPointerException("instanceURN is null");
- }
-
- ServiceTag svcTag = null;
- if (svcTagMap.containsKey(instanceURN)) {
- svcTag = svcTagMap.remove(instanceURN);
- }
- return svcTag;
- }
-
- /**
- * Updates the <tt>product_defined_instance_id</tt> in the service tag
- * of the given <tt>instance_urn</tt> in this registration data.
- *
- * @param instanceURN the <tt>instance_urn</tt> of the service tag to be updated.
- * @param productDefinedInstanceID the value of the
- * <tt>product_defined_instance_id</tt> to be set.
- *
- * @return the updated {@code ServiceTag} object;
- * or {@code null} if the service tag does not exist in this
- * registration data.
- */
- public synchronized ServiceTag updateServiceTag(String instanceURN,
- String productDefinedInstanceID) {
- ServiceTag svcTag = getServiceTag(instanceURN);
- if (svcTag == null) {
- return null;
- }
-
- svcTag = ServiceTag.newInstanceWithUrnTimestamp(svcTag);
- // update the product defined instance ID field
- svcTag.setProductDefinedInstanceID(productDefinedInstanceID);
- svcTagMap.put(instanceURN, svcTag);
- return svcTag;
- }
-
- /**
- * Reads the registration data from the XML document on the
- * specified input stream. The XML document must be
- * in the format described by the <a href="#XMLSchema">
- * registration data schema</a>.
- * The specified stream is closed after this method returns.
- *
- * @param in the input stream from which to read the XML document.
- * @return a {@code RegistrationData} object read from the input
- * stream.
- *
- * @throws IllegalArgumentException if the input stream
- * contains an invalid registration data.
- *
- * @throws IOException if an error occurred when reading from the input stream.
- */
- public static RegistrationData loadFromXML(InputStream in) throws IOException {
- try {
- return RegistrationDocument.load(in);
- } finally {
- in.close();
- }
- }
-
- /**
- * Writes the registration data to the specified output stream
- * in the format described by the <a href="#XMLSchema">
- * registration data schema</a> with "UTF-8" encoding.
- * The specified stream remains open after this method returns.
- *
- * @param os the output stream on which to write the XML document.
- *
- * @throws IOException if an error occurred when writing to the output stream.
- */
- public void storeToXML(OutputStream os) throws IOException {
- RegistrationDocument.store(os, this);
- os.flush();
- }
-
- /**
- * Returns a newly allocated byte array containing the registration
- * data in XML format.
- *
- * @return a newly allocated byte array containing the registration
- * data in XML format.
- */
- public byte[] toXML() {
- try {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- storeToXML(out);
- return out.toByteArray();
- } catch (IOException e) {
- // should not reach here
- return new byte[0];
- }
- }
-
- /**
- * Returns a string representation of this registration data in XML
- * format.
- *
- * @return a string representation of this registration data in XML
- * format.
- */
- @Override
- public String toString() {
- try {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- storeToXML(out);
- return out.toString("UTF-8");
- } catch (IOException e) {
- // should not reach here
- return "Error creating the return string.";
- }
- }
-}
+
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.net.UnknownHostException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import static com.sun.star.servicetag.RegistrationDocument.*;
+
+/**
+ * A {@code RegistrationData} object is a container of one or more
+ * {@link #getServiceTags service tags} that identify the
+ * components for product registration.
+ * Each {@code RegistrationData} object has a {@link #getRegistrationURN
+ * uniform resource name} (URN) as its identifier.
+ * <a name="EnvMap"></a>
+ * It also has an <i>environment map</i> with
+ * the following elements:
+ * <blockquote>
+ * <table border=0>
+ * <tr>
+ * <td><tt>hostname</tt></td>
+ * <td>Hostname of the system</td>
+ * <td>e.g. woody</td>
+ * </tr>
+ * <tr>
+ * <td><tt>hostId</tt></td>
+ * <td>Host ID of the system</td>
+ * <td>e.g. 83abc1ab</td>
+ * </tr>
+ * <tr>
+ * <td><tt>osName</tt></td>
+ * <td>Operating system name</td>
+ * <td> e.g. SunOS</td>
+ * </tr>
+ * <tr>
+ * <td><tt>osVersion</tt></td>
+ * <td>Operating system version</td>
+ * <td> e.g. 5.10</td>
+ * </tr>
+ * <tr>
+ * <td><tt>osArchitecture</tt></td>
+ * <td>Operating system architecture</td>
+ * <td> e.g. sparc</td>
+ * </tr>
+ * <tr>
+ * <td><tt>systemModel</tt></td>
+ * <td>System model</td>
+ * <td> e.g. SUNW,Sun-Fire-V440</td>
+ * </tr>
+ * <tr>
+ * <td><tt>systemManufacturer</tt></td>
+ * <td>System manufacturer</td>
+ * <td> e.g. Sun Microsystems</td>
+ * </tr>
+ * <tr>
+ * <td><tt>cpuManufacturer</tt></td>
+ * <td>CPU manufacturer</td>
+ * <td> e.g. Sun Microsystems</td>
+ * </tr>
+ * <tr>
+ * <td><tt>serialNumber</tt></td>
+ * <td>System serial number</td>
+ * <td> e.g. BEL078932</td>
+ * </tr>
+ * <tr>
+ * <td><tt>physmem</tt></td>
+ * <td>Physical memory for the system (in MB)</td>
+ * <td> e.g. 4096</td>
+ * </tr>
+ * </table>
+ * </blockquote>
+ * The <tt>hostname</tt> and <tt>osName</tt> element must have a non-empty value.
+ * If an element is not available on a system and their value will be
+ * empty.
+ * <p>
+ * <a name="XMLSchema">
+ * <b>Registration XML Schema</b></a>
+ * <p>
+ * A {@code RegistrationData} object can be {@link #loadFromXML loaded} from
+ * and {@link #storeToXML stored} into an XML file in the format described
+ * by the
+ * <a href="https://sn-tools.central.sun.com/twiki/pub/ServiceTags/RegistrationRelayService/product_registration.xsd">
+ * registration data schema</a>. The registration data schema is defined by the
+ * Service Tags Technology.
+ * <p>
+ * Typically the registration data is constructed at installation time
+ * and stored in an XML file for later service tag lookup or registration.
+ *
+ * <p>
+ * <b>Example Usage</b>
+ * <p>
+ * The examples below show how the {@code RegistrationData} can be
+ * used for product registration.
+ * Exception handling is not shown in these examples for clarity.
+ * <ol>
+ * <li>This example shows how the JDK creates a JDK service tag, installs it
+ * in the system service tag registry and adds it to the registration data.
+ * <br>
+ * <blockquote><pre>
+ * // create a service tag object with an instance_urn
+ * ServiceTag st = ServiceTag.newInstance(ServiceTag.generateInstanceURN(),
+ * ....);
+ * // Adds to the system service tag registry if supported
+ * if (Registry.isSupported()) {
+ * Registry.getSystemRegistry().addServiceTag(st);
+ * }
+ *
+ * // add to the registration data
+ * RegistrationData registration = new RegistrationData();
+ * registration.addServiceTag(st);
+ * </pre></blockquote>
+ * </li>
+ * <li>At this point, the registration data is ready to
+ * send to Sun Connection for registration. This example shows how to register
+ * the JDK via the <i>Registration Relay Service</i>.
+ * <p>
+ * There are several registration services for Sun Connection. For example,
+ * the <a href="https://sn-tools.central.sun.com/twiki/bin/view/ServiceTags/RegistrationRelayService">
+ * Registration Relay Service</a> is a web application interface that
+ * processes the registration data payload sent via HTTP post
+ * and hosts the registration user interface for a specified
+ * registration URL. Refer to the
+ * Registration Relay Service Specification for details.
+ * <p>
+ * <blockquote><pre>
+ * // Open the connection to the URL of the registration service
+ * HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
+ * con.setDoInput(true);
+ * con.setDoOutput(true);
+ * con.setUseCaches(false);
+ * con.setAllowUserInteraction(false);
+ * con.setRequestMethod("POST");
+ * con.setRequestProperty("Content-Type", "text/xml;charset=\"utf-8\"");
+ * con.connect();
+ *
+ * // send the registration data to the registration service
+ * OutputStream out = con.getOutputStream();
+ * registration.storeToXML(out);
+ * out.close();
+ * </pre></blockquote>
+ * </li>
+ * <li>This example shows how to store the registration data in an XML file.
+ * for later service tag lookup or registration.
+ * <br>
+ * <blockquote><pre>
+ * BufferedOutputStream out = new BufferedOutputStream(
+ * new FileOutputStream(""&lt;JAVA_HOME&gt;/lib/servicetag/registration.xml"));
+ * registration.storeToXML(out);
+ * out.close();
+ * </pre></blockquote>
+ * </li>
+ * <li>This example shows how to install service tags that are in the
+ * registration data in the system service tag registry when determined
+ * to be available. The system service tag registry might not have existed
+ * when the registration data was constructed.
+ * <br>
+ * <blockquote><pre>
+ * if (Registry.isSupported()) {
+ * Set&lt;ServiceTag&gt; svctags = registration.getServiceTags();
+ * for (ServiceTag st : svctags) {
+ * Registry.getSystemRegistry().addServiceTag(st);
+ * }
+ * }
+ * </pre></blockquote>
+ * </li>
+ * </ol>
+ *
+ * @see <a href="https://sunconnection.sun.com/inventory">Sun Connection Inventory Channel</a>
+ */
+public class RegistrationData {
+ private final Map<String, String> environment;
+ private final Map<String, String> cpuInfo;
+ private final Map<String, ServiceTag> svcTagMap;
+ private final String urn;
+
+ /**
+ * Creates a {@code RegistrationData} object with a generated
+ * {@link #getRegistrationURN registration URN}.
+ * The following keys in the {@link #getEnvironmentMap environment map}
+ * will be initialized for the configuration of the
+ * running system:
+ * <blockquote>
+ * <tt>hostname</tt>, <tt>osName</tt>, <tt>osVersion</tt> and
+ * <tt>osArchitecture</tt>
+ * </blockquote>
+ * and the value of other keys may be empty.
+ */
+ public RegistrationData() {
+ this(Util.generateURN());
+ }
+
+ // package private
+ RegistrationData(String urn) {
+ this.urn = urn;
+ SystemEnvironment sysEnv = SystemEnvironment.getSystemEnvironment();
+ this.environment = initEnvironment(sysEnv);
+ this.cpuInfo = initCpuInfo(sysEnv);
+ this.svcTagMap = new LinkedHashMap<String, ServiceTag>();
+ }
+
+ private Map<String, String> initEnvironment(SystemEnvironment sysEnv) {
+ Map<String, String> map = new LinkedHashMap<String, String>();
+ map.put(ST_NODE_HOSTNAME, sysEnv.getHostname());
+ map.put(ST_NODE_HOST_ID, sysEnv.getHostId());
+ map.put(ST_NODE_OS_NAME, sysEnv.getOsName());
+ map.put(ST_NODE_OS_VERSION, sysEnv.getOsVersion());
+ map.put(ST_NODE_OS_ARCH, sysEnv.getOsArchitecture());
+ map.put(ST_NODE_SYSTEM_MODEL, sysEnv.getSystemModel());
+ map.put(ST_NODE_SYSTEM_MANUFACTURER, sysEnv.getSystemManufacturer());
+ map.put(ST_NODE_CPU_MANUFACTURER, sysEnv.getCpuManufacturer());
+ map.put(ST_NODE_SERIAL_NUMBER, sysEnv.getSerialNumber());
+ map.put(ST_NODE_PHYS_MEM, sysEnv.getPhysMem());
+ return map;
+ }
+
+ private Map<String, String> initCpuInfo(SystemEnvironment sysEnv) {
+ Map<String, String> map = new LinkedHashMap<String, String>();
+ map.put(ST_NODE_SOCKETS, sysEnv.getSockets());
+ map.put(ST_NODE_CORES, sysEnv.getCores());
+ map.put(ST_NODE_VIRT_CPUS, sysEnv.getVirtCpus());
+ map.put(ST_NODE_CPU_NAME, sysEnv.getCpuName());
+ map.put(ST_NODE_CLOCK_RATE, sysEnv.getClockRate());
+ return map;
+ }
+
+ /**
+ * Returns the uniform resource name of this registration data
+ * in this format:
+ * <tt>urn:st:&lt;32-char {@link java.util.UUID uuid}&gt;</tt>
+ *
+ * @return the URN of this registration data.
+ */
+ public String getRegistrationURN() {
+ return urn;
+ }
+
+ /**
+ * Returns a map containing the environment information for this
+ * registration data. See the set of <a href="#EnvMap">keys</a>
+ * in the environment map. Subsequent update to the environment
+ * map via the {@link #setEnvironment setEnvironment} method will not be reflected
+ * in the returned map.
+ *
+ * @return an environment map for this registration data.
+ */
+ public Map<String, String> getEnvironmentMap() {
+ return new LinkedHashMap<String,String>(environment);
+ }
+
+ /**
+ * Returns a map containing the cpu information for this
+ * registration data. Subsequent update to the cpu info
+ * map via the {@link #setCpuInfo setCpuInfo} method will not be reflected
+ * in the returned map.
+ *
+ * @return a cpu info map for this registration data.
+ */
+ public Map<String, String> getCpuInfoMap() {
+ return new LinkedHashMap<String,String>(cpuInfo);
+ }
+
+ /**
+ * Sets an element of the specified {@code name} in the environment map
+ * with the given {@code value}.
+ *
+ * @throws IllegalArgumentException if {@code name} is not a valid key
+ * in the environment map, or {@code value} is not valid.
+ */
+ public void setEnvironment(String name, String value) {
+ if (name == null) {
+ throw new NullPointerException("name is null");
+ }
+ if (value == null) {
+ throw new NullPointerException("value is null");
+ }
+ if (environment.containsKey(name)) {
+ if (name.equals(ST_NODE_HOSTNAME) || name.equals(ST_NODE_OS_NAME)) {
+ if (value.length() == 0) {
+ throw new IllegalArgumentException("\"" +
+ name + "\" requires non-empty value.");
+ }
+ }
+ environment.put(name, value);
+ } else {
+ throw new IllegalArgumentException("\"" +
+ name + "\" is not an environment element.");
+ }
+ }
+
+ /**
+ * Sets an element of the specified {@code name} in the cpu info map
+ * with the given {@code value}.
+ *
+ * @throws IllegalArgumentException if {@code name} is not a valid key
+ * in the cpu info map, or {@code value} is not valid.
+ */
+ public void setCpuInfo(String name, String value) {
+ if (name == null) {
+ throw new NullPointerException("name is null");
+ }
+ if (value == null) {
+ throw new NullPointerException("value is null");
+ }
+ if (cpuInfo.containsKey(name)) {
+ cpuInfo.put(name, value);
+ } else {
+ throw new IllegalArgumentException("\"" +
+ name + "\" is not an cpuinfo element.");
+ }
+ }
+
+ /**
+ * Returns all service tags in this registration data.
+ *
+ * @return a {@link Set Set} of the service tags
+ * in this registration data.
+ */
+ public Set<ServiceTag> getServiceTags() {
+ return new HashSet<ServiceTag>(svcTagMap.values());
+ }
+
+ /**
+ * Adds a service tag to this registration data.
+ * If the given service tag has an empty <tt>instance_urn</tt>,
+ * this method will generate a URN and place it in the copy
+ * of the service tag in this registration data.
+ * This method will return the {@code ServiceTag} object
+ * added to this registration data.
+ *
+ * @param st {@code ServiceTag} object to be added.
+ * @return a {@code ServiceTag} object added to this registration data.
+ *
+ * @throws IllegalArgumentException if
+ * a service tag of the same {@link ServiceTag#getInstanceURN
+ * <tt>instance_urn</tt>} already exists in the registry.
+ */
+ public synchronized ServiceTag addServiceTag(ServiceTag st) {
+ ServiceTag svcTag = ServiceTag.newInstanceWithUrnTimestamp(st);
+
+ String instanceURN = svcTag.getInstanceURN();
+ if (svcTagMap.containsKey(instanceURN)) {
+ throw new IllegalArgumentException("Instance_urn = " + instanceURN +
+ " already exists in the registration data.");
+ } else {
+ svcTagMap.put(instanceURN, svcTag);
+ }
+ return svcTag;
+ }
+
+ /**
+ * Returns a service tag of the given <tt>instance_urn</tt> in this registration
+ * data.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag
+ * @return the {@code ServiceTag} object of the given <tt>instance_urn</tt>
+ * if exists; otherwise return {@code null}.
+ */
+ public synchronized ServiceTag getServiceTag(String instanceURN) {
+ if (instanceURN == null) {
+ throw new NullPointerException("instanceURN is null");
+ }
+ return svcTagMap.get(instanceURN);
+ }
+
+ /**
+ * Removes a service tag of the given <tt>instance_urn</tt> from this
+ * registration data.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of
+ * the service tag to be removed.
+ *
+ * @return the removed {@code ServiceTag} object;
+ * or {@code null} if the service tag does not exist in this
+ * registration data.
+ */
+ public synchronized ServiceTag removeServiceTag(String instanceURN) {
+ if (instanceURN == null) {
+ throw new NullPointerException("instanceURN is null");
+ }
+
+ ServiceTag svcTag = null;
+ if (svcTagMap.containsKey(instanceURN)) {
+ svcTag = svcTagMap.remove(instanceURN);
+ }
+ return svcTag;
+ }
+
+ /**
+ * Updates the <tt>product_defined_instance_id</tt> in the service tag
+ * of the given <tt>instance_urn</tt> in this registration data.
+ *
+ * @param instanceURN the <tt>instance_urn</tt> of the service tag to be updated.
+ * @param productDefinedInstanceID the value of the
+ * <tt>product_defined_instance_id</tt> to be set.
+ *
+ * @return the updated {@code ServiceTag} object;
+ * or {@code null} if the service tag does not exist in this
+ * registration data.
+ */
+ public synchronized ServiceTag updateServiceTag(String instanceURN,
+ String productDefinedInstanceID) {
+ ServiceTag svcTag = getServiceTag(instanceURN);
+ if (svcTag == null) {
+ return null;
+ }
+
+ svcTag = ServiceTag.newInstanceWithUrnTimestamp(svcTag);
+ // update the product defined instance ID field
+ svcTag.setProductDefinedInstanceID(productDefinedInstanceID);
+ svcTagMap.put(instanceURN, svcTag);
+ return svcTag;
+ }
+
+ /**
+ * Reads the registration data from the XML document on the
+ * specified input stream. The XML document must be
+ * in the format described by the <a href="#XMLSchema">
+ * registration data schema</a>.
+ * The specified stream is closed after this method returns.
+ *
+ * @param in the input stream from which to read the XML document.
+ * @return a {@code RegistrationData} object read from the input
+ * stream.
+ *
+ * @throws IllegalArgumentException if the input stream
+ * contains an invalid registration data.
+ *
+ * @throws IOException if an error occurred when reading from the input stream.
+ */
+ public static RegistrationData loadFromXML(InputStream in) throws IOException {
+ try {
+ return RegistrationDocument.load(in);
+ } finally {
+ in.close();
+ }
+ }
+
+ /**
+ * Writes the registration data to the specified output stream
+ * in the format described by the <a href="#XMLSchema">
+ * registration data schema</a> with "UTF-8" encoding.
+ * The specified stream remains open after this method returns.
+ *
+ * @param os the output stream on which to write the XML document.
+ *
+ * @throws IOException if an error occurred when writing to the output stream.
+ */
+ public void storeToXML(OutputStream os) throws IOException {
+ RegistrationDocument.store(os, this);
+ os.flush();
+ }
+
+ /**
+ * Returns a newly allocated byte array containing the registration
+ * data in XML format.
+ *
+ * @return a newly allocated byte array containing the registration
+ * data in XML format.
+ */
+ public byte[] toXML() {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ storeToXML(out);
+ return out.toByteArray();
+ } catch (IOException e) {
+ // should not reach here
+ return new byte[0];
+ }
+ }
+
+ /**
+ * Returns a string representation of this registration data in XML
+ * format.
+ *
+ * @return a string representation of this registration data in XML
+ * format.
+ */
+ @Override
+ public String toString() {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ storeToXML(out);
+ return out.toString("UTF-8");
+ } catch (IOException e) {
+ // should not reach here
+ return "Error creating the return string.";
+ }
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java b/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java
index 240eebf4e65c..93a1f25a6c2f 100644
--- a/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java
+++ b/desktop/source/registration/com/sun/star/servicetag/RegistrationDocument.java
@@ -1,374 +1,440 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: RegistrationDocument.java,v $
- *
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package com.sun.star.servicetag;
-
-import java.io.*;
-import java.net.URL;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-import org.xml.sax.InputSource;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-// For write operation
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-/**
- * XML Support Class for Product Registration.
- */
-class RegistrationDocument {
-
- private static final String REGISTRATION_DATA_SCHEMA =
- "/com/sun/star/servicetag/resources/product_registration.xsd";
- private static final String REGISTRATION_DATA_VERSION = "1.0";
- private static final String SERVICE_TAG_VERSION = "1.0";
- final static String ST_NODE_REGISTRATION_DATA = "registration_data";
- final static String ST_ATTR_REGISTRATION_VERSION = "version";
- final static String ST_NODE_ENVIRONMENT = "environment";
- final static String ST_NODE_HOSTNAME = "hostname";
- final static String ST_NODE_HOST_ID = "hostId";
- final static String ST_NODE_OS_NAME = "osName";
- final static String ST_NODE_OS_VERSION = "osVersion";
- final static String ST_NODE_OS_ARCH = "osArchitecture";
- final static String ST_NODE_SYSTEM_MODEL = "systemModel";
- final static String ST_NODE_SYSTEM_MANUFACTURER = "systemManufacturer";
- final static String ST_NODE_CPU_MANUFACTURER = "cpuManufacturer";
- final static String ST_NODE_SERIAL_NUMBER = "serialNumber";
- final static String ST_NODE_REGISTRY = "registry";
- final static String ST_ATTR_REGISTRY_URN = "urn";
- final static String ST_ATTR_REGISTRY_VERSION = "version";
- final static String ST_NODE_SERVICE_TAG = "service_tag";
- final static String ST_NODE_INSTANCE_URN = "instance_urn";
- final static String ST_NODE_PRODUCT_NAME = "product_name";
- final static String ST_NODE_PRODUCT_VERSION = "product_version";
- final static String ST_NODE_PRODUCT_URN = "product_urn";
- final static String ST_NODE_PRODUCT_PARENT_URN = "product_parent_urn";
- final static String ST_NODE_PRODUCT_PARENT = "product_parent";
- final static String ST_NODE_PRODUCT_DEFINED_INST_ID = "product_defined_inst_id";
- final static String ST_NODE_PRODUCT_VENDOR = "product_vendor";
- final static String ST_NODE_PLATFORM_ARCH = "platform_arch";
- final static String ST_NODE_TIMESTAMP = "timestamp";
- final static String ST_NODE_CONTAINER = "container";
- final static String ST_NODE_SOURCE = "source";
- final static String ST_NODE_INSTALLER_UID = "installer_uid";
-
- static RegistrationData load(InputStream in) throws IOException {
- Document document = initializeDocument(in);
-
- // Gets the registration URN
- Element root = getRegistrationDataRoot(document);
- Element registryRoot =
- getSingletonElementFromRoot(root, ST_NODE_REGISTRY);
- String urn = registryRoot.getAttribute(ST_ATTR_REGISTRY_URN);
-
- // Construct a new RegistrationData object from the DOM tree
- // Initialize the environment map and service tags
- RegistrationData regData = new RegistrationData(urn);
- addServiceTags(registryRoot, regData);
-
- Element envRoot = getSingletonElementFromRoot(root, ST_NODE_ENVIRONMENT);
- buildEnvironmentMap(envRoot, regData);
- return regData;
- }
-
- static void store(OutputStream os, RegistrationData registration)
- throws IOException {
- // create a new document with the root node
- Document document = initializeDocument();
-
- // create the nodes for the environment map and the service tags
- // in the registration data
- addEnvironmentNodes(document,
- registration.getEnvironmentMap());
- addServiceTagRegistry(document,
- registration.getRegistrationURN(),
- registration.getServiceTags());
- transform(document, os);
- }
-
- // initialize a document from an input stream
- private static Document initializeDocument(InputStream in) throws IOException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- // XML schema for validation
- SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- URL xsdUrl = RegistrationDocument.class.getResource(REGISTRATION_DATA_SCHEMA);
- Schema schema = sf.newSchema(xsdUrl);
- Validator validator = schema.newValidator();
-
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(new InputSource(in));
- validator.validate(new DOMSource(doc));
- return doc;
- } catch (SAXException sxe) {
- IllegalArgumentException e = new IllegalArgumentException("Error generated in parsing");
- e.initCause(sxe);
- throw e;
- } catch (ParserConfigurationException pce) {
- // Parser with specific options can't be built
- // should not reach here
- InternalError x = new InternalError("Error in creating the new document");
- x.initCause(pce);
- throw x;
- }
- }
-
- // initialize a new document for the registration data
- private static Document initializeDocument() throws IOException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.newDocument();
-
- // initialize the document with the registration_data root
- Element root = doc.createElement(ST_NODE_REGISTRATION_DATA);
- doc.appendChild(root);
- root.setAttribute(ST_ATTR_REGISTRATION_VERSION, REGISTRATION_DATA_VERSION);
-
- return doc;
- } catch (ParserConfigurationException pce) {
- // Parser with specified options can't be built
- // should not reach here
- InternalError x = new InternalError("Error in creating the new document");
- x.initCause(pce);
- throw x;
- }
- }
-
- // Transform the current DOM tree with the given output stream.
- private static void transform(Document document, OutputStream os) {
- try {
- // Use a Transformer for output
- TransformerFactory tFactory = TransformerFactory.newInstance();
- tFactory.setAttribute("indent-number", new Integer(3));
-
- Transformer transformer = tFactory.newTransformer();
-
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
- transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
- transformer.transform(new DOMSource(document),
- new StreamResult(new BufferedWriter(new OutputStreamWriter(os, "UTF-8"))));
- } catch (UnsupportedEncodingException ue) {
- // Should not reach here
- InternalError x = new InternalError("Error generated during transformation");
- x.initCause(ue);
- throw x;
- } catch (TransformerConfigurationException tce) {
- // Error generated by the parser
- // Should not reach here
- InternalError x = new InternalError("Error in creating the new document");
- x.initCause(tce);
- throw x;
- } catch (TransformerException te) {
- // Error generated by the transformer
- InternalError x = new InternalError("Error generated during transformation");
- x.initCause(te);
- throw x;
- }
- }
-
- private static void addServiceTagRegistry(Document document,
- String registryURN,
- Set<ServiceTag> svcTags) {
- // add service tag registry node and its attributes
- Element reg = document.createElement(ST_NODE_REGISTRY);
- reg.setAttribute(ST_ATTR_REGISTRY_URN, registryURN);
- reg.setAttribute(ST_ATTR_REGISTRY_VERSION, SERVICE_TAG_VERSION);
-
- Element root = getRegistrationDataRoot(document);
- root.appendChild(reg);
-
- // adds the elements for the service tags
- for (ServiceTag st : svcTags) {
- addServiceTagElement(document, reg, st);
- }
- }
-
- private static void addServiceTagElement(Document document,
- Element registryRoot,
- ServiceTag st) {
- Element svcTag = document.createElement(ST_NODE_SERVICE_TAG);
- registryRoot.appendChild(svcTag);
- addChildElement(document, svcTag,
- ST_NODE_INSTANCE_URN, st.getInstanceURN());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_NAME, st.getProductName());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_VERSION, st.getProductVersion());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_URN, st.getProductURN());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_PARENT_URN, st.getProductParentURN());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_PARENT, st.getProductParent());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_DEFINED_INST_ID,
- st.getProductDefinedInstanceID());
- addChildElement(document, svcTag,
- ST_NODE_PRODUCT_VENDOR, st.getProductVendor());
- addChildElement(document, svcTag,
- ST_NODE_PLATFORM_ARCH, st.getPlatformArch());
- addChildElement(document, svcTag,
- ST_NODE_TIMESTAMP, Util.formatTimestamp(st.getTimestamp()));
- addChildElement(document, svcTag,
- ST_NODE_CONTAINER, st.getContainer());
- addChildElement(document, svcTag,
- ST_NODE_SOURCE, st.getSource());
- addChildElement(document, svcTag,
- ST_NODE_INSTALLER_UID,
- String.valueOf(st.getInstallerUID()));
- }
-
- private static void addChildElement(Document document, Element root,
- String element, String text) {
- Element node = document.createElement(element);
- node.appendChild(document.createTextNode(text));
- root.appendChild(node);
- }
-
- // Constructs service tags from the document
- private static void addServiceTags(Element registryRoot,
- RegistrationData registration) {
- NodeList children = registryRoot.getElementsByTagName(ST_NODE_SERVICE_TAG);
- int length = (children == null ? 0 : children.getLength());
- for (int i = 0; i < length; i++) {
- Element svcTagElement = (Element) children.item(i);
- ServiceTag st = getServiceTag(svcTagElement);
- registration.addServiceTag(st);
- }
- }
-
- // build environment map from the document
- private static void buildEnvironmentMap(Element envRoot,
- RegistrationData registration) {
- registration.setEnvironment(ST_NODE_HOSTNAME, getTextValue(envRoot, ST_NODE_HOSTNAME));
- registration.setEnvironment(ST_NODE_HOST_ID, getTextValue(envRoot, ST_NODE_HOST_ID));
- registration.setEnvironment(ST_NODE_OS_NAME, getTextValue(envRoot, ST_NODE_OS_NAME));
- registration.setEnvironment(ST_NODE_OS_VERSION, getTextValue(envRoot, ST_NODE_OS_VERSION));
- registration.setEnvironment(ST_NODE_OS_ARCH, getTextValue(envRoot, ST_NODE_OS_ARCH));
- registration.setEnvironment(ST_NODE_SYSTEM_MODEL, getTextValue(envRoot, ST_NODE_SYSTEM_MODEL));
- registration.setEnvironment(ST_NODE_SYSTEM_MANUFACTURER, getTextValue(envRoot, ST_NODE_SYSTEM_MANUFACTURER));
- registration.setEnvironment(ST_NODE_CPU_MANUFACTURER, getTextValue(envRoot, ST_NODE_CPU_MANUFACTURER));
- registration.setEnvironment(ST_NODE_SERIAL_NUMBER, getTextValue(envRoot, ST_NODE_SERIAL_NUMBER));
- }
-
- // add the nodes representing the environment map in the document
- private static void addEnvironmentNodes(Document document,
- Map<String, String> envMap) {
- Element root = getRegistrationDataRoot(document);
- Element env = document.createElement(ST_NODE_ENVIRONMENT);
- root.appendChild(env);
- Set<Map.Entry<String, String>> keys = envMap.entrySet();
- for (Map.Entry<String, String> entry : keys) {
- addChildElement(document, env, entry.getKey(), entry.getValue());
- }
- }
-
- private static Element getRegistrationDataRoot(Document doc) {
- Element root = doc.getDocumentElement();
- if (!root.getNodeName().equals(ST_NODE_REGISTRATION_DATA)) {
- throw new IllegalArgumentException("Not a " +
- ST_NODE_REGISTRATION_DATA +
- " node \"" + root.getNodeName() + "\"");
- }
- return root;
- }
-
- private static Element getSingletonElementFromRoot(Element root, String name) {
- NodeList children = root.getElementsByTagName(name);
- int length = (children == null ? 0 : children.getLength());
- if (length != 1) {
- throw new IllegalArgumentException("Invalid number of " + name +
- " nodes = " + length);
- }
- Element e = (Element) children.item(0);
- if (!e.getNodeName().equals(name)) {
- throw new IllegalArgumentException("Not a " + name +
- " node \"" + e.getNodeName() + "\"");
- }
- return e;
- }
-
- // Constructs one ServiceTag instance from a service tag element root
- private static ServiceTag getServiceTag(Element svcTagElement) {
- return new ServiceTag(
- getTextValue(svcTagElement, ST_NODE_INSTANCE_URN),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_NAME),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_VERSION),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_URN),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT_URN),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_DEFINED_INST_ID),
- getTextValue(svcTagElement, ST_NODE_PRODUCT_VENDOR),
- getTextValue(svcTagElement, ST_NODE_PLATFORM_ARCH),
- getTextValue(svcTagElement, ST_NODE_CONTAINER),
- getTextValue(svcTagElement, ST_NODE_SOURCE),
- Util.getIntValue(getTextValue(svcTagElement, ST_NODE_INSTALLER_UID)),
- Util.parseTimestamp(getTextValue(svcTagElement, ST_NODE_TIMESTAMP))
- );
- }
-
- private static String getTextValue(Element e, String tagName) {
- String value = "";
- NodeList nl = e.getElementsByTagName(tagName);
- if (nl != null && nl.getLength() > 0) {
- Element el = (Element) nl.item(0);
- Node node = el.getFirstChild();
- if (node != null) {
- value = node.getNodeValue();
- }
- }
- return value;
- }
-}
+
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.star.servicetag;
+
+import java.io.*;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.InputSource;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+// For write operation
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+/**
+ * XML Support Class for Product Registration.
+ */
+class RegistrationDocument {
+
+ private static final String REGISTRATION_DATA_SCHEMA =
+ "/com/sun/star/servicetag/resources/product_registration.xsd";
+ private static final String REGISTRATION_DATA_VERSION = "1.0";
+ private static final String SERVICE_TAG_VERSION = "1.0";
+ final static String ST_NODE_REGISTRATION_DATA = "registration_data";
+ final static String ST_ATTR_REGISTRATION_VERSION = "version";
+ final static String ST_NODE_ENVIRONMENT = "environment";
+ final static String ST_NODE_HOSTNAME = "hostname";
+ final static String ST_NODE_HOST_ID = "hostId";
+ final static String ST_NODE_OS_NAME = "osName";
+ final static String ST_NODE_OS_VERSION = "osVersion";
+ final static String ST_NODE_OS_ARCH = "osArchitecture";
+ final static String ST_NODE_SYSTEM_MODEL = "systemModel";
+ final static String ST_NODE_SYSTEM_MANUFACTURER = "systemManufacturer";
+ final static String ST_NODE_CPU_MANUFACTURER = "cpuManufacturer";
+ final static String ST_NODE_SERIAL_NUMBER = "serialNumber";
+ final static String ST_NODE_PHYS_MEM = "physmem";
+ final static String ST_NODE_CPU_INFO = "cpuinfo";
+ final static String ST_NODE_SOCKETS = "sockets";
+ final static String ST_NODE_CORES = "cores";
+ final static String ST_NODE_VIRT_CPUS = "virtcpus";
+ final static String ST_NODE_CPU_NAME = "name";
+ final static String ST_NODE_CLOCK_RATE = "clockrate";
+ final static String ST_NODE_REGISTRY = "registry";
+ final static String ST_ATTR_REGISTRY_URN = "urn";
+ final static String ST_ATTR_REGISTRY_VERSION = "version";
+ final static String ST_NODE_SERVICE_TAG = "service_tag";
+ final static String ST_NODE_INSTANCE_URN = "instance_urn";
+ final static String ST_NODE_PRODUCT_NAME = "product_name";
+ final static String ST_NODE_PRODUCT_VERSION = "product_version";
+ final static String ST_NODE_PRODUCT_URN = "product_urn";
+ final static String ST_NODE_PRODUCT_PARENT_URN = "product_parent_urn";
+ final static String ST_NODE_PRODUCT_PARENT = "product_parent";
+ final static String ST_NODE_PRODUCT_DEFINED_INST_ID = "product_defined_inst_id";
+ final static String ST_NODE_PRODUCT_VENDOR = "product_vendor";
+ final static String ST_NODE_PLATFORM_ARCH = "platform_arch";
+ final static String ST_NODE_TIMESTAMP = "timestamp";
+ final static String ST_NODE_CONTAINER = "container";
+ final static String ST_NODE_SOURCE = "source";
+ final static String ST_NODE_INSTALLER_UID = "installer_uid";
+
+ static RegistrationData load(InputStream in) throws IOException {
+ Document document = initializeDocument(in);
+
+ // Gets the registration URN
+ Element root = getRegistrationDataRoot(document);
+ Element registryRoot =
+ getSingletonElementFromRoot(root, ST_NODE_REGISTRY);
+ String urn = registryRoot.getAttribute(ST_ATTR_REGISTRY_URN);
+
+ // Construct a new RegistrationData object from the DOM tree
+ // Initialize the environment map and service tags
+ RegistrationData regData = new RegistrationData(urn);
+ addServiceTags(registryRoot, regData);
+
+ Element envRoot = getSingletonElementFromRoot(root, ST_NODE_ENVIRONMENT);
+ buildEnvironmentMap(envRoot, regData);
+
+ Element cpuInfo = getSingletonElementFromRoot(envRoot, ST_NODE_CPU_INFO);
+ buildCpuInfoMap(cpuInfo, regData);
+ return regData;
+ }
+
+ static void store(OutputStream os, RegistrationData registration)
+ throws IOException {
+ // create a new document with the root node
+ Document document = initializeDocument();
+
+ // create the nodes for the environment map and the service tags
+ // in the registration data
+ addEnvironmentNodes(document,
+ registration.getEnvironmentMap(),
+ registration.getCpuInfoMap());
+ addServiceTagRegistry(document,
+ registration.getRegistrationURN(),
+ registration.getServiceTags());
+ transform(document, os);
+ }
+
+ // initialize a document from an input stream
+ private static Document initializeDocument(InputStream in) throws IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ SchemaFactory sf = null;
+ try {
+ // Some Java versions (e.g., 1.5.0_06-b05) fail with a
+ // NullPointerException if SchemaFactory.newInstance is called with
+ // a null context class loader, so work around that here (and the
+ // class loader of this class hopefully is not the null bootstrap
+ // class loader):
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ if (cl == null) {
+ Thread.currentThread().setContextClassLoader(
+ RegistrationDocument.class.getClassLoader());
+ }
+ try {
+ sf = SchemaFactory.newInstance(
+ XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+
+ Schema schema = null;
+ try {
+ // Even using the workaround above is not enough on some
+ // Java versions. Therefore try to workaround the validation
+ // completely!
+ URL xsdUrl = RegistrationDocument.class.getResource(REGISTRATION_DATA_SCHEMA);
+ schema = sf.newSchema(xsdUrl);
+ }
+ catch (NullPointerException nex) {
+ }
+
+ Validator validator = null;
+ if (schema != null)
+ validator = schema.newValidator();
+
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(new InputSource(in));
+
+ if (validator != null)
+ validator.validate(new DOMSource(doc));
+
+ return doc;
+ } catch (SAXException sxe) {
+ IllegalArgumentException e = new IllegalArgumentException("Error generated in parsing");
+ e.initCause(sxe);
+ throw e;
+ } catch (ParserConfigurationException pce) {
+ // Parser with specific options can't be built
+ // should not reach here
+ InternalError x = new InternalError("Error in creating the new document");
+ x.initCause(pce);
+ throw x;
+ }
+ }
+
+ // initialize a new document for the registration data
+ private static Document initializeDocument() throws IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ try {
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.newDocument();
+
+ // initialize the document with the registration_data root
+ Element root = doc.createElement(ST_NODE_REGISTRATION_DATA);
+ doc.appendChild(root);
+ root.setAttribute(ST_ATTR_REGISTRATION_VERSION, REGISTRATION_DATA_VERSION);
+
+ return doc;
+ } catch (ParserConfigurationException pce) {
+ // Parser with specified options can't be built
+ // should not reach here
+ InternalError x = new InternalError("Error in creating the new document");
+ x.initCause(pce);
+ throw x;
+ }
+ }
+
+ // Transform the current DOM tree with the given output stream.
+ private static void transform(Document document, OutputStream os) {
+ try {
+ // Use a Transformer for output
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ tFactory.setAttribute("indent-number", new Integer(3));
+
+ Transformer transformer = tFactory.newTransformer();
+
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+ transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
+ transformer.transform(new DOMSource(document),
+ new StreamResult(new BufferedWriter(new OutputStreamWriter(os, "UTF-8"))));
+ } catch (UnsupportedEncodingException ue) {
+ // Should not reach here
+ InternalError x = new InternalError("Error generated during transformation");
+ x.initCause(ue);
+ throw x;
+ } catch (TransformerConfigurationException tce) {
+ // Error generated by the parser
+ // Should not reach here
+ InternalError x = new InternalError("Error in creating the new document");
+ x.initCause(tce);
+ throw x;
+ } catch (TransformerException te) {
+ // Error generated by the transformer
+ InternalError x = new InternalError("Error generated during transformation");
+ x.initCause(te);
+ throw x;
+ }
+ }
+
+ private static void addServiceTagRegistry(Document document,
+ String registryURN,
+ Set<ServiceTag> svcTags) {
+ // add service tag registry node and its attributes
+ Element reg = document.createElement(ST_NODE_REGISTRY);
+ reg.setAttribute(ST_ATTR_REGISTRY_URN, registryURN);
+ reg.setAttribute(ST_ATTR_REGISTRY_VERSION, SERVICE_TAG_VERSION);
+
+ Element root = getRegistrationDataRoot(document);
+ root.appendChild(reg);
+
+ // adds the elements for the service tags
+ for (ServiceTag st : svcTags) {
+ addServiceTagElement(document, reg, st);
+ }
+ }
+
+ private static void addServiceTagElement(Document document,
+ Element registryRoot,
+ ServiceTag st) {
+ Element svcTag = document.createElement(ST_NODE_SERVICE_TAG);
+ registryRoot.appendChild(svcTag);
+ addChildElement(document, svcTag,
+ ST_NODE_INSTANCE_URN, st.getInstanceURN());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_NAME, st.getProductName());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_VERSION, st.getProductVersion());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_URN, st.getProductURN());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_PARENT_URN, st.getProductParentURN());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_PARENT, st.getProductParent());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_DEFINED_INST_ID,
+ st.getProductDefinedInstanceID());
+ addChildElement(document, svcTag,
+ ST_NODE_PRODUCT_VENDOR, st.getProductVendor());
+ addChildElement(document, svcTag,
+ ST_NODE_PLATFORM_ARCH, st.getPlatformArch());
+ addChildElement(document, svcTag,
+ ST_NODE_TIMESTAMP, Util.formatTimestamp(st.getTimestamp()));
+ addChildElement(document, svcTag,
+ ST_NODE_CONTAINER, st.getContainer());
+ addChildElement(document, svcTag,
+ ST_NODE_SOURCE, st.getSource());
+ addChildElement(document, svcTag,
+ ST_NODE_INSTALLER_UID,
+ String.valueOf(st.getInstallerUID()));
+ }
+
+ private static void addChildElement(Document document, Element root,
+ String element, String text) {
+ Element node = document.createElement(element);
+ node.appendChild(document.createTextNode(text));
+ root.appendChild(node);
+ }
+
+ // Constructs service tags from the document
+ private static void addServiceTags(Element registryRoot,
+ RegistrationData registration) {
+ NodeList children = registryRoot.getElementsByTagName(ST_NODE_SERVICE_TAG);
+ int length = (children == null ? 0 : children.getLength());
+ for (int i = 0; i < length; i++) {
+ Element svcTagElement = (Element) children.item(i);
+ ServiceTag st = getServiceTag(svcTagElement);
+ registration.addServiceTag(st);
+ }
+ }
+
+ // build environment map from the document
+ private static void buildEnvironmentMap(Element envRoot,
+ RegistrationData registration) {
+ registration.setEnvironment(ST_NODE_HOSTNAME, getTextValue(envRoot, ST_NODE_HOSTNAME));
+ registration.setEnvironment(ST_NODE_HOST_ID, getTextValue(envRoot, ST_NODE_HOST_ID));
+ registration.setEnvironment(ST_NODE_OS_NAME, getTextValue(envRoot, ST_NODE_OS_NAME));
+ registration.setEnvironment(ST_NODE_OS_VERSION, getTextValue(envRoot, ST_NODE_OS_VERSION));
+ registration.setEnvironment(ST_NODE_OS_ARCH, getTextValue(envRoot, ST_NODE_OS_ARCH));
+ registration.setEnvironment(ST_NODE_SYSTEM_MODEL, getTextValue(envRoot, ST_NODE_SYSTEM_MODEL));
+ registration.setEnvironment(ST_NODE_SYSTEM_MANUFACTURER, getTextValue(envRoot, ST_NODE_SYSTEM_MANUFACTURER));
+ registration.setEnvironment(ST_NODE_CPU_MANUFACTURER, getTextValue(envRoot, ST_NODE_CPU_MANUFACTURER));
+ registration.setEnvironment(ST_NODE_SERIAL_NUMBER, getTextValue(envRoot, ST_NODE_SERIAL_NUMBER));
+ registration.setEnvironment(ST_NODE_PHYS_MEM, getTextValue(envRoot, ST_NODE_PHYS_MEM));
+ }
+
+ private static void buildCpuInfoMap(Element cpuInfoRoot,
+ RegistrationData registration) {
+ registration.setCpuInfo(ST_NODE_SOCKETS, getTextValue(cpuInfoRoot, ST_NODE_SOCKETS));
+ registration.setCpuInfo(ST_NODE_CORES, getTextValue(cpuInfoRoot, ST_NODE_CORES));
+ registration.setCpuInfo(ST_NODE_VIRT_CPUS, getTextValue(cpuInfoRoot, ST_NODE_VIRT_CPUS));
+ registration.setCpuInfo(ST_NODE_CPU_NAME, getTextValue(cpuInfoRoot, ST_NODE_CPU_NAME));
+ registration.setCpuInfo(ST_NODE_CLOCK_RATE, getTextValue(cpuInfoRoot, ST_NODE_CLOCK_RATE));
+ }
+
+ // add the nodes representing the environment map in the document
+ private static void addEnvironmentNodes(Document document,
+ Map<String, String> envMap,
+ Map<String, String> cpuInfoMap) {
+ Element root = getRegistrationDataRoot(document);
+
+ Element env = document.createElement(ST_NODE_ENVIRONMENT);
+ root.appendChild(env);
+ Set<Map.Entry<String, String>> keys = envMap.entrySet();
+ for (Map.Entry<String, String> entry : keys) {
+ addChildElement(document, env, entry.getKey(), entry.getValue());
+ }
+
+ Element cpuInfo = document.createElement(ST_NODE_CPU_INFO);
+ env.appendChild(cpuInfo);
+ keys = cpuInfoMap.entrySet();
+ for (Map.Entry<String, String> entry : keys) {
+ addChildElement(document, cpuInfo, entry.getKey(), entry.getValue());
+ }
+ }
+
+ private static Element getRegistrationDataRoot(Document doc) {
+ Element root = doc.getDocumentElement();
+ if (!root.getNodeName().equals(ST_NODE_REGISTRATION_DATA)) {
+ throw new IllegalArgumentException("Not a " +
+ ST_NODE_REGISTRATION_DATA +
+ " node \"" + root.getNodeName() + "\"");
+ }
+ return root;
+ }
+
+ private static Element getSingletonElementFromRoot(Element root, String name) {
+ NodeList children = root.getElementsByTagName(name);
+ int length = (children == null ? 0 : children.getLength());
+ if (length != 1) {
+ throw new IllegalArgumentException("Invalid number of " + name +
+ " nodes = " + length);
+ }
+ Element e = (Element) children.item(0);
+ if (!e.getNodeName().equals(name)) {
+ throw new IllegalArgumentException("Not a " + name +
+ " node \"" + e.getNodeName() + "\"");
+ }
+ return e;
+ }
+
+ // Constructs one ServiceTag instance from a service tag element root
+ private static ServiceTag getServiceTag(Element svcTagElement) {
+ return new ServiceTag(
+ getTextValue(svcTagElement, ST_NODE_INSTANCE_URN),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_NAME),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_VERSION),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_URN),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_PARENT_URN),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_DEFINED_INST_ID),
+ getTextValue(svcTagElement, ST_NODE_PRODUCT_VENDOR),
+ getTextValue(svcTagElement, ST_NODE_PLATFORM_ARCH),
+ getTextValue(svcTagElement, ST_NODE_CONTAINER),
+ getTextValue(svcTagElement, ST_NODE_SOURCE),
+ Util.getIntValue(getTextValue(svcTagElement, ST_NODE_INSTALLER_UID)),
+ Util.parseTimestamp(getTextValue(svcTagElement, ST_NODE_TIMESTAMP))
+ );
+ }
+
+ private static String getTextValue(Element e, String tagName) {
+ String value = "";
+ NodeList nl = e.getElementsByTagName(tagName);
+ if (nl != null && nl.getLength() > 0) {
+ Element el = (Element) nl.item(0);
+ Node node = el.getFirstChild();
+ if (node != null) {
+ value = node.getNodeValue();
+ }
+ }
+ return value;
+ }
+}
diff --git a/desktop/source/registration/com/sun/star/servicetag/Registry.java b/desktop/source/registration/com/sun/star/servicetag/Registry.java
index c118dc2e2575..81e4ed41142d 100644
--- a/desktop/source/registration/com/sun/star/servicetag/Registry.java
+++ b/desktop/source/registration/com/sun/star/servicetag/Registry.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: Registry.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java b/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java
index 4b2be9ff8cc2..73e83b172008 100644
--- a/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java
+++ b/desktop/source/registration/com/sun/star/servicetag/ServiceTag.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ServiceTag.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java b/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java
index 245b993b086e..8d38e70f8b7e 100644
--- a/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java
+++ b/desktop/source/registration/com/sun/star/servicetag/SolarisServiceTag.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SolarisServiceTag.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java
index 1ce5f5697bcb..684b8224d2af 100644
--- a/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java
+++ b/desktop/source/registration/com/sun/star/servicetag/SolarisSystemEnvironment.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SolarisSystemEnvironment.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -40,17 +39,180 @@ package com.sun.star.servicetag;
// (e.g. NetBeans and SunStudio) will use the version in JDK.
import java.io.*;
+import java.util.Set;
+import java.util.HashSet;
/**
* Solaris implementation of the SystemEnvironment class.
*/
class SolarisSystemEnvironment extends SystemEnvironment {
+ private static final int SN = 1;
+ private static final int SYS = 2;
+ private static final int CPU = 3;
+ private static final int MODEL = 4;
+ private String kstatCpuInfo = null;
+
SolarisSystemEnvironment() {
setHostId(getCommandOutput("/usr/bin/hostid"));
- setSystemModel(getCommandOutput("/usr/bin/uname", "-i"));
+ setSystemModel(getSolarisModel());
setSystemManufacturer(getSolarisSystemManufacturer());
setCpuManufacturer(getSolarisCpuManufacturer());
setSerialNumber(getSolarisSN());
+ setPhysMem(getSolarisPhysMem());
+ setSockets(getSolarisSockets());
+ setCores(getSolarisCores());
+ setVirtCpus(getSolarisVirtCpus());
+ setCpuName(getSolarisCpuName());
+ setClockRate(getSolarisClockRate());
+ }
+
+ private String getSolarisClockRate() {
+ String data = getSolarisKstatCpuInfo();
+
+ String lines[] = data.split("\n");
+ String token = "clock_MHz";
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ if (line.startsWith(token)) {
+ return line.substring(line.indexOf(token) + token.length()).trim();
+ }
+ }
+ return "";
+ }
+
+ private String getSolarisCpuName() {
+ String data = getSolarisKstatCpuInfo();
+
+ String lines[] = data.split("\n");
+ String token = "brand";
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ if (line.startsWith(token)) {
+ return line.substring(line.indexOf(token) + token.length()).trim();
+ }
+ }
+ return "";
+ }
+
+ private String getSolarisVirtCpus() {
+ String data = getSolarisKstatCpuInfo();
+
+ int cnt = 0;
+ String lines[] = data.split("\n");
+ String token = " cpu_info ";
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ if (line.indexOf(token) != -1) {
+ cnt++;
+ }
+ }
+ return "" + cnt;
+ }
+
+ private String getSolarisCores() {
+ String data = getSolarisKstatCpuInfo();
+
+ Set<String> set = new HashSet<String>();
+ String lines[] = data.split("\n");
+ String coreIdToken = "core_id";
+ String coreId = "";
+ String chipIdToken = "chip_id";
+ String chipId = "";
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ if (line.startsWith(chipIdToken)) {
+ chipId = line.substring(line.indexOf(chipIdToken) + chipIdToken.length()).trim();
+ }
+ if (line.startsWith(coreIdToken)) {
+ coreId = line.substring(line.indexOf(coreIdToken) + coreIdToken.length()).trim();
+ set.add(chipId + "," + coreId);
+ }
+ }
+ return "" + set.size();
+ }
+
+ private String getSolarisPhysMem() {
+ String data = getCommandOutput("/usr/sbin/prtconf");
+
+ int cnt = 0;
+ String lines[] = data.split("\n");
+ String token = "Memory size:";
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ if (line.startsWith(token)) {
+ line = line.substring(line.indexOf(token) + token.length()).trim();
+ if (line.indexOf(" ") != -1) {
+ return line.substring(0, line.indexOf(" ")).trim();
+ }
+ }
+ }
+ return "";
+ }
+
+ private String getSolarisSockets() {
+ String data = getSolarisKstatCpuInfo();
+
+ Set<String> set = new HashSet<String>();
+ String lines[] = data.split("\n");
+ String token = "chip_id";
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ if (line.startsWith(token)) {
+ String id = line.substring(line.indexOf(token) + token.length()).trim();
+ set.add(id);
+ }
+ }
+ return "" + set.size();
+ }
+
+ private synchronized String getSolarisKstatCpuInfo() {
+ // only try to get kstat cpu_info information once, after that, we can
+ // reuse the output
+ if (kstatCpuInfo == null) {
+ Thread thread = new Thread() {
+ public void run() {
+ kstatCpuInfo = getCommandOutput("/usr/bin/kstat", "cpu_info");
+ }
+ };
+ thread.start();
+
+ try {
+ thread.join(2000);
+ if (thread.isAlive()) {
+ thread.interrupt();
+ kstatCpuInfo = "";
+ }
+ } catch (InterruptedException ie) {
+ thread.interrupt();
+ }
+ }
+ return kstatCpuInfo;
+ }
+
+ private String getSolarisModel() {
+ String tmp = getFileContent("/var/run/psn");
+ if (tmp.length() > 0) {
+ String[] lines = tmp.split("\n");
+ if (MODEL <= lines.length) {
+ return lines[MODEL-1] + "::"
+ + getCommandOutput("/usr/bin/uname", "-v");
+ }
+ }
+
+ if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
+ return getCommandOutput("/usr/bin/uname", "-i") + "::"
+ + getCommandOutput("/usr/bin/uname", "-v");
+ } else {
+ String model = getSmbiosData("1", "Product: ");
+ if (model == null || model.trim().equals("")) {
+ model = getCommandOutput("/usr/bin/uname", "-i");
+ }
+ if (model == null) {
+ model = "";
+ }
+ return model.trim() + "::"
+ + getCommandOutput("/usr/bin/uname", "-v");
+ }
}
/**
@@ -58,13 +220,21 @@ class SolarisSystemEnvironment extends SystemEnvironment {
* @return The cpu manufacturer (an empty string if not found or an error occurred)
*/
private String getSolarisCpuManufacturer() {
+ String tmp = getFileContent("/var/run/psn");
+ if (tmp.length() > 0) {
+ String[] lines = tmp.split("\n");
+ if (CPU <= lines.length) {
+ return lines[CPU-1];
+ }
+ }
+
// not fully accurate, this could be another manufacturer (fujitsu for example)
if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
return "Sun Microsystems, Inc";
}
- // if we're here, then we'll try smbios (type 3)
- return getSmbiosData("3", "Manufacturer: ");
+ // if we're here, then we'll try smbios (type 4)
+ return getSmbiosData("4", "Manufacturer: ");
}
/**
@@ -72,8 +242,19 @@ class SolarisSystemEnvironment extends SystemEnvironment {
* @return The system manufacturer (an empty string if not found or an error occurred)
*/
private String getSolarisSystemManufacturer() {
+ String tmp = getFileContent("/var/run/psn");
+ if (tmp.length() > 0) {
+ String[] lines = tmp.split("\n");
+ if (SYS <= lines.length) {
+ return lines[SYS-1];
+ }
+ }
+
// not fully accurate, this could be another manufacturer (fujitsu for example)
if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
+ if (getCommandOutput("/usr/bin/uname", "-m").equals("sun4us")) {
+ return "Fujitsu";
+ }
return "Sun Microsystems, Inc";
}
@@ -89,7 +270,10 @@ class SolarisSystemEnvironment extends SystemEnvironment {
// try to read from the psn file if it exists
String tmp = getFileContent("/var/run/psn");
if (tmp.length() > 0) {
- return tmp.trim();
+ String[] lines = tmp.split("\n");
+ if (SN <= lines.length) {
+ return lines[SN-1];
+ }
}
// if we're here, then we'll try sneep
@@ -110,6 +294,17 @@ class SolarisSystemEnvironment extends SystemEnvironment {
return tmpSN;
}
+ if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
+ tmpSN = getSNViaPrtfruX();
+ if (tmpSN.length() > 0) {
+ return tmpSN;
+ }
+ tmpSN = getSNViaPrtfru();
+ if (tmpSN.length() > 0) {
+ return tmpSN;
+ }
+ }
+
// give up and return
return "";
}
@@ -156,4 +351,74 @@ class SolarisSystemEnvironment extends SystemEnvironment {
}
}
+ private String getSNViaPrtfruX() {
+ String data = getCommandOutput("/usr/sbin/prtfru", "-x");
+
+ boolean FRUTREE_FLAG = false;
+ boolean FRUNAME_FLAG = false;
+ boolean MB_LABEL_FLAG = false;
+ boolean SYSTEM_BOARD_FLAG = false;
+
+ String lines[] = data.split("\n");
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i];
+ if (SYSTEM_BOARD_FLAG) {
+ String tok = "<Sun_Serial_No value=\"";
+ int index = line.indexOf(tok);
+ if (index != -1) {
+ String val = line.substring(index+tok.length());
+ String vals[] = val.split("\"");
+ if (vals.length > 0) {
+ return vals[0].trim();
+ }
+ break;
+ }
+ }
+
+ if (line.indexOf("</ContainerData>") != -1) {
+ FRUTREE_FLAG = false;
+ FRUNAME_FLAG = false;
+ SYSTEM_BOARD_FLAG = false;
+ }
+
+ if (FRUNAME_FLAG && line.indexOf("<Container name=\"system-board\">") != -1 ) {
+ SYSTEM_BOARD_FLAG = true;
+ }
+
+ if (FRUTREE_FLAG && line.indexOf("<Fru name=\"chassis\">") != -1 ) {
+ FRUNAME_FLAG = true;
+ }
+
+ if (line.indexOf("<Location name=\"frutree\">") != -1) {
+ FRUTREE_FLAG = true;
+ }
+ }
+
+ return "";
+ }
+
+ private String getSNViaPrtfru() {
+ String data = getCommandOutput("/usr/sbin/prtfru");
+ boolean CHASSIS_FLAG = false;
+
+ String lines[] = data.split("\n");
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i];
+ if (CHASSIS_FLAG) {
+ String tok = "/ManR/Sun_Serial_No:";
+ int index = line.indexOf(tok);
+ if (index != -1) {
+ String val = line.substring(index+tok.length());
+ return val.trim();
+ }
+ }
+
+ if (line.indexOf("/frutree/chassis/system-board (container)") != -1) {
+ CHASSIS_FLAG = true;
+ } else if (line.indexOf("/frutree/chassis/MB?Label=MB/system-board (container)") != -1) {
+ CHASSIS_FLAG = true;
+ }
+ }
+ return "";
+ }
}
diff --git a/desktop/source/registration/com/sun/star/servicetag/SunConnection.java b/desktop/source/registration/com/sun/star/servicetag/SunConnection.java
index 4a3d2ee9722f..417489410148 100644
--- a/desktop/source/registration/com/sun/star/servicetag/SunConnection.java
+++ b/desktop/source/registration/com/sun/star/servicetag/SunConnection.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SunConnection.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java b/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java
index d50104e827ed..0af25ec35d58 100644
--- a/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java
+++ b/desktop/source/registration/com/sun/star/servicetag/SysnetRegistryHelper.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SysnetRegistryHelper.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java
index e5b9e0e3b4fe..4628034723e1 100644
--- a/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java
+++ b/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: SystemEnvironment.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -57,6 +56,12 @@ public class SystemEnvironment {
private String systemManufacturer;
private String cpuManufacturer;
private String serialNumber;
+ private String physmem;
+ private String sockets;
+ private String cores;
+ private String virtcpus;
+ private String cpuname;
+ private String clockrate;
private static SystemEnvironment sysEnv = null;
public static synchronized SystemEnvironment getSystemEnvironment() {
@@ -90,6 +95,12 @@ public class SystemEnvironment {
this.systemManufacturer = "";
this.cpuManufacturer = "";
this.serialNumber = "";
+ this.physmem = "";
+ this.sockets = "";
+ this.cores = "";
+ this.virtcpus = "";
+ this.cpuname = "";
+ this.clockrate = "";
}
@@ -158,6 +169,56 @@ public class SystemEnvironment {
}
/**
+ * Sets the physmem
+ * @param physmem The physmem to set.
+ */
+ public void setPhysMem(String physmem) {
+ this.physmem = physmem;
+ }
+
+ /**
+ * Sets the sockets
+ * @param sockets The sockets to set.
+ */
+ public void setSockets(String sockets) {
+ this.sockets = sockets;
+ }
+
+ /**
+ * Sets the cores
+ * @param cores The cores to set.
+ */
+ public void setCores(String cores) {
+ this.cores = cores;
+ }
+
+ /**
+ * Sets the virtcpus
+ * @param virtcpus The virtcpus to set.
+ */
+ public void setVirtCpus(String virtcpus) {
+ this.virtcpus = virtcpus;
+ }
+
+ /**
+ * Sets the cpuname
+ * @param cpuname The cpuname to set.
+ */
+ public void setCpuName(String cpuname) {
+ this.cpuname = cpuname;
+ }
+
+ /**
+ * Sets the clockrate
+ * @param clockrate The clockrate to set.
+ */
+ public void setClockRate(String clockrate) {
+ Float f = Float.parseFloat(clockrate);
+ Integer nClockrate = f.intValue();
+ this.clockrate = nClockrate.toString();
+ }
+
+ /**
* Sets the hostid. Truncates to a max length of 16 chars.
* @param hostId The hostid to set.
*/
@@ -227,6 +288,30 @@ public class SystemEnvironment {
return serialNumber;
}
+ public String getPhysMem() {
+ return physmem;
+ }
+
+ public String getSockets() {
+ return sockets;
+ }
+
+ public String getCores() {
+ return cores;
+ }
+
+ public String getVirtCpus() {
+ return virtcpus;
+ }
+
+ public String getCpuName() {
+ return cpuname;
+ }
+
+ public String getClockRate() {
+ return clockrate;
+ }
+
/**
* Returns the hostId.
* @return The hostId.
diff --git a/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java b/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
index 785cb35777ae..fe2762fc560b 100644
--- a/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
+++ b/desktop/source/registration/com/sun/star/servicetag/UnauthorizedAccessException.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: UnauthorizedAccessException.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
diff --git a/desktop/source/registration/com/sun/star/servicetag/Util.java b/desktop/source/registration/com/sun/star/servicetag/Util.java
index 55fa097297e6..3e9ad224ba97 100644
--- a/desktop/source/registration/com/sun/star/servicetag/Util.java
+++ b/desktop/source/registration/com/sun/star/servicetag/Util.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: Util.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -40,7 +39,7 @@ import java.util.UUID;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-// Utility class for com.sun.star.servicetag package
+// Utility class for com.sun.servicetag package
class Util {
private static boolean verbose = (System.getProperty("servicetag.verbose") != null);
private static String jrepath = null;
diff --git a/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java
index cdc374f4a993..6d78357074fb 100644
--- a/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java
+++ b/desktop/source/registration/com/sun/star/servicetag/WindowsSystemEnvironment.java
@@ -6,9 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: WindowsSystemEnvironment.java,v $
- *
- * $Revision: 1.2 $
+ * $RCSfile: Registration.java,v $
+ * $Revision: 1.3 $
*
* This file is part of OpenOffice.org.
*
@@ -33,7 +32,7 @@ package com.sun.star.servicetag;
// The Service Tags team maintains the latest version of the implementation
// for system environment data collection. JDK will include a copy of
-// the most recent released version for a JDK release. We rename
+// the most recent released version for a JDK release. We rename
// the package to com.sun.servicetag so that the Sun Connection
// product always uses the latest version from the com.sun.scn.servicetags
// package. JDK and users of the com.sun.servicetag API
@@ -42,6 +41,8 @@ package com.sun.star.servicetag;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
/**
* Windows implementation of the SystemEnvironment class.
@@ -71,6 +72,13 @@ class WindowsSystemEnvironment extends SystemEnvironment {
}
setCpuManufacturer(cpuMfr);
+ setSockets(getWindowsSockets());
+ setCores(getWindowsCores());
+ setVirtCpus(getWindowsVirtCpus());
+ setPhysMem(getWindowsPhysMem());
+ setCpuName(getWmicResult("cpu", "get", "Name"));
+ setClockRate(getWmicResult("cpu", "get", "MaxClockSpeed"));
+
// try to remove the temp file that gets created from running wmic cmds
try {
// look in the current working directory
@@ -83,6 +91,44 @@ class WindowsSystemEnvironment extends SystemEnvironment {
}
}
+ private String getWindowsVirtCpus() {
+ String res = getWmicResult("cpu", "get", "NumberOfLogicalProcessors");
+ if (res == null || res.equals("")) {
+ res = "1";
+ }
+ return res;
+ }
+
+ private String getWindowsCores() {
+ String res = getWmicResult("cpu", "get", "NumberOfCores");
+ if (res == null || res.equals("")) {
+ res = "1";
+ }
+ return res;
+ }
+
+ private String getWindowsSockets() {
+ String res = getFullWmicResult("cpu", "get", "DeviceID");
+ Set<String> set = new HashSet<String>();
+ for (String line : res.split("\n")) {
+ line = line.trim();
+ if (line.equals("")) {
+ continue;
+ }
+ set.add(line);
+ }
+ if (set.size() == 0) {
+ return "1";
+ }
+ return "" + set.size();
+ }
+
+ private String getWindowsPhysMem() {
+ String mem = getWmicResult("computersystem", "get", "TotalPhysicalMemory");
+ long l = Long.parseLong(mem);
+ return "" + ((long) (l / (1024*1024)));
+ }
+
/**
* This method invokes wmic outside of the normal environment
@@ -142,4 +188,48 @@ class WindowsSystemEnvironment extends SystemEnvironment {
}
return res.trim();
}
+
+ private String getFullWmicResult(String alias, String verb, String property) {
+ String res = "";
+ BufferedReader in = null;
+ try {
+ ProcessBuilder pb = new ProcessBuilder("cmd", "/C", "WMIC", alias, verb, property);
+ Process p = pb.start();
+ // need this for executing windows commands (at least
+ // needed for executing wmic command)
+ BufferedWriter bw = new BufferedWriter(
+ new OutputStreamWriter(p.getOutputStream()));
+ bw.write(13);
+ bw.flush();
+ bw.close();
+
+ p.waitFor();
+ if (p.exitValue() == 0) {
+ in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line = null;
+ while ((line = in.readLine()) != null) {
+ line = line.trim();
+ if (line.length() == 0) {
+ continue;
+ }
+ if (line.toLowerCase().indexOf(property.toLowerCase()) != -1) {
+ continue;
+ }
+ res += line + "\n";
+ }
+ }
+
+ } catch (Exception e) {
+ // ignore the exception
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ return res;
+ }
}
diff --git a/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd b/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd
index e9b34417d9ae..bb48ba90844d 100644
--- a/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd
+++ b/desktop/source/registration/com/sun/star/servicetag/resources/product_registration.xsd
@@ -1,301 +1,366 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
-<xs:element name="registration_data">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="environment"
- minOccurs="1"
- maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="hostname"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="hostId"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="osName"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="osVersion"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="osArchitecture"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="systemModel"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="systemManufacturer"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="cpuManufacturer"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="serialNumber"
- minOccurs='1'
- maxOccurs='1'/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="registry"
- minOccurs="1"
- maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="service_tag"
- minOccurs="0"
- maxOccurs="1024">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="instance_urn"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_name"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_version"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_urn"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_parent_urn"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_parent"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_defined_inst_id"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="product_vendor"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="platform_arch"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="timestamp"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="container"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="source"
- minOccurs='1'
- maxOccurs='1'/>
- <xs:element ref="installer_uid"
- minOccurs='1'
- maxOccurs='1'/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="urn"
- type="xs:string"
- use="required"/>
- <xs:attribute name="version"
- type="xs:string"
- use="required"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="version"
- type="xs:string"
- use="required"/>
- </xs:complexType>
-</xs:element>
-
- <!-- definition of simple elements -->
- <xs:element name="hostname">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="hostId">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="16"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="osName">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="256"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="osVersion">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="50"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="osArchitecture">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="256"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="systemModel">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="50"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="systemManufacturer">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="50"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="cpuManufacturer">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="50"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="serialNumber">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="256"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="instance_urn">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_name">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_version">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:maxLength value="63"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_urn">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_parent_urn">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_parent">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_defined_inst_id">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="0"/>
- <xs:maxLength value="255"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="product_vendor">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="63"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="platform_arch">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:minLength value="1"/>
- <xs:maxLength value="63"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="timestamp">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:maxLength value="24"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="container">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:maxLength value="63"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="source">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:maxLength value="63"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element name="installer_uid">
- <xs:simpleType>
- <xs:restriction base="xs:integer">
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+<xs:element name="registration_data">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="environment"
+ minOccurs="1"
+ maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="hostname"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="hostId"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="osName"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="osVersion"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="osArchitecture"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="systemModel"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="systemManufacturer"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="cpuManufacturer"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="serialNumber"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="physmem"
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:element name="cpuinfo"
+ minOccurs='0'
+ maxOccurs='1'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="sockets"
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:element ref="cores"
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:element ref="virtcpus"
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:element ref="name"
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:element ref="clockrate"
+ minOccurs='0'
+ maxOccurs='1'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="registry"
+ minOccurs="1"
+ maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="service_tag"
+ minOccurs="0"
+ maxOccurs="1024">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="instance_urn"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_name"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_version"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_urn"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_parent_urn"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_parent"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_defined_inst_id"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="product_vendor"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="platform_arch"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="timestamp"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="container"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="source"
+ minOccurs='1'
+ maxOccurs='1'/>
+ <xs:element ref="installer_uid"
+ minOccurs='1'
+ maxOccurs='1'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="urn"
+ type="xs:string"
+ use="required"/>
+ <xs:attribute name="version"
+ type="xs:string"
+ use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="version"
+ type="xs:string"
+ use="required"/>
+ </xs:complexType>
+</xs:element>
+
+ <!-- definition of simple elements -->
+ <xs:element name="hostname">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="hostId">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="16"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="osName">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="osVersion">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="osArchitecture">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="systemModel">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="systemManufacturer">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="cpuManufacturer">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="50"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="serialNumber">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="instance_urn">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_name">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_version">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_urn">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_parent_urn">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_parent">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_defined_inst_id">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="255"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="product_vendor">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="platform_arch">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="0"/>
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="timestamp">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="24"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="container">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="source">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="63"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="installer_uid">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer">
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="physmem">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer"/>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="sockets">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer"/>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="cores">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer"/>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="virtcpus">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer"/>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="name">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="128"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="clockrate">
+ <xs:simpleType>
+ <xs:restriction base="xs:integer"/>
+ </xs:simpleType>
+ </xs:element>
+
+</xs:schema>
diff --git a/desktop/util/makefile.mk b/desktop/util/makefile.mk
index 05f129b3c5fc..82cad8c095ad 100644
--- a/desktop/util/makefile.mk
+++ b/desktop/util/makefile.mk
@@ -79,6 +79,7 @@ RESLIB1SRSFILES= $(SRS)$/desktop.srs \
$(SRS)$/wizard.srs
.IF "$(L10N_framework)"==""
+.IF "$(LINK_SO)"=="TRUE"
.IF "$(GUI)" != "OS2"
APP1TARGET=so$/$(TARGET)
APP1NOSAL=TRUE
@@ -119,12 +120,6 @@ APP1STDLIBS = \
$(VOSLIB)
-.IF "$(GUI)" == "UNX"
-.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD"
-APP1STDLIBS+= -lXext
-.ENDIF
-.ENDIF
-
APP1DEPN= $(APP1RES) verinfo.rc
.IF "$(GUI)" == "WNT"
@@ -143,6 +138,8 @@ APP1STACK=10000000
.ENDIF # "$(GUI)" != "OS2"
+.ENDIF # "$(LINK_SO)"=="TRUE"
+
APP5TARGET=soffice
APP5NOSAL=TRUE
APP5RPATH=BRAND
@@ -206,6 +203,7 @@ APP5LINKRES=$(MISC)$/ooffice.res
.ENDIF # OS2
.IF "$(GUI)" == "WNT"
+.IF "$(LINK_SO)"=="TRUE"
APP6TARGET=so$/officeloader
APP6RES=$(RES)$/soloader.res
APP6NOSAL=TRUE
@@ -218,6 +216,7 @@ APP6OBJS = \
$(OBJ)$/officeloader.obj \
$(SOLARLIBDIR)$/pathutils-obj.obj
STDLIB6=$(ADVAPI32LIB) $(SHELL32LIB) $(SHLWAPILIB)
+.ENDIF # "$(LINK_SO)"=="TRUE"
APP7TARGET=officeloader
APP7RES=$(RES)$/ooloader.res
@@ -265,7 +264,9 @@ $(APP6TARGETN) : $(MISC)$/binso_created.flg
ALLTAR: $(MISC)$/$(TARGET).exe.manifest
ALLTAR: $(MISC)$/$(TARGET).bin.manifest
ALLTAR: $(BIN)$/$(TARGET).bin
+.IF "$(LINK_SO)"=="TRUE"
ALLTAR: $(BIN)$/so$/$(TARGET).bin
+.ENDIF # "$(LINK_SO)"=="TRUE"
.ENDIF # WNT
.IF "$(GUI)" == "OS2"
@@ -276,23 +277,29 @@ $(BIN)$/soffice_oo$(EXECPOST) : $(APP5TARGETN)
$(COPY) $< $@
.IF "$(GUI)" != "OS2"
+.IF "$(LINK_SO)"=="TRUE"
$(BIN)$/so$/soffice_so$(EXECPOST) : $(APP1TARGETN)
$(COPY) $< $@
-ALLTAR : $(BIN)$/so$/soffice_so$(EXECPOST) $(BIN)$/soffice_oo$(EXECPOST)
-
+ALLTAR : $(BIN)$/so$/soffice_so$(EXECPOST)
+.ENDIF # "$(LINK_SO)"=="TRUE"
+ALLTAR : $(BIN)$/soffice_oo$(EXECPOST)
.ENDIF
.IF "$(OS)" == "MACOSX"
+.IF "$(LINK_SO)"=="TRUE"
$(BIN)$/so$/soffice_mac$(EXECPOST) : $(APP1TARGETN)
$(COPY) $< $@
+ALLTAR : $(BIN)$/so$/soffice_mac$(EXECPOST)
+.ENDIF # "$(LINK_SO)"=="TRUE"
+
$(BIN)$/soffice_mac$(EXECPOST) : $(APP5TARGETN)
$(COPY) $< $@
-ALLTAR : $(BIN)$/so$/soffice_mac$(EXECPOST) $(BIN)$/soffice_mac$(EXECPOST)
+ALLTAR : $(BIN)$/soffice_mac$(EXECPOST)
-.ENDIF
+.ENDIF # "$(OS)" == "MACOSX"
.IF "$(GUI)" == "WNT"
diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc
index 8f1840afbed9..105933ff130d 100644
--- a/desktop/util/verinfo.rc
+++ b/desktop/util/verinfo.rc
@@ -101,42 +101,42 @@ VS_VERSION_INFO versioninfo
}
}
-2 ICON "icons\\so9_writer_doc.ico"
-3 ICON "icons\\so9_writer_tem.ico"
-4 ICON "icons\\so9_calc_doc.ico"
-5 ICON "icons\\so9_calc_tem.ico"
-6 ICON "icons\\so9_draw_doc.ico"
-7 ICON "icons\\so9_draw_tem.ico"
-8 ICON "icons\\so9_impress_doc.ico"
-9 ICON "icons\\so9_impress_tem.ico"
-10 ICON "icons\\so9_impress_doc.ico"
-11 ICON "icons\\so9_global_doc.ico"
-12 ICON "icons\\so9_html_doc.ico"
-13 ICON "icons\\so9_chart_doc.ico"
-14 ICON "icons\\so9_base_doc.ico"
-15 ICON "icons\\so9_math_doc.ico"
-16 ICON "icons\\so9_empty_tem.ico"
-17 ICON "icons\\so9_macro_doc.ico"
+2 ICON "icons\\oasis-text.ico"
+3 ICON "icons\\oasis-text-template.ico"
+4 ICON "icons\\oasis-spreadsheet.ico"
+5 ICON "icons\\oasis-spreadsheet-template.ico"
+6 ICON "icons\\oasis-drawing.ico"
+7 ICON "icons\\oasis-drawing-template.ico"
+8 ICON "icons\\oasis-presentation.ico"
+9 ICON "icons\\oasis-presentation-template.ico"
+10 ICON "icons\\oasis-presentation-template.ico"
+11 ICON "icons\\oasis-master-document.ico"
+12 ICON "icons\\oasis-web-template.ico"
+13 ICON "icons\\oasis-empty-document.ico"
+14 ICON "icons\\oasis-database.ico"
+15 ICON "icons\\oasis-formula.ico"
+16 ICON "icons\\empty-template.ico"
+17 ICON "icons\\empty-document.ico"
18 ICON "icons\\so8-configuration.ico"
19 ICON "icons\\so8-open.ico"
-20 ICON "icons\\so8-image-doc.ico"
+20 ICON "icons\\empty-document.ico"
21 ICON "icons\\so9_writer_app.ico"
22 ICON "icons\\so9_calc_app.ico"
23 ICON "icons\\so9_draw_app.ico"
24 ICON "icons\\so9_impress_app.ico"
25 ICON "icons\\so9_math_app.ico"
26 ICON "icons\\so9_base_app.ico"
-27 ICON "icons\\so9_empty_doc.ico"
-28 ICON "icons\\so7-writer-doc.ico"
-29 ICON "icons\\so7-writer-tem.ico"
-30 ICON "icons\\so7-calc-doc.ico"
-31 ICON "icons\\so7-calc-tem.ico"
-32 ICON "icons\\so7-draw-doc.ico"
-33 ICON "icons\\so7-draw-tem.ico"
-34 ICON "icons\\so7-impress-doc.ico"
-35 ICON "icons\\so7-impress-tem.ico"
-36 ICON "icons\\so7-master-doc.ico"
-37 ICON "icons\\so7-chart-doc.ico"
-38 ICON "icons\\so7-base-doc.ico"
-39 ICON "icons\\so7-math-doc.ico"
+27 ICON "icons\\oasis-empty-document.ico"
+28 ICON "icons\\text.ico"
+29 ICON "icons\\text-template.ico"
+30 ICON "icons\\spreadsheet.ico"
+31 ICON "icons\\spreadsheet-template.ico"
+32 ICON "icons\\drawing.ico"
+33 ICON "icons\\drawing-template.ico"
+34 ICON "icons\\presentation.ico"
+35 ICON "icons\\presentation-template.ico"
+36 ICON "icons\\master-document.ico"
+37 ICON "icons\\empty-document.ico"
+38 ICON "icons\\database.ico"
+39 ICON "icons\\formula.ico"
40 ICON "icons\\oxt-extension.ico"
diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp
index fb29c13d3a1c..c51dcd105bfd 100644
--- a/desktop/win32/source/setup/setup.cpp
+++ b/desktop/win32/source/setup/setup.cpp
@@ -76,6 +76,7 @@
#define PARAM_PATCH TEXT( " /update " )
#define PARAM_REG_ALL_MSO_TYPES TEXT( "REGISTER_ALL_MSO_TYPES=1 " )
#define PARAM_REG_NO_MSO_TYPES TEXT( "REGISTER_NO_MSO_TYPES=1 " )
+#define PARAM_SILENTINSTALL TEXT( " /QB" )
#define PARAM_RUNNING TEXT( "ignore_running" )
#define CMDLN_REG_ALL_MSO_TYPES TEXT( "msoreg=1" )
@@ -85,6 +86,11 @@
#define ADVAPI32_DLL TEXT( "advapi32.dll" )
#define PROFILE_NAME TEXT( "setup.ini" )
+#define RUNTIME_X64_NAME TEXT( "redist\\vcredist_x64.exe" )
+#define RUNTIME_X86_NAME TEXT( "redist\\vcredist_x86.exe" )
+#define PRODUCTCODE_X86 TEXT( "{E503B4BF-F7BB-3D5F-8BC8-F694B1CFF942}" )
+#define PRODUCTCODE_X64 TEXT( "{350AA351-21FA-3270-8B7A-835434E766AD}" )
+
#define MSIAPI_DllGetVersion "DllGetVersion"
#define ADVAPI32API_CheckTokenMembership "CheckTokenMembership"
@@ -1897,6 +1903,114 @@ boolean SetupAppX::IsPatchInstalled( TCHAR* pBaseDir, TCHAR* pFileName )
}
//--------------------------------------------------------------------------
+boolean SetupAppX::InstallRuntimes( TCHAR *sProductCode, TCHAR *sRuntimePath )
+{
+ INSTALLSTATE nRet = MsiQueryProductState( sProductCode );
+ OutputDebugStringFormat( TEXT( "MsiQueryProductState returned <%d>\r\n" ), nRet );
+ if ( nRet == INSTALLSTATE_DEFAULT )
+ return true;
+
+ Log( TEXT( " Will install runtime <%s>\r\n" ), sRuntimePath );
+ OutputDebugStringFormat( TEXT( " Will install runtime <%s>\r\n" ), sRuntimePath );
+
+ STARTUPINFO aSUI;
+ PROCESS_INFORMATION aPI;
+
+ ZeroMemory( (void*)&aPI, sizeof( PROCESS_INFORMATION ) );
+ ZeroMemory( (void*)&aSUI, sizeof( STARTUPINFO ) );
+
+ aSUI.cb = sizeof(STARTUPINFO);
+ aSUI.dwFlags = STARTF_USESHOWWINDOW;
+ aSUI.wShowWindow = SW_SHOW;
+
+ DWORD nCmdLineLength = lstrlen( sRuntimePath ) + lstrlen( PARAM_SILENTINSTALL ) + 2;
+ TCHAR *sCmdLine = new TCHAR[ nCmdLineLength ];
+
+ if ( FAILED( StringCchCopy( sCmdLine, nCmdLineLength, sRuntimePath ) ) ||
+ FAILED( StringCchCat( sCmdLine, nCmdLineLength, PARAM_SILENTINSTALL ) ) )
+ {
+ delete [] sCmdLine;
+ SetError( ERROR_INSTALL_FAILURE );
+ return false;
+ }
+
+ if ( !WIN::CreateProcess( NULL, sCmdLine, NULL, NULL, FALSE,
+ CREATE_DEFAULT_ERROR_MODE, NULL, NULL,
+ &aSUI, &aPI ) )
+ {
+ Log( TEXT( "ERROR: Could not create process %s.\r\n" ), sCmdLine );
+ SetError( WIN::GetLastError() );
+ delete [] sCmdLine;
+ return false;
+ }
+
+ DWORD nResult = WaitForProcess( aPI.hProcess );
+ bool bRet = true;
+
+ if( ERROR_SUCCESS != nResult )
+ {
+ Log( TEXT( "ERROR: While waiting for %s.\r\n" ), sCmdLine );
+ SetError( nResult );
+ bRet = false;
+ }
+ else
+ {
+ GetExitCodeProcess( aPI.hProcess, &nResult );
+ SetError( nResult );
+
+ if ( nResult != ERROR_SUCCESS )
+ {
+ TCHAR sBuf[80];
+ StringCchPrintf( sBuf, 80, TEXT("Warning: install runtime returned %u.\r\n"), nResult );
+ Log( sBuf );
+ }
+ else
+ Log( TEXT( " Installation of runtime completed successfully.\r\n" ) );
+ }
+
+ CloseHandle( aPI.hProcess );
+
+ delete [] sCmdLine;
+
+ return bRet;
+}
+
+//--------------------------------------------------------------------------
+boolean SetupAppX::InstallRuntimes()
+{
+ TCHAR *sRuntimePath = 0;
+ SYSTEM_INFO siSysInfo;
+
+ GetNativeSystemInfo(&siSysInfo);
+
+ OutputDebugStringFormat( TEXT( "found architecture<%d>\r\n" ), siSysInfo.wProcessorArchitecture );
+
+ if ( siSysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 )
+ {
+ if ( GetPathToFile( RUNTIME_X64_NAME, &sRuntimePath ) )
+ InstallRuntimes( PRODUCTCODE_X64, sRuntimePath );
+ else
+ Log( TEXT( "ERROR: no installer for x64 runtime libraries found!" ) );
+
+ if ( sRuntimePath )
+ {
+ delete [] sRuntimePath;
+ sRuntimePath = 0;
+ }
+ }
+
+ if ( GetPathToFile( RUNTIME_X86_NAME, &sRuntimePath ) )
+ InstallRuntimes( PRODUCTCODE_X86, sRuntimePath );
+ else
+ Log( TEXT( "ERROR: no installer for x86 runtime libraries found!" ) );
+
+ if ( sRuntimePath )
+ delete [] sRuntimePath;
+
+ return true;
+}
+
+//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
LanguageDataX::LanguageDataX( LPTSTR pData )
{
diff --git a/desktop/win32/source/setup/setup.hxx b/desktop/win32/source/setup/setup.hxx
index 72785cc75b31..169254db87ab 100644
--- a/desktop/win32/source/setup/setup.hxx
+++ b/desktop/win32/source/setup/setup.hxx
@@ -119,12 +119,13 @@ private:
LPTSTR *pNext, boolean bStripQuotes = false );
boolean IsAdmin();
-
boolean GetCommandLine();
boolean IsTerminalServerInstalled() const;
void AddFileToPatchList( TCHAR* pPath, TCHAR* pFile );
boolean IsPatchInstalled( TCHAR* pBaseDir, TCHAR* pFileName );
+ boolean InstallRuntimes( TCHAR* pProductCode, TCHAR* pFileName );
+
public:
SetupAppX();
~SetupAppX();
@@ -136,6 +137,7 @@ public:
virtual boolean ChooseLanguage( long& rLanguage );
virtual boolean CheckVersion();
virtual boolean CheckForUpgrade();
+ virtual boolean InstallRuntimes();
virtual boolean Install( long nLanguage );
virtual UINT GetError() const;
diff --git a/desktop/win32/source/setup/setup_main.cxx b/desktop/win32/source/setup/setup_main.cxx
index 515363749c55..6c96bde46b12 100644
--- a/desktop/win32/source/setup/setup_main.cxx
+++ b/desktop/win32/source/setup/setup_main.cxx
@@ -124,6 +124,9 @@ extern "C" int __stdcall WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, int )
if ( ! pSetup->ChooseLanguage( nLanguage ) )
throw pSetup->GetError();
+ if ( ! pSetup->InstallRuntimes() )
+ throw pSetup->GetError();
+
if ( ! pSetup->Install( nLanguage ) )
throw pSetup->GetError();
}
diff --git a/desktop/win32/source/setup/setup_main.hxx b/desktop/win32/source/setup/setup_main.hxx
index 67b54adc0d2a..28200fcae757 100644
--- a/desktop/win32/source/setup/setup_main.hxx
+++ b/desktop/win32/source/setup/setup_main.hxx
@@ -53,6 +53,7 @@ public:
virtual boolean ChooseLanguage( long& rLanguage ) = 0;
virtual boolean CheckVersion() = 0;
virtual boolean CheckForUpgrade() = 0;
+ virtual boolean InstallRuntimes() = 0;
virtual boolean Install( long nLanguage ) = 0;
virtual UINT GetError() const = 0;
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
index 4e316232bd81..376e1d626927 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
@@ -36,7 +36,7 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
-#include <vcl/bitmap.hxx>
+#include <vcl/bitmapex.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -56,7 +56,7 @@ namespace drawinglayer
{
class FillBitmapAttribute
{
- Bitmap maBitmap;
+ BitmapEx maBitmapEx;
basegfx::B2DPoint maTopLeft;
basegfx::B2DVector maSize;
@@ -64,11 +64,15 @@ namespace drawinglayer
unsigned mbTiling : 1;
public:
- FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling);
+ FillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft,
+ const basegfx::B2DVector& rSize,
+ bool bTiling);
bool operator==(const FillBitmapAttribute& rCandidate) const;
// data access
- const Bitmap& getBitmap() const { return maBitmap; }
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
const basegfx::B2DVector& getSize() const { return maSize; }
bool getTiling() const { return mbTiling; }
diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
new file mode 100644
index 000000000000..d8eed659f5e7
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: strokeattribute.hxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+
+#include <sal/config.h>
+#include <sal/types.h>
+#include <tools/string.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ /** FontAttribute class
+
+ This attribute class is able to hold all parameters needed/used
+ to completely define the parametrisation of a text portion.
+ */
+ class FontAttribute
+ {
+ private:
+ /// core data
+ String maFamilyName; // Font Family Name
+ String maStyleName; // Font Style Name
+ sal_uInt16 mnWeight; // Font weight
+
+ /// bitfield
+ unsigned mbSymbol : 1; // Symbol Font Flag
+ unsigned mbVertical : 1; // Vertical Text Flag
+ unsigned mbItalic : 1; // Italic Flag
+ unsigned mbOutline : 1; // Outline Flag
+ unsigned mbRTL : 1; // RTL Flag
+ unsigned mbBiDiStrong : 1; // BiDi Flag
+ // TODO: pair kerning and CJK kerning
+
+ public:
+ /// constructor
+ FontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol = false,
+ bool bVertical = false,
+ bool bItalic = false,
+ bool bOutline = false,
+ bool bRTL = false,
+ bool bBiDiStrong = false)
+ : maFamilyName(rFamilyName),
+ maStyleName(rStyleName),
+ mnWeight(nWeight),
+ mbSymbol(bSymbol),
+ mbVertical(bVertical),
+ mbItalic(bItalic),
+ mbOutline(bOutline),
+ mbRTL(bRTL),
+ mbBiDiStrong(bBiDiStrong)
+ {
+ }
+
+ FontAttribute()
+ : maFamilyName(),
+ maStyleName(),
+ mnWeight(0),
+ mbSymbol(false),
+ mbVertical(false),
+ mbItalic(false),
+ mbOutline(false),
+ mbRTL(false),
+ mbBiDiStrong(false)
+ {
+ }
+
+ /// compare operator
+ bool operator==(const FontAttribute& rCompare) const;
+
+ /// data read access
+ const String& getFamilyName() const { return maFamilyName; }
+ const String& getStyleName() const { return maStyleName; }
+ sal_uInt16 getWeight() const { return mnWeight; }
+ bool getSymbol() const { return mbSymbol; }
+ bool getVertical() const { return mbVertical; }
+ bool getItalic() const { return mbItalic; }
+ bool getOutline() const { return mbOutline; }
+ bool getRTL() const { return mbRTL; }
+ bool getBiDiStrong() const { return mbBiDiStrong; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
index 94a5623a2a77..0a87b268c8b1 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
@@ -149,6 +149,13 @@ namespace drawinglayer
/// On-demand prepared Viewport in discrete units for convenience
const basegfx::B2DRange& getDiscreteViewport() const;
+ /** support reduced DisplayQuality, PropertyName is 'ReducedDisplayQuality'. This
+ is used e.g. to allow to lower display quality for OverlayPrimitives and
+ may lead to simpler decompositions in the local create2DDecomposition
+ implementations of the primitives
+ */
+ bool getReducedDisplayQuality() const;
+
/** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
Use this call if You need to extract all contained ViewInformation. The ones
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
index 6fdf3200543c..10288b70bd1b 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
@@ -44,23 +44,52 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AlphaPrimitive2D class
+
+ This is the basic primitive for applying freely defined transparence
+ to freely defined content. The basic idea is to associate a content
+ which is defined as a sequence of primitives and hold as child content
+ in the GroupPrimitive2D with an alpha channel also defined as a sequence
+ of primitives and hold in the Alpha member.
+
+ The basic definition is to use the Alpha content as Alpha-Mask by
+ interpreting the Alpha-content not as RGB, but as Luminance alpha mask
+ using the common RGB_to_luminance definition as e.g. used by VCL.
+
+ The defining geometry is the Range of the child primitive sequence,
+ this means the renderers will/shall use this geometric information for
+ rendering, not the alpha one. The alpha one should/will be clipped
+ accordingly.
+ */
class AlphaPrimitive2D : public GroupPrimitive2D
{
private:
- Primitive2DSequence maAlpha; // transparence sequence
+ /// The Alpha-Mask who's RGB-Values are interpreted as Luminance
+ Primitive2DSequence maAlpha;
public:
+ /** constructor
+
+ @param rChildren
+ The content which is defined to have a transparency. The
+ range of this primitive is defined by this content
+
+ @param rAlpha
+ The definition of the Alpha-channel for this primitive. It
+ will be interpreted as mask by interpreting as gray values
+ using the common RGB_to_luminance definitions
+ */
AlphaPrimitive2D(
const Primitive2DSequence& rChildren,
const Primitive2DSequence& rAlpha);
- // get data
+ /// data read access
const Primitive2DSequence& getAlpha() const { return maAlpha; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
index 41ae18b30fc9..cd6133dc54d8 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
@@ -38,6 +38,7 @@
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -51,50 +52,59 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AnimatedSwitchPrimitive2D class
+
+ This is the basic class for simple, animated primitives. The basic idea
+ is to have an animation definition (AnimationEntry) who's basic
+ functionality is to return a state value for any given animation time in
+ the range of [0.0 .. 1.0]. Depending on the state, the decomposition
+ calculates an index, which of the members of the child vector is to
+ be visualized.
+
+ An example: For blinking, the Child vector should exist of two entries;
+ for values of [0.0 .. 0.5] the first, else the last entry will be used.
+ This mechanism is not limited to two entries, though.
+ */
class AnimatedSwitchPrimitive2D : public GroupPrimitive2D
{
private:
- // the animation definition which allows translation of a point in time
- // to an animation state [0.0 .. 1.0]. This member contains a cloned
- // definition and is owned by this implementation
+ /**
+ The animation definition which allows translation of a point in time
+ to an animation state [0.0 .. 1.0]. This member contains a cloned
+ definition and is owned by this implementation.
+ */
animation::AnimationEntry* mpAnimationEntry;
- // the last remembered decompose time, created and used by getDecomposition() for
- // buffering purposes
- double mfDecomposeViewTime;
-
- // bitfield
- // flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate
- // between both types if they are on/off
+ /// bitfield
+ /** flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate
+ between both types if they are on/off
+ */
unsigned mbIsTextAnimation : 1;
- protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
AnimatedSwitchPrimitive2D(
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation);
+
+ /// destructor - needed due to mpAnimationEntry
virtual ~AnimatedSwitchPrimitive2D();
- // get data
+ /// data read access
const animation::AnimationEntry& getAnimationEntry() const { return *mpAnimationEntry; }
bool isTextAnimation() const { return mbIsTextAnimation; }
bool isGraphicAnimation() const { return !isTextAnimation(); }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
- virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
-
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // The getDecomposition is overloaded here since the decompose is dependent of the point in time,
- // so the default implementation is nut useful here, it needs to be handled locally
+ /** The getDecomposition is overloaded here since the decompose is dependent of the point in time,
+ so the default implementation is nut useful here, it needs to be handled locally
+ */
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
@@ -106,84 +116,63 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** AnimatedBlinkPrimitive2D class
+
+ Basically the same mechanism as in AnimatedSwitchPrimitive2D, but the
+ decomposition is specialized in delivering the children in the
+ range [0.0.. 0.5] and an empty sequence else
+ */
class AnimatedBlinkPrimitive2D : public AnimatedSwitchPrimitive2D
{
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
AnimatedBlinkPrimitive2D(
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation);
- // provide unique ID
+ /// create local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-// helper class for AnimatedInterpolatePrimitive2D
namespace drawinglayer
{
namespace primitive2d
{
- class BufferedMatrixDecompose
- {
- private:
- // the matrix itself
- basegfx::B2DHomMatrix maB2DHomMatrix;
-
- // the decomposition
- basegfx::B2DVector maScale;
- basegfx::B2DVector maTranslate;
- double mfRotate;
- double mfShearX;
-
- // flag if already decomposed, used by ensureDecompose()
- bool mbDecomposed;
+ /** AnimatedInterpolatePrimitive2D class
- public:
- BufferedMatrixDecompose(const basegfx::B2DHomMatrix& rMatrix);
- void ensureDecompose() const;
-
- // data access
- const basegfx::B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; }
- const basegfx::B2DVector& getScale() const { return maScale; }
- const basegfx::B2DVector& getTranslate() const { return maTranslate; }
- double getRotate() const { return mfRotate; }
- double getShearX() const { return mfShearX; }
- };
- } // end of anonymous namespace
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
+ Specialized on multi-step animations based on matrix transformations. The
+ Child sequelce will be embedded in a matrix transformation. That transformation
+ will be linearly combined from the decomposed values and the animation value
+ to allow a smooth animation.
+ */
class AnimatedInterpolatePrimitive2D : public AnimatedSwitchPrimitive2D
{
private:
- // the transformations
- std::vector< BufferedMatrixDecompose > maMatrixStack;
+ /// the transformations
+ std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose > maMatrixStack;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
AnimatedInterpolatePrimitive2D(
const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack,
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation);
- // provide unique ID
+ /// create local decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
index 65977cfd4241..85cf5e236d4f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
@@ -46,35 +46,48 @@ namespace drawinglayer
{
namespace primitive2d
{
- class BackgroundColorPrimitive2D : public BasePrimitive2D
+ /** BackgroundColorPrimitive2D class
+
+ This primitive is defined to fill the whole visible Viewport with
+ the given color (and thus decomposes to a filled polygon). This
+ makes it a view-depnendent primitive by definition. It only has
+ a valid decomposition if a valid Viewport is given in the
+ ViewInformation2D at decomposition time.
+
+ It will try to buffer it's last decomposition using maLastViewport
+ to detect changes in the get2DDecomposition call.
+ */
+ class BackgroundColorPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the fill color to use
basegfx::BColor maBColor;
- // the last used viewInformation, used from getDecomposition for buffering
+ /// the last used viewInformation, used from getDecomposition for buffering
basegfx::B2DRange maLastViewport;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
BackgroundColorPrimitive2D(
const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get 2d range
+ /// get B2Drange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
index b05c60394ecd..6cf45ffefe54 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -43,16 +43,17 @@
#include <basegfx/range/b2drange.hxx>
//////////////////////////////////////////////////////////////////////////////
-// defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock
-// Added to be able to simply change identification stuff later, e.g. add
-// a identification string and/or ID to the interface and to the implementation
-// ATM used to delclare implement getPrimitiveID()
+/** defines for DeclPrimitrive2DIDBlock and ImplPrimitrive2DIDBlock
+ Added to be able to simply change identification stuff later, e.g. add
+ a identification string and/or ID to the interface and to the implementation
+ ATM used to delclare implement getPrimitive2DID()
+*/
#define DeclPrimitrive2DIDBlock() \
- virtual sal_uInt32 getPrimitiveID() const;
+ virtual sal_uInt32 getPrimitive2DID() const;
#define ImplPrimitrive2DIDBlock(TheClass, TheID) \
- sal_uInt32 TheClass::getPrimitiveID() const { return TheID; }
+ sal_uInt32 TheClass::getPrimitive2DID() const { return TheID; }
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -61,6 +62,13 @@ namespace drawinglayer { namespace geometry {
class ViewInformation2D;
}}
+namespace drawinglayer { namespace primitive2d {
+ /// typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference;
+ typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
+}}
+
//////////////////////////////////////////////////////////////////////////////
// basePrimitive2D class
@@ -68,101 +76,222 @@ namespace drawinglayer
{
namespace primitive2d
{
- // typedefs for basePrimitive2DImplBase, Primitive2DSequence and Primitive2DReference
- typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive2D > BasePrimitive2DImplBase;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > Primitive2DReference;
- typedef ::com::sun::star::uno::Sequence< Primitive2DReference > Primitive2DSequence;
-
- // base class for all C++ implementations of com::sun::star::graphic::XPrimitive2D. This class
- // is strongly virtual due to the lack of getPrimitiveID() implementation. This is by purpose, this
- // base class shall not be incarnated and be used directly as a XPrimitive2D.
+ /** BasePrimitive2D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ This class is strongly virtual due to the lack of getPrimitiveID() implementation.
+ This is by purpose, this base class shall not be incarnated and be used directly as
+ a XPrimitive2D.
+
+ Is is derived from boost::noncopyable to make clear that a primitive is a read-only
+ instance and copying or changing values is not intended. The idea is to hold all data
+ needed for visualisation of this primitive in unchangeable form.
+
+ It is derived from comphelper::OBaseMutex to have a Mutex at hand; in a base
+ implementation this may not be needed, but e.g. when buffering at last decomposition
+ in a local member, multiple threads may try to decompose at the same time, so locking
+ is needed to avoid race conditions seen from the UNO object implementation.
+
+ A method to get a simplified representation is provided by get2DDecomposition. The
+ default implementation returns an empty sequence. The idea is that processors
+ using this primitive and do not know it, may get the decomposition and process
+ these instead. An example is e.g. a fat line, who's decomposition may contain
+ the geometric representation of that line using filled polygon prmimitives. When
+ the renderer knows how to handle fat lines, he may proccess this primitive directly;
+ if not he can use the decomposition. With this functionality, renderers may operate by
+ knowing only a small set of primitives.
+
+ When a primitive does not implement get2DDecomposition, it is called a 'Basic Primitive' and
+ belongs to the set of primitives which a processor should be able to handle. Practice
+ will define this minimal sets of primitives. When defined and the concept is prooved,
+ unique UNO APIs may be defined/implemented for these set to allow more intense work
+ with primitives using UNO.
+
+ Current Basic 2D Primitives are:
+
+ - BitmapPrimitive2D (bitmap data, evtl. with alpha)
+ - MetafilePrimitive2D (VCL Metafile, currently no decomposition, but planned, so may vanish)
+ - PointArrayPrimitive2D (single points)
+ - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ - PolyPolygonColorPrimitive2D (colored polygons)
+
+ All other implemented primitives have a defined decomposition and can thus be
+ decomposed downt to this small set.
+
+ A renderer implementing support for this minimal set of primitives can completely
+ render primitive-based visualisations. Of course, he also has to take states into account
+ which are representated by GroupPrimitive2D derivations, see groupprimitive2d.hxx
+
+ To support getting the geometric BoundRect, getB2DRange is used. The default
+ implementation will use the get2DDecomposition result and merge a range from the
+ entries. Thus, an implementation is only necessary for the Basic Primitives, but
+ of course speedups are possible (and are used) by implementing the method at higher-level
+ primitives.
+
+ For primitive identification, getPrimitiveID is used currently in this implementations
+ to allow a fast switch/case processing. This needs a unique identifier mechanism which
+ currently uses defines (see drawinglayer_primitivetypes2d.hxx). For UNO prmitive API
+ it will be needed to add a unique descriptor (Name?) later to the API.
+
+ This base implementation provides mappings from the methods from XPrimitive2D
+ (getDecomposition/getRange) to the appropriate methods in the C++ implementations
+ (get2DDecomposition/getB2DRange). The PropertyValue ViewParameters is converted to
+ the appropriate C++ implementation class ViewInformation2D.
+
+ This base class does not implement any buffering; e.g. buffering the decompositon
+ and/or the range. These may be buffered anytime since the definition is that the primitive
+ is read-only and thus unchangeable. This implies that the decomposition and/or getting
+ the range will lead to the same result as last time, under the precondition that
+ the parameter ViewInformation2D is the same as the last one. This is usually the case
+ for view-independent primitives which are defined by not using ViewInformation2D
+ in their get2DDecomposition/getB2DRange implementations.
+ */
class BasePrimitive2D
: private boost::noncopyable,
protected comphelper::OBaseMutex,
public BasePrimitive2DImplBase
{
private:
- // a sequence used for buffering the last createLocalDecomposition() result. Use
- // the protected access methods to change. Only implementations of getDecomposition()
- // should make use.
- Primitive2DSequence maLocalDecomposition;
-
protected:
- // access methods to maLocalDecomposition. The usage of this methods may allow
- // later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
- // implementations for buffering the last decomposition.
- const Primitive2DSequence& getLocalDecomposition() const { return maLocalDecomposition; }
- void setLocalDecomposition(const Primitive2DSequence& rNew) { maLocalDecomposition = rNew; }
-
- // method which is to be used to implement the local decomposition of a 2D primitive. The default
- // implementation will just return an empty decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
- // constructor
+ // constructor/destructor
BasePrimitive2D();
+ virtual ~BasePrimitive2D();
- // the ==operator is mainly needed to allow testing newly-created primitives against their last
- // incarnation which buffers/holds the made decompositions. The default implementation
- // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then
- // based on this implementation
+ /** the ==operator is mainly needed to allow testing newly-created primitives against their last
+ incarnation which buffers/holds the made decompositions. The default implementation
+ uses getPrimitive2DID()-calls to test if it's the same ID at last. Overloaded implementation are then
+ based on this implementation
+ */
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
bool operator!=( const BasePrimitive2D& rPrimitive ) const { return !operator==(rPrimitive); }
- // The default implementation will use getDecomposition results to create the range
+ /// The default implementation will use getDecomposition results to create the range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID for fast identifying of known primitive implementations in renderers. These use
- // the the defines from primitivetypes2d.hxx to define unique IDs.
- // This method is normally defined using DeclPrimitrive2DIDBlock()
- virtual sal_uInt32 getPrimitiveID() const = 0;
+ /** provide unique ID for fast identifying of known primitive implementations in renderers. These use
+ the the defines from primitivetypes2d.hxx to define unique IDs.
+ This method is normally defined using DeclPrimitrive2DIDBlock()
+ */
+ virtual sal_uInt32 getPrimitive2DID() const = 0;
- // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty.
- // It will set maLocalDecomposition to this obtained decomposition to buffer it.
- // If the decomposition is also ViewInformation2D-dependent, this method needs to be overloaded and the
- // ViewInformation2D for the last decomposition need to be remembered, too, and be used in the next call to decide if
- // the buffered decomposition may be reused or not.
+ /// The default implementation will return an empty sequence
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
//
// Methods from XPrimitive2D
//
- // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
- // will construct a ViewInformation2D from the ViewParameters for that purpose
+ /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
+ will construct a ViewInformation2D from the ViewParameters for that purpose
+ */
virtual Primitive2DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
- // The getRange implementation for UNO API will use getRange from this implementation. It
- // will construct a ViewInformation2D from the ViewParameters for that purpose
+ /** The getRange implementation for UNO API will use getRange from this implementation. It
+ will construct a ViewInformation2D from the ViewParameters for that purpose
+ */
virtual ::com::sun::star::geometry::RealRectangle2D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+// BufferedDecompositionPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** BufferedDecompositionPrimitive2D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+ which want to buffer the decomoposition result
+
+ Buffering the decomposition is the most-used buffering and is thus used my most
+ primitive implementations which support a decomposition as base class.
+
+ The buffering is done by holding the last decomposition in the local parameter
+ maBuffered2DDecomposition. The default implementation of get2DDecomposition checks
+ if maBuffered2DDecomposition is empty. If yes, it uses create2DDecomposition
+ to create the content. In all cases, maBuffered2DDecomposition is returned.
+
+ For view-dependent primitives derived from Primitive2DBufferDecomposition more needs
+ to be done when the decomposition depends on parts of the parameter ViewInformation2D.
+ This defines a standard method for processing these:
+
+ Implement a view-dependent get2DDecomposition doing te following steps:
+ (a) Locally extract needed parameters from ViewInformation2D to new, local parameters
+ (this may be a complete local copy of ViewInformation2D)
+ (b) If a buffered decomposition exists, ckeck if one of the new local parameters
+ differs from the corresponding locally remembered (as member) ones. If yes,
+ clear maBuffered2DDecomposition
+ (d) call baseclass::get2DDecomposition which will use create2DDecomposition
+ to fill maBuffered2DDecomposition if it's empty
+ (e) copy the new local parameters to the corresponding locally remembered ones
+ to identify if a new decomposition is needed at the next call
+ (f) return maBuffered2DDecomposition
+ */
+ class BufferedDecompositionPrimitive2D
+ : public BasePrimitive2D
+ {
+ private:
+ /// a sequence used for buffering the last create2DDecomposition() result
+ Primitive2DSequence maBuffered2DDecomposition;
+
+ protected:
+ /** access methods to maBuffered2DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive2DSequence& getBuffered2DDecomposition() const { return maBuffered2DDecomposition; }
+ void setBuffered2DDecomposition(const Primitive2DSequence& rNew) { maBuffered2DDecomposition = rNew; }
+
+ /** method which is to be used to implement the local decomposition of a 2D primitive. The default
+ implementation will just return an empty decomposition
+ */
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ // constructor/destructor
+ BufferedDecompositionPrimitive2D();
+
+ /** The getDecomposition default implementation will on demand use create2DDecomposition() if
+ maBuffered2DDecomposition is empty. It will set maBuffered2DDecomposition to this obtained decomposition
+ to buffer it. If the decomposition is also ViewInformation2D-dependent, this method needs to be
+ overloaded and the ViewInformation2D for the last decomposition need to be remembered, too, and
+ be used in the next call to decide if the buffered decomposition may be reused or not.
+ */
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// tooling
namespace drawinglayer
{
namespace primitive2d
{
- // get B2DRange from a given Primitive2DReference
+ /// get B2DRange from a given Primitive2DReference
basegfx::B2DRange getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
- // get B2DRange from a given Primitive2DSequence
+ /// get B2DRange from a given Primitive2DSequence
basegfx::B2DRange getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation);
- // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
- // and using compare operator
+ /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
+ and using compare operator
+ */
bool arePrimitive2DReferencesEqual(const Primitive2DReference& rA, const Primitive2DReference& rB);
- // compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally
+ /// compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally
bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB);
- // concatenate sequence
+ /// concatenate sequence
void appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource);
- // concatenate single Primitive2D
+ /// concatenate single Primitive2D
void appendPrimitive2DReferenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DReference& rSource);
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
index d295c6ab4b89..f5de130febf9 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
@@ -47,28 +47,41 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** BitmapPrimitive2D class
+
+ This class is the central primitive for Bitmap-based primitives.
+ It provides RGBA-based bitmaps, currently using a BitmapEx from VCL.
+ This may change in the future to any other, maybe more general base
+ class providing 24bit RGBA.
+ */
class BitmapPrimitive2D : public BasePrimitive2D
{
private:
+ /// the RGBA Bitmap-data
BitmapEx maBitmapEx;
+
+ /** the object transformation from unit coordinates, defining
+ size, shear, rotate and position
+ */
basegfx::B2DHomMatrix maTransform;
public:
+ /// constructor
BitmapPrimitive2D(
const BitmapEx& rBitmapEx,
const basegfx::B2DHomMatrix& rTransform);
- // get data
+ /// data read access
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
index 504ada20f8ac..b13528184f3b 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
@@ -46,25 +46,41 @@ namespace drawinglayer
{
namespace primitive2d
{
- class BorderLinePrimitive2D : public BasePrimitive2D
+ /** BorderLinePrimitive2D class
+
+ This is the basic primitive to build frames around objects, e.g. tables.
+ It defines a single or double line from Start to nd using the LeftWidth,
+ Distance and RightWidth definitions.
+ The LineStart/End overlap is defined by the Extend(Inner|Outer)(Start|End)
+ definitions.
+ */
+ class BorderLinePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the line definition
basegfx::B2DPoint maStart;
basegfx::B2DPoint maEnd;
+
+ /// the widths of single/double line
double mfLeftWidth;
double mfDistance;
double mfRightWidth;
+
+ /// edge overlap sizes
double mfExtendInnerStart;
double mfExtendInnerEnd;
double mfExtendOuterStart;
double mfExtendOuterEnd;
+
+ /// the line color
basegfx::BColor maRGBColor;
- // bitfield
+ /// bitfield
+ /// flags to influence inside/outside creation
unsigned mbCreateInside : 1;
unsigned mbCreateOutside : 1;
- // helpers
+ /// local helpers
double getCorrectedLeftWidth() const
{
return basegfx::fTools::equal(1.0, mfLeftWidth) ? 0.0 : mfLeftWidth;
@@ -106,10 +122,11 @@ namespace drawinglayer
}
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
BorderLinePrimitive2D(
const basegfx::B2DPoint& rStart,
const basegfx::B2DPoint& rEnd,
@@ -124,7 +141,7 @@ namespace drawinglayer
bool bCreateOutside,
const basegfx::BColor& rRGBColor);
- // get data
+ /// data read access
const basegfx::B2DPoint& getStart() const { return maStart; }
const basegfx::B2DPoint& getEnd() const { return maEnd; }
double getLeftWidth() const { return mfLeftWidth; }
@@ -138,10 +155,10 @@ namespace drawinglayer
bool getCreateOutside() const { return mbCreateOutside; }
const basegfx::BColor& getRGBColor() const { return maRGBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
index 95c53347debb..b153e04ee1cb 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx
@@ -46,6 +46,12 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** ChartPrimitive2D class
+
+ This is a helper primitive which decomposes to the ChartMetaFile
+ visualisation. It is used to allow specific renderers to do something
+ direct for visualising the chart.
+ */
class ChartPrimitive2D : public GroupPrimitive2D
{
private:
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
index 0e69cb7bdfc0..5dd55405adf7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
@@ -47,63 +47,74 @@ namespace drawinglayer
{
namespace primitive2d
{
- class ControlPrimitive2D : public BasePrimitive2D
+ /** ControlPrimitive2D class
+
+ Base class for ControlPrimitive handling. It decoposes to a
+ graphical representation (Bitmap data) of the control. This
+ representation is limited to a quadratic pixel maximum defined
+ in the applicatin settings.
+ */
+ class ControlPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // object's base data
+ /// object's base data
basegfx::B2DHomMatrix maTransform;
com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel;
- // the created an cached awt::XControl
+ /// the created an cached awt::XControl
com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxXControl;
- // the last used scaling, used from getDecomposition for buffering
+ /// the last used scaling, used from getDecomposition for buffering
basegfx::B2DVector maLastViewScaling;
- // used from getXControl() to create a local awt::XControl which is remembered in mxXControl
- // and from thereon always used and returned by getXControl()
+ /** used from getXControl() to create a local awt::XControl which is remembered in mxXControl
+ and from thereon always used and returned by getXControl()
+ */
void createXControl();
- // single local decompositions, used from createLocalDecomposition()
+ /// single local decompositions, used from create2DDecomposition()
Primitive2DReference createBitmapDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
Primitive2DReference createPlaceholderDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
protected:
- // local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
ControlPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel);
- // constructor with an additional XControl as parameter to allow to hand it over at incarnation time
- // if it exists. This will avoid to create a 2nd one on demand in createXControl()
- // and thus double the XControls.
+ /** constructor with an additional XControl as parameter to allow to hand it over at incarnation time
+ if it exists. This will avoid to create a 2nd one on demand in createXControl()
+ and thus double the XControls.
+ */
ControlPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& rxControlModel,
const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& rxXControl);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& getControlModel() const { return mxControlModel; }
- // mxControl access. This will on demand create the awt::XControl using createXControl()
- // if it does not exist. It may already have been created or even handed over at
- // incarnation
+ /** mxControl access. This will on demand create the awt::XControl using createXControl()
+ if it does not exist. It may already have been created or even handed over at
+ incarnation
+ */
const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& getXControl() const;
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
new file mode 100644
index 000000000000..04ddb73460fa
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bitmapprimitive2d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// DiscreteBitmapPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** DiscreteBitmapPrimitive2D class
+
+ This class defines a view-dependent BitmapPrimitive which has a
+ logic position for the top-left position and is always to be
+ painted in 1:1 pixel resolution. It will never be sheared, rotated
+ or scaled with the view.
+ */
+ class DiscreteBitmapPrimitive2D : public ObjectAndViewTransformationDependentPrimitive2D
+ {
+ private:
+ /// the RGBA Bitmap-data
+ BitmapEx maBitmapEx;
+
+ /** the top-left object position */
+ basegfx::B2DPoint maTopLeft;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ DiscreteBitmapPrimitive2D(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft);
+
+ /// data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_DISCRETEBITMAPPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index 8d5d089f5800..d287482389b5 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -103,6 +103,12 @@
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
+#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
+#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
+#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
+#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
+#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
+#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
index e0da8a36c3f5..c27b6874891f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
@@ -42,52 +42,65 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
-// BackgroundColorPrimitive2D class
+// Embedded3DPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class Embedded3DPrimitive2D : public BasePrimitive2D
+ /** Embedded3DPrimitive2D class
+
+ This is a helper primitive which allows embedding of single 3D
+ primitives to the 2D primitive logic. It will get the scene it's
+ involved and thus the 3D transformation. With this information it
+ is able to provide 2D range data for a 3D primitive.
+
+ This primitive will not be visualized and decomposes to a yellow
+ 2D rectangle to visualize that this should never be visualized
+ */
+ class Embedded3DPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the sequence of 3d primitives
+ /// the sequence of 3d primitives
primitive3d::Primitive3DSequence mxChildren3D;
- // the 2D scene object transformation
+ /// the 2D scene object transformation
basegfx::B2DHomMatrix maObjectTransformation;
- // the 3D transformations
+ /// the 3D transformations
geometry::ViewInformation3D maViewInformation3D;
- // if the embedded 3D primitives contain shadow, these parameters are needed
- // to extract the shadow wich is a sequence od 2D primitives and may expand
- // the 2D range. Since every single 3D object in a scene may individually
- // have shadow or not, these values need to be provided and prepared. The shadow
- // distance itself (a 2D transformation) is part of the 3D shadow definition
+ /** if the embedded 3D primitives contain shadow, these parameters are needed
+ to extract the shadow wich is a sequence od 2D primitives and may expand
+ the 2D range. Since every single 3D object in a scene may individually
+ have shadow or not, these values need to be provided and prepared. The shadow
+ distance itself (a 2D transformation) is part of the 3D shadow definition
+ */
basegfx::B3DVector maLightNormal;
double mfShadowSlant;
basegfx::B3DRange maScene3DRange;
- // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
+ /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
Primitive2DSequence maShadowPrimitives;
- // #i96669# add simple range buffering for this primitive
+ /// #i96669# add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
- // bitfield
- // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
- // are created in maShadowPrimitives
+ /// bitfield
+ /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
+ are created in maShadowPrimitives
+ */
unsigned mbShadow3DChecked : 1;
- // private helpers
+ /// private helpers
bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
Embedded3DPrimitive2D(
const primitive3d::Primitive3DSequence& rxChildren3D,
const basegfx::B2DHomMatrix& rObjectTransformation,
@@ -96,7 +109,7 @@ namespace drawinglayer
double fShadowSlant,
const basegfx::B3DRange& rScene3DRange);
- // get data
+ /// get data
const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
@@ -104,13 +117,13 @@ namespace drawinglayer
double getShadowSlant() const { return mfShadowSlant; }
const basegfx::B3DRange& getScene3DRange() const { return maScene3DRange; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
new file mode 100644
index 000000000000..0ebb29e153ec
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: backgroundcolorprimitive2d.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/gfxlink.hxx>
+#include <vcl/gdimtf.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** EpsPrimitive2D class */
+ class EpsPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// the geometry definition
+ basegfx::B2DHomMatrix maEpsTransform;
+
+ /// the Eps content definition
+ GfxLink maGfxLink;
+
+ /// the replacement content definition
+ GDIMetaFile maMetaFile;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ EpsPrimitive2D(
+ const basegfx::B2DHomMatrix& rEpsTransform,
+ const GfxLink& rGfxLink,
+ const GDIMetaFile& rMetaFile);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getEpsTransform() const { return maEpsTransform; }
+ const GfxLink& getGfxLink() const { return maGfxLink; }
+ const GDIMetaFile& getMetaFile() const { return maMetaFile; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_EPSPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
index 1811b9bfaad9..7d2b084a9356 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillbitmapprimitive2d.hxx
@@ -47,32 +47,49 @@ namespace drawinglayer
{
namespace primitive2d
{
- class FillBitmapPrimitive2D : public BasePrimitive2D
+ /** FillBitmapPrimitive2D class
+
+ This class defines a bitmap filling for a rectangular area. The
+ Range is defined by the Transformation, the fill by the FillBitmapAttribute.
+ There, the fill consists of a Bitmap (not transparent) defining the fill data
+ and a Point/Vector pair defining the relative position/size [0.0 .. 1.0]
+ inside the area where the bitmap is positioned. A flag defines then if this
+ is tiled or not.
+
+ Renderers should handle this primitive; it has a geometrically correct
+ decomposition, but on pixel oututs the areas where the tiled pieces are
+ aligned tend to show up (one overlapping or empty pixel)
+ */
+ class FillBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DHomMatrix maTransformation;
+
+ /// the fill attributes
attribute::FillBitmapAttribute maFillBitmap;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
FillBitmapPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
const attribute::FillBitmapAttribute& rFillBitmap);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
index ef5a52c6ddcf..0fd084c6fad0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
@@ -40,38 +40,77 @@
#include <drawinglayer/attribute/fillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// FillbitmapPrimitive2D class
+// predefines
+
+namespace basegfx { class B2DPolygon; }
+
+//////////////////////////////////////////////////////////////////////////////
+// FillGradientPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class FillGradientPrimitive2D : public BasePrimitive2D
+ /** FillGradientPrimitive2D class
+
+ This class defines a gradient filling for a rectangular area. The
+ Range is defined by the Transformation, the gradient by the FillGradientAttribute.
+
+ The decomposition will deliver the decomposed gradient, e.g. for an ellipse
+ gradient the various ellipses in various color steps will be created.
+
+ I have added functionality to create both versions of filled decompositions:
+ Those who overlap and non-overlapping ones. The overlapping version is the
+ default one since it works with and without AntiAliasing. The non-overlapping
+ version is used in the MetafilePrimitive2D decomposition when the old XOR
+ paint was recorded.
+ */
+ class FillGradientPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DRange maObjectRange;
+
+ /// the gradient definition
attribute::FillGradientAttribute maFillGradient;
+ /// local helpers
+ void generateMatricesAndColors(
+ std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ std::vector< basegfx::BColor >& rColors) const;
+ Primitive2DSequence createOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const;
+ Primitive2DSequence createNonOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const;
+
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local helper
+ Primitive2DSequence createFill(bool bOverlapping) const;
+
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
FillGradientPrimitive2D(
const basegfx::B2DRange& rObjectRange,
const attribute::FillGradientAttribute& rFillGradient);
- // get data
+ /// data read access
const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 04410429d4a3..1df3bb103eb0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -40,41 +40,56 @@
#include <drawinglayer/attribute/fillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// FillbitmapPrimitive2D class
+// FillHatchPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class FillHatchPrimitive2D : public BasePrimitive2D
+ /** FillHatchPrimitive2D class
+
+ This class defines a hatch filling for a rectangular area. The
+ Range is defined by the Transformation, the hatch by the FillHatchAttribute.
+ If the background is to be filled, a flag in FillHatchAttribute is set and
+ the BColor defines the background color.
+
+ The decomposition will deliver the hatch lines.
+ */
+ class FillHatchPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DRange maObjectRange;
+
+ /// the hatch definition
attribute::FillHatchAttribute maFillHatch;
+
+ /// hatch background color (if used)
basegfx::BColor maBColor;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
FillHatchPrimitive2D(
const basegfx::B2DRange& rObjectRange,
const basegfx::BColor& rBColor,
const attribute::FillHatchAttribute& rFillHatch);
- // get data
+ /// data read access
const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
index 6d3826e7ee22..e6adcacc97e0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
@@ -46,18 +46,39 @@ namespace drawinglayer
{
namespace primitive2d
{
- class GraphicPrimitive2D : public BasePrimitive2D
+ /** GraphicPrimitive2D class
+
+ Primitive to hold graphics defined by GraphicObject and GraphicAttr
+ combination. This includes MetaFiles and diverse pixel-oriented graphic
+ formats. It even includes animated GIFs, Croppings and other changes
+ defined in GraphicAttr.
+
+ This makes the decomposition contain a wide variety of possibilites,
+ too. From a simple BitmapPrimitive over AnimatedSwitchPrimitive2D,
+ MetafilePrimitive2D (with and without embedding in a masking when e.g.
+ the Metafile is bigger than the geometry) and embeddings in
+ TransformPrimitive2D and MaskPrimitive2D for croppings.
+
+ The primitive geometry area is defined by Transform.
+ */
+ class GraphicPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometric definition
basegfx::B2DHomMatrix maTransform;
+
+ /// the GraphicObject with all it's content possibilities
GraphicObject maGraphicObject;
+
+ /// The GraphicAttr with all it's modification possibilities
GraphicAttr maGraphicAttr;
protected:
- // local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor(s)
GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const GraphicObject& rGraphicObject,
@@ -66,19 +87,19 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform,
const GraphicObject& rGraphicObject);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const GraphicObject& getGraphicObject() const { return maGraphicObject; }
const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
bool isTransparent() const;
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
index f0aad415bfce..4ba83fc75c88 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
@@ -48,29 +48,47 @@ namespace drawinglayer
{
namespace primitive2d
{
- class GridPrimitive2D : public BasePrimitive2D
+ /** GridPrimitive2D class
+
+ This primitive is specialized to Grid visualisation. The graphic definition
+ (Transform) contains the whole grid area, but will of course be combined
+ with the visible area (Viewport) when decomposed. Also a reolution-dependent
+ point reduction is used to not create too much grid visualisation data. This
+ makes this primitive highly view-dependent and it dynamically buffers
+ the last decomposition dependent from the Viewport used.
+ */
+ class GridPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// The geometry definition for the grid area
basegfx::B2DHomMatrix maTransform;
+
+ /// grid layout definitions
double mfWidth;
double mfHeight;
double mfSmallestViewDistance;
double mfSmallestSubdivisionViewDistance;
sal_uInt32 mnSubdivisionsX;
sal_uInt32 mnSubdivisionsY;
+
+ /// Grid color for single-pixel grid points
basegfx::BColor maBColor;
+
+ /// The Bitmap (with alpha) for grid cross points
BitmapEx maCrossMarker;
- // the last used object to view transformtion and the last Viewport,
- // used from getDecomposition for decide buffering
+ /** the last used object to view transformtion and the last Viewport,
+ used from getDecomposition for decide buffering
+ */
basegfx::B2DHomMatrix maLastObjectToViewTransformation;
basegfx::B2DRange maLastViewport;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
GridPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
double fWidth,
@@ -82,7 +100,7 @@ namespace drawinglayer
const basegfx::BColor& rBColor,
const BitmapEx& rCrossMarker);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
double getWidth() const { return mfWidth; }
double getHeight() const { return mfHeight; }
@@ -93,16 +111,16 @@ namespace drawinglayer
const basegfx::BColor& getBColor() const { return maBColor; }
const BitmapEx& getCrossMarker() const { return maCrossMarker; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get 2d range
+ /// get 2d range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
index 855e65ba98f8..89b49420a3e7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
@@ -45,27 +45,58 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** GroupPrimitive2D class
+
+ Baseclass for all grouping 2D primitives
+
+ The grouping primitive in it's basic form is capable of holding
+ a child primitive content and returns it on decomposition on default.
+ It is used for two main purposes, but more may apply:
+
+ - to transport extended information, e.g. for text classification,
+ see e.g. TextHierarchy*Primitive2D implementations. Since they
+ decompose to their child content, renderers not aware/interested
+ in that extra information will just ignore these primitives
+
+ - to encapsulate common geometry, e.g. the ShadowPrimitive2D implements
+ applying a generic shadow to a child sequence by adding the needed
+ offset and color stuff in the decomposition
+
+ In most cases the decomposition is straightforward, so by default
+ this primitive will not buffer the result and is not derived from
+ BufferedDecompositionPrimitive2D, but from BasePrimitive2D.
+
+ A renderer has to take GroupPrimitive2D derivations into account which
+ are used to hold a state.
+
+ Current Basic 2D StatePrimitives are:
+
+ - AlphaPrimitive2D (objects with freely defined transparence)
+ - InvertPrimitive2D (for XOR)
+ - MaskPrimitive2D (for masking)
+ - ModifiedColorPrimitive2D (for a stack of color modifications)
+ - TransformPrimitive2D (for a transformation stack)
+ */
class GroupPrimitive2D : public BasePrimitive2D
{
private:
- // the children. Declared private since this shall never be changed at all after construction
+ /// the children. Declared private since this shall never be changed at all after construction
Primitive2DSequence maChildren;
- protected:
- // local decomposition. Implementation will just return children
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
- // constructor
+ /// constructor
GroupPrimitive2D(const Primitive2DSequence& rChildren);
- // data access
+ /// data read access
const Primitive2DSequence& getChildren() const { return maChildren; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // provide unique ID
+ /// local decomposition. Implementation will just return children
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
index 4e8357a3eac1..a1171cb846e0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
@@ -47,32 +47,52 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** HelplineStyle2D definition
+
+ The available styles of Helplines
+ */
enum HelplineStyle2D
{
HELPLINESTYLE2D_POINT,
HELPLINESTYLE2D_LINE
};
- class HelplinePrimitive2D : public BasePrimitive2D
+ /** HelplinePrimitive2D class
+
+ This primitive provides a view-dependent helpline definition. The Helpline
+ is defined by a line equation (Point and vector) and a style. When the style
+ is a line, dependent from Viewport the visible part of that Helpline is
+ constructed. For Point, a cross is constructed. This primitive is highly
+ view-dependent.
+
+ The visualisation uses the two given colors to create a dashed line with
+ the given dash length.
+ */
+ class HelplinePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// Helpline geometry definition
basegfx::B2DPoint maPosition;
basegfx::B2DVector maDirection;
HelplineStyle2D meStyle;
+
+ /// Helpline style definition
basegfx::BColor maRGBColA;
basegfx::BColor maRGBColB;
double mfDiscreteDashLength;
- // the last used object to view transformtion and the last Viewport,
- // used from getDecomposition for decide buffering
+ /** the last used object to view transformtion and the last Viewport,
+ used from getDecomposition for decide buffering
+ */
basegfx::B2DHomMatrix maLastObjectToViewTransformation;
basegfx::B2DRange maLastViewport;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
HelplinePrimitive2D(
const basegfx::B2DPoint& rPosition,
const basegfx::B2DVector& rDirection,
@@ -81,7 +101,7 @@ namespace drawinglayer
const basegfx::BColor& aRGBColB,
double fDiscreteDashLength);
- // get data
+ /// data read access
const basegfx::B2DPoint getPosition() const { return maPosition; }
const basegfx::B2DVector getDirection() const { return maDirection; }
HelplineStyle2D getStyle() const { return meStyle; }
@@ -89,13 +109,13 @@ namespace drawinglayer
const basegfx::BColor& getRGBColB() const { return maRGBColB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
index 2bbcad315eb3..3b69c685c985 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
@@ -44,30 +44,35 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This primitive is used to represent geometry for non-visible objects,
- // e.g. a PresObj's outline. To still be able to use primitives for HitTest
- // functionality, the 2d decompositions will produce an as much as possible
- // simplified line geometry encapsulated in this primtive when there is no
- // line geometry. In a further enchanced version this may change to 'if neither
- // filled nor lines' creation criteria. The whole primitive decomposes to nothing,
- // so no one not knowing it will be influenced. Only helper processors for hit test
- // (and maybe BoundRect extractors) will use it and it's children subcontent.
+ /** HitTestPrimitive2D class
+
+ This primitive is used to represent geometry for non-visible objects,
+ e.g. a PresObj's outline. To still be able to use primitives for HitTest
+ functionality, the 2d decompositions will produce an as much as possible
+ simplified line geometry encapsulated in this primtive when there is no
+ line geometry. In a further enchanced version this may change to 'if neither
+ filled nor lines' creation criteria. The whole primitive decomposes to nothing,
+ so no one not knowing it will be influenced. Only helper processors for hit test
+ (and maybe BoundRect extractors) will use it and it's children subcontent.
+ */
class HitTestPrimitive2D : public GroupPrimitive2D
{
- protected:
- // local decomposition. Implementation will return empty Primitive2DSequence
- // since this is no visualisation data
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
public:
+ /// constructor
HitTestPrimitive2D(const Primitive2DSequence& rChildren);
- // despite returning an empty decomposition since it's no visualisation data,
- // range calculation is intended to use invisible replacement geometry, so
- // the local implementation will return the children's range
+ /** despite returning an empty decomposition since it's no visualisation data,
+ range calculation is intended to use invisible replacement geometry, so
+ the local implementation will return the children's range
+ */
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /** local decomposition. Implementation will return empty Primitive2DSequence
+ since this is no visualisation data
+ */
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
index ae7a316e03da..85f1c6510c5a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/invertprimitive2d.hxx
@@ -44,12 +44,23 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** InvertPrimitive2D class
+
+ This is a helper class which encapsulates geometry that should be
+ painted XOR, e.g. old cursor visualisations. It decomposes to
+ it's content, so when not supporting it, the contained geometry
+ will be visualized normally.
+ Unfortunately this is still needed, but hard to support on various
+ systems. XOR painting needs read access to the target, so modern
+ graphic systems tend to not support it anymore.
+ */
class InvertPrimitive2D : public GroupPrimitive2D
{
public:
+ /// constructor
InvertPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
index 350471f4aff3..cc4c054f8bb3 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
@@ -41,38 +41,55 @@
#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
-// MarkerPrimitive2D class
+// MarkerArrayPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
- class MarkerArrayPrimitive2D : public BasePrimitive2D
+ /** MarkerArrayPrimitive2D class
+
+ This primtive defines an array of markers. Their size is defined
+ in pixels and independent from the view transformation which makes
+ this primitive highly view-dependent. It is also transformation
+ invariant, so that the bitmap is always visualized unscaled and
+ unrotated.
+ It is used e.g. for grid position visualisation. The given Bitmap
+ (with alpha) is defined to be visible centered at each of the given
+ positions.
+ It decomposes to the needed number of BitmapPrimitive2D's, so it would
+ be efficient to handle it directly in a renderer.
+ */
+ class MarkerArrayPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the positions for the marker
std::vector< basegfx::B2DPoint > maPositions;
+
+ /// the marker definintion to visualize
BitmapEx maMarker;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
MarkerArrayPrimitive2D(
const std::vector< basegfx::B2DPoint >& rPositions,
const BitmapEx& rMarker);
- // get data
+ /// data read access
const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
const BitmapEx& getMarker() const { return maMarker; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
index 9be17376941e..e5cb12e6e87c 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
@@ -45,23 +45,42 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** MaskPrimitive2D class
+
+ This is the central masking primitive. It's a grouping
+ primitive and contains a PolyPolygon which defines the visible
+ area. Only visualisation parts of the Child primitive sequence
+ inside of the mask PolyPolygon is defined to be visible.
+
+ This primitive should be handled by a renderer. If it is not handled,
+ it decomposes to it's Child content, and thus the visualisation would
+ contaiun no clips.
+
+ The geometrc range of this primitive is completely defined by the Mask
+ PolyPolygon since by definition nothing outside of the mask is visible.
+ */
class MaskPrimitive2D : public GroupPrimitive2D
{
private:
+ /// the mask PolyPolygon
basegfx::B2DPolyPolygon maMask;
public:
+ /// constructor
MaskPrimitive2D(
const basegfx::B2DPolyPolygon& rMask,
const Primitive2DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
index 019fdc69bd3f..e5f884f09294 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
@@ -46,38 +46,55 @@ namespace drawinglayer
{
namespace primitive2d
{
- class MediaPrimitive2D : public BasePrimitive2D
+ /** MediaPrimitive2D class
+
+ This is a unified primitive for Media visualisation, e.g. animations
+ or sounds. It's geometry is defined by Transform. For conveinience,
+ it also contains a discrete border size (aka Pixels) which will be added
+ if used. This makes it a view-dependent primitive. It also gets a filled
+ background and the decomposition will try to create a graphic representation
+ if te content (defined by the URL), e.g. a still frome for animated stuff.
+ */
+ class MediaPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometry definition
basegfx::B2DHomMatrix maTransform;
+
+ /// the content definition
rtl::OUString maURL;
+
+ /// style: background color
basegfx::BColor maBackgroundColor;
+
+ /// discrete border (in 'pixels')
sal_uInt32 mnDiscreteBorder;
protected:
- // local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
MediaPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const rtl::OUString& rURL,
const basegfx::BColor& rBackgroundColor,
sal_uInt32 nDiscreteBorder);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const rtl::OUString& getURL() const { return maURL; }
const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
index 23eb5dd1b36e..0cbd7e4628cb 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
@@ -47,28 +47,55 @@ namespace drawinglayer
{
namespace primitive2d
{
- class MetafilePrimitive2D : public BasePrimitive2D
+ /** MediaPrimitive2D class
+
+ This is the MetaFile representing primitive. It's geometry is defined
+ by MetaFileTransform. The content (defined by MetaFile) will be scaled
+ to the geometric definiton by using PrefMapMode and PrefSize of the
+ Metafile.
+
+ It has shown that this not always guarantees that all Metafile content
+ is inside the geometric definition, but this primitive defines that this
+ is the case to allow a getB2DRange implementation. If it cannot be
+ guaranteed that the Metafile is inside the geometric definition, it should
+ be embedded to a MaskPrimitive2D.
+
+ This primitive has no decomposition yet, so when not supported by a renderer,
+ it will not be visualized.
+
+ In the future, a decomposition implementation would be appreciated and would
+ have many advantages; Metafile would no longer have to be rendered by
+ sub-systems and a standard way for converting Metafiles would exist.
+ */
+ class MetafilePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the geometry definition
basegfx::B2DHomMatrix maMetaFileTransform;
+
+ /// the content definition
GDIMetaFile maMetaFile;
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
MetafilePrimitive2D(
const basegfx::B2DHomMatrix& rMetaFileTransform,
const GDIMetaFile& rMetaFile);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; }
const GDIMetaFile& getMetaFile() const { return maMetaFile; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
index 903ba89c9a5b..e93dd523e0b7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
@@ -45,23 +45,42 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** ModifiedColorPrimitive2D class
+
+ This primitive is a grouping primitive and allows to define
+ how the colors of it's child content shall be modified for
+ visualisation. This can be (and is) used e.g. for generic shadow
+ visualisation by forcing all color usages of the contained
+ sub-content to the shadow color.
+
+ For the possibilities of color modifications, please refer
+ to the basegfx::BColorModifier definitions in basegfx. For
+ processing there is tooling in basegfx to build a stack of
+ BColorModifiers to always be able to proccess the correct
+ colors.
+
+ If a renderer does not handle this primitive, the content will
+ be visualized unchanged.
+ */
class ModifiedColorPrimitive2D : public GroupPrimitive2D
{
private:
+ /// The ColorModifier to use
basegfx::BColorModifier maColorModifier;
public:
+ /// constructor
ModifiedColorPrimitive2D(
const Primitive2DSequence& rChildren,
const basegfx::BColorModifier& rColorModifier);
- // get data
+ /// data read access
const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
index edba5455ff0a..5eca0ac2ab13 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
@@ -36,7 +36,7 @@
#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PAGEPREVIEWPRIMITIVE2D_HXX
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -46,57 +46,66 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing
- // the page contents (given as childs of the GroupPrimitive2D here) if these contain e.g.
- // view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want
- // those primitives to be visualized correctly, Your renderer needs to locally correct it's
- // ViewInformation2D to reference the new XDrawPage.
- class PagePreviewPrimitive2D : public GroupPrimitive2D
+ /** PagePreviewPrimitive2D class
+
+ This primitive is needed to have the correct XDrawPage as ViewInformation for decomposing
+ the page contents (given as PageContent here) if these contain e.g.
+ view-dependent (in this case XDrawPage-dependent) text fields like PageNumber. If You want
+ those primitives to be visualized correctly, Your renderer needs to locally correct it's
+ ViewInformation2D to reference the new XDrawPage.
+ */
+ class PagePreviewPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the XDrawPage visualized by this primitive. When we go forward with primitives
- // this will not only be used by the renderers to provide the correct decompose
- // graphic attribute context, but also to completely create the page's sub-content.
+ /** the XDrawPage visualized by this primitive. When we go forward with primitives
+ this will not only be used by the renderers to provide the correct decompose
+ graphic attribute context, but also to completely create the page's sub-content.
+ */
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage;
- // the own geometry
+ /// the PageContent
+ Primitive2DSequence maPageContent;
+
+ /// the own geometry
basegfx::B2DHomMatrix maTransform;
- // content width and height
+ /// content width and height
double mfContentWidth;
double mfContentHeight;
- // bitfield
- // flag to allow keeping the aspect ratio
+ /// bitfield
+ /// flag to allow keeping the aspect ratio
unsigned mbKeepAspectRatio : 1;
protected:
- // local decomposition. Implementation will just return children
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition. Implementation will just return children
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PagePreviewPrimitive2D(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
const basegfx::B2DHomMatrix& rTransform,
double fContentWidth,
double fContentHeight,
- const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rPageContent,
bool bKeepAspectRatio);
- // get data
+ /// data read access
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getXDrawPage() const { return mxDrawPage; }
+ const Primitive2DSequence& getPageContent() const { return maPageContent; }
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
double getContentWidth() const { return mfContentWidth; }
double getContentHeight() const { return mfContentHeight; }
bool getKeepAspectRatio() const { return mbKeepAspectRatio; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // own getB2DRange
+ /// own getB2DRange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index bdd4142b0584..793c96444bac 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -40,37 +40,51 @@
#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
-// MarkerPrimitive2D class
+// PointArrayPrimitive2D class
namespace drawinglayer
{
namespace primitive2d
{
+ /** PointArrayPrimitive2D class
+
+ This primitive defines single,discrete 'pixels' for the given
+ positions in the given color. This makes it view-dependent since
+ the logic size of a 'pixel' depends on the view transformation.
+
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it (Currently it is only used for grid visualisation,
+ but this may change).
+ */
class PointArrayPrimitive2D : public BasePrimitive2D
{
private:
+ /// the array of positions
std::vector< basegfx::B2DPoint > maPositions;
+
+ /// the color to use
basegfx::BColor maRGBColor;
- // #i96669# add simple range buffering for this primitive
- basegfx::B2DRange maB2DRange;
+ /// #i96669# add simple range buffering for this primitive
+ basegfx::B2DRange maB2DRange;
public:
+ /// constructor
PointArrayPrimitive2D(
const std::vector< basegfx::B2DPoint >& rPositions,
const basegfx::BColor& rRGBColor);
- // get data
+ /// data read access
const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
const basegfx::BColor& getRGBColor() const { return maRGBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
index 48ec5e80aa09..4c6f5b49bf01 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -49,26 +49,40 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolygonHairlinePrimitive2D class
+
+ This primitive defines a Hairline. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+ */
class PolygonHairlinePrimitive2D : public BasePrimitive2D
{
private:
+ /// the hairline geometry
basegfx::B2DPolygon maPolygon;
+
+ /// the hairline color
basegfx::BColor maBColor;
public:
- PolygonHairlinePrimitive2D(const basegfx::B2DPolygon& rPolygon, const basegfx::BColor& rBColor);
+ /// constructor
+ PolygonHairlinePrimitive2D(
+ const basegfx::B2DPolygon& rPolygon,
+ const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -81,44 +95,59 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolygonMarkerPrimitive2D : public BasePrimitive2D
+ /** PolygonMarkerPrimitive2D class
+
+ This primitive defines a two-colored marker hairline which is
+ dashed with the given dash length. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ It will be decomposed to the needed PolygonHairlinePrimitive2D if
+ not handled directly by a renderer.
+ */
+ class PolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the marker hairline geometry
basegfx::B2DPolygon maPolygon;
+
+ /// the two colors
basegfx::BColor maRGBColorA;
basegfx::BColor maRGBColorB;
+
+ /// the dash distance in 'pixels'
double mfDiscreteDashLength;
- // decomposition is view-dependent, remember last InverseObjectToViewTransformation
+ /// decomposition is view-dependent, remember last InverseObjectToViewTransformation
basegfx::B2DHomMatrix maLastInverseObjectToViewTransformation;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonMarkerPrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const basegfx::BColor& rRGBColorA,
const basegfx::BColor& rRGBColorB,
double fDiscreteDashLength);
- // get data
+ /// data read access
const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -131,39 +160,52 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolygonStrokePrimitive2D : public BasePrimitive2D
+ /** PolygonStrokePrimitive2D class
+
+ This primitive defines a line with line width, line join, line color
+ and stroke attributes. It will be decomposed dependent on the definition
+ to the needed primitives, e.g. filled PolyPolygons for fat lines.
+ */
+ class PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the line geometry
basegfx::B2DPolygon maPolygon;
+
+ /// the line attributes like width, join and color
attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
attribute::StrokeAttribute maStrokeAttribute;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonStrokePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute);
+ /// constructor without stroking
PolygonStrokePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute);
- // get data
+ /// data read access
basegfx::B2DPolygon getB2DPolygon() const { return maPolygon; }
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -176,17 +218,24 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolygonWavePrimitive2D class
+
+ This primitive defines a waveline based on a PolygonStrokePrimitive2D
+ where the wave is defined by wave width and wave length.
+ */
class PolygonWavePrimitive2D : public PolygonStrokePrimitive2D
{
private:
+ /// wave definition
double mfWaveWidth;
double mfWaveHeight;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonWavePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
@@ -194,23 +243,24 @@ namespace drawinglayer
double fWaveWidth,
double fWaveHeight);
+ /// constructor without stroking
PolygonWavePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
double fWaveWidth,
double fWaveHeight);
- // get data
+ /// data read access
double getWaveWidth() const { return mfWaveWidth; }
double getWaveHeight() const { return mfWaveHeight; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -223,17 +273,25 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolygonStrokeArrowPrimitive2D class
+
+ This primitive defines a PolygonStrokePrimitive2D which is extended
+ eventually by start and end definitions which are normally used for
+ arrows.
+ */
class PolygonStrokeArrowPrimitive2D : public PolygonStrokePrimitive2D
{
private:
+ /// geometric definitions for line start and end
attribute::LineStartEndAttribute maStart;
attribute::LineStartEndAttribute maEnd;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
@@ -241,23 +299,24 @@ namespace drawinglayer
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
+ /// constructor without stroking
PolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
- // get data
+ /// data read access
const attribute::LineStartEndAttribute& getStart() const { return maStart; }
const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index 9991a3109e10..187e89f42e97 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -51,30 +51,40 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonHairlinePrimitive2D : public BasePrimitive2D
+ /** PolyPolygonHairlinePrimitive2D class
+
+ This primitive defines a multi-PolygonHairlinePrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonHairlinePrimitive2Ds.
+ */
+ class PolyPolygonHairlinePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the hairline geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the hairline color
basegfx::BColor maBColor;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor);
- // get data
+ /// data read access
basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -87,38 +97,50 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonMarkerPrimitive2D : public BasePrimitive2D
+ /** PolyPolygonMarkerPrimitive2D class
+
+ This primitive defines a multi-PolygonMarkerPrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonMarkerPrimitive2Ds.
+ */
+ class PolyPolygonMarkerPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the marker hairline geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the two colors
basegfx::BColor maRGBColorA;
basegfx::BColor maRGBColorB;
+
+ /// the dash distance in 'pixels'
double mfDiscreteDashLength;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonMarkerPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const basegfx::BColor& rRGBColorA,
const basegfx::BColor& rRGBColorB,
double fDiscreteDashLength);
- // get data
+ // data read access
basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getRGBColorA() const { return maRGBColorA; }
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -131,39 +153,52 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonStrokePrimitive2D : public BasePrimitive2D
+ /** PolyPolygonStrokePrimitive2D class
+
+ This primitive defines a multi-PolygonStrokePrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonStrokePrimitive2Ds.
+ */
+ class PolyPolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the line geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the line attributes like width, join and color
attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
attribute::StrokeAttribute maStrokeAttribute;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute);
+ /// constructor without stroking
PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute);
- // get data
+ /// data read access
basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -176,17 +211,25 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolyPolygonStrokePrimitive2D class
+
+ This primitive defines a multi-PolygonStrokeArrowPrimitive2D and is
+ just for convenience. The definition is not different from the single
+ defined PolygonStrokeArrowPrimitive2Ds.
+ */
class PolyPolygonStrokeArrowPrimitive2D : public PolyPolygonStrokePrimitive2D
{
private:
+ /// geometric definitions for line start and end
attribute::LineStartEndAttribute maStart;
attribute::LineStartEndAttribute maEnd;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
@@ -194,23 +237,24 @@ namespace drawinglayer
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
+ /// constructor without stroking
PolyPolygonStrokeArrowPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::LineStartEndAttribute& rStart,
const attribute::LineStartEndAttribute& rEnd);
- // get data
+ /// data read access
const attribute::LineStartEndAttribute& getStart() const { return maStart; }
const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -223,28 +267,38 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** PolyPolygonColorPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a single color.
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+ */
class PolyPolygonColorPrimitive2D : public BasePrimitive2D
{
private:
+ /// the PolyPolygon geometry
basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the polygon fill color
basegfx::BColor maBColor;
public:
+ /// constructor
PolyPolygonColorPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -257,28 +311,39 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonGradientPrimitive2D : public PolyPolygonColorPrimitive2D
+ /** PolyPolygonColorPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a gradient. The
+ decomosition will create a MaskPrimitive2D containing a
+ FillGradientPrimitive2D.
+ */
+ class PolyPolygonGradientPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the gradient definition
attribute::FillGradientAttribute maFillGradient;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonGradientPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillGradientAttribute& rFillGradient);
- // get data
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -291,28 +356,44 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonHatchPrimitive2D : public PolyPolygonColorPrimitive2D
+ /** PolyPolygonHatchPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with a hatch. The
+ decomosition will create a MaskPrimitive2D containing a
+ FillHatchPrimitive2D.
+ */
+ class PolyPolygonHatchPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the hatch background color (if used)
+ basegfx::BColor maBackgroundColor;
+
+ /// the hatch definition
attribute::FillHatchAttribute maFillHatch;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonHatchPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
+ const basegfx::BColor& rBackgroundColor,
const attribute::FillHatchAttribute& rFillHatch);
- // get data
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -325,28 +406,39 @@ namespace drawinglayer
{
namespace primitive2d
{
- class PolyPolygonBitmapPrimitive2D : public PolyPolygonColorPrimitive2D
+ /** PolyPolygonBitmapPrimitive2D class
+
+ This primitive defines a PolyPolygon filled with bitmap data
+ (including alpha). The decomosition will create a MaskPrimitive2D
+ containing a FillBitmapPrimitive2D.
+ */
+ class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the bitmap fill definition (may include tiling)
attribute::FillBitmapAttribute maFillBitmap;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
PolyPolygonBitmapPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillBitmapAttribute& rFillBitmap);
- // get data
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillBitmapAttribute& getFillBitmap() const { return maFillBitmap; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
index bd561cbab21a..a095c558ba12 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/primitivetools2d.hxx
@@ -37,70 +37,163 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
-// tooling class for BasePrimitive2D baseed classes which are view-dependent
-// regarding the size of a discrete unit. The implementation of get2DDecomposition
-// guards the buffered local decomposition and ensures that a createLocalDecomposition
-// implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
namespace drawinglayer
{
namespace primitive2d
{
- class DiscreteMetricDependentPrimitive2D : public BasePrimitive2D
+ /** DiscreteMetricDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
+ regarding the size of a discrete unit. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
+ */
+ class DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the last used fDiscreteUnit definitions for decomposition. Since this
- // is checked and updated from get2DDecomposition() it will be current and
- // usable in createLocalDecomposition()
+ /** the last used fDiscreteUnit definitions for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
double mfDiscreteUnit;
public:
+ /// constructor
DiscreteMetricDependentPrimitive2D()
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
mfDiscreteUnit(0.0)
{
}
- // data access
+ /// data read access
double getDiscreteUnit() const { return mfDiscreteUnit; }
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-// tooling class for BasePrimitive2D baseed classes which are view-dependent
-// regarding the viewport. The implementation of get2DDecomposition
-// guards the buffered local decomposition and ensures that a createLocalDecomposition
-// implementation may use an up-to-date Viewport accessible using getViewport()
namespace drawinglayer
{
namespace primitive2d
{
- class ViewportDependentPrimitive2D : public BasePrimitive2D
+ /** ViewportDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
+ regarding the viewport. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date Viewport accessible using getViewport()
+ */
+ class ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the last used Viewport definition for decomposition. Since this
- // is checked and updated from get2DDecomposition() it will be current and
- // usable in createLocalDecomposition()
+ /** the last used Viewport definition for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
basegfx::B2DRange maViewport;
public:
+ /// constructor
ViewportDependentPrimitive2D()
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maViewport()
{
}
- // data access
+ /// data read access
const basegfx::B2DRange& getViewport() const { return maViewport; }
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ViewTransformationDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
+ regarding the complete Viewtransformation. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
+ */
+ class ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used ViewTransformation definition for decomposition. Since this
+ is checked and updated from get2DDecomposition() it will be current and
+ usable in create2DDecomposition()
+ */
+ basegfx::B2DHomMatrix maViewTransformation;
+
+ public:
+ /// constructor
+ ViewTransformationDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewTransformation()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** ObjectAndViewTransformationDependentPrimitive2D class
+
+ tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
+ and Object-Transform dependent. The implementation of get2DDecomposition
+ guards the buffered local decomposition and ensures that a create2DDecomposition
+ implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
+ and an object transformation via getObjectTransformation()
+ */
+ class ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /** the last used ViewTransformation and the last ObjectTransformation
+ definition for decomposition. Since this is checked and updated from
+ get2DDecomposition() it will be current and usable in create2DDecomposition()
+ */
+ basegfx::B2DHomMatrix maViewTransformation;
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ public:
+ /// constructor
+ ObjectAndViewTransformationDependentPrimitive2D()
+ : BufferedDecompositionPrimitive2D(),
+ maViewTransformation(),
+ maObjectTransformation()
+ {
+ }
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index d7fbfd4deaee..65d2bdf67f92 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -41,6 +41,7 @@
#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -48,48 +49,92 @@ namespace drawinglayer
{
namespace primitive2d
{
- class ScenePrimitive2D : public BasePrimitive2D
+ /** ScenePrimitive2D class
+
+ This primitive defines a 3D scene as a 2D primitive and is the anchor point
+ for a 3D visualisation. The decomposition is view-dependent and will try to
+ re-use already rendered 3D content.
+
+ The rendering is done using the default-3D renderer from basegfx which supports
+ AntiAliasing.
+
+ The 2D primitive's geometric range is defined completely by the
+ ObjectTransformation combined with evtl. 2D shadows from the 3D objects. The
+ shadows of 3D objects are 2D polygons, projected with the 3D transformation.
+
+ This is the class a renderer may process directly when he wants to implement
+ an own (e.g. system-specific) 3D renderer.
+ */
+ class ScenePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- primitive3d::Primitive3DSequence mxChildren3D; // the 3d sub-primitives
- attribute::SdrSceneAttribute maSdrSceneAttribute; // 3d scene attribute set
- attribute::SdrLightingAttribute maSdrLightingAttribute; // lighting attribute set
- basegfx::B2DHomMatrix maObjectTransformation; // object transformation for scene for 2d definition
- geometry::ViewInformation3D maViewInformation3D; // scene transformation set and object transformation
+ /// the 3D geometry definition
+ primitive3d::Primitive3DSequence mxChildren3D;
+
+ /// 3D scene attribute set
+ attribute::SdrSceneAttribute maSdrSceneAttribute;
- // the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
+ /// lighting attribute set
+ attribute::SdrLightingAttribute maSdrLightingAttribute;
+
+ /// object transformation for scene for 2D definition
+ basegfx::B2DHomMatrix maObjectTransformation;
+
+ /// scene transformation set and object transformation
+ geometry::ViewInformation3D maViewInformation3D;
+
+ /// the primitiveSequence for on-demand created shadow primitives (see mbShadow3DChecked)
Primitive2DSequence maShadowPrimitives;
- // bitfield
- // flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
- // are created in maShadowPrimitives
+ /// bitfield
+ /** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
+ are created in maShadowPrimitives
+ */
unsigned mbShadow3DChecked : 1;
- // the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition
+ /// the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition
double mfOldDiscreteSizeX;
double mfOldDiscreteSizeY;
basegfx::B2DRange maOldUnitVisiblePart;
- // private helpers
+ /** the last created BitmapEx, e.g. for fast HitTest. This does not really need
+ memory since BitmapEx is internally RefCounted
+ */
+ BitmapEx maOldRenderedBitmap;
+
+ /// private helpers
bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
- void calculateDsicreteSizes(
+ void calculateDiscreteSizes(
const geometry::ViewInformation2D& rViewInformation,
basegfx::B2DRange& rDiscreteRange,
basegfx::B2DRange& rVisibleDiscreteRange,
basegfx::B2DRange& rUnitVisibleRange) const;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
- // public helpers
- // Geometry extractor. Shadow will be added as in createLocalDecomposition, but
- // the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
- // helper is useful e.g. for Contour extraction or HitTests.
- Primitive2DSequence getGeometry2D(const geometry::ViewInformation2D& rViewInformation) const;
-
- // constructor/destructor
+ /// public helpers
+ /** Geometry extractor. Shadow will be added as in create2DDecomposition, but
+ the 3D content is not converted to a bitmap visualisation but to projected 2D gemetry. This
+ helper is useful e.g. for Contour extraction or HitTests.
+ */
+ Primitive2DSequence getGeometry2D() const;
+ Primitive2DSequence getShadow2D(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /** Fast HitTest which uses the last buffered BitmapEx from the last
+ rendered area if available. The return value describes if the check
+ could be done with the current information, so do NOT use o_rResult
+ when it returns false. o_rResult will be changed on return true and
+ then contains a definitive answer if content of this scene is hit or
+ not. On return false, it is normally necessary to use the geometric
+ HitTest (see CutFindProcessor usages). The given HitPoint
+ has to be in logic coordinates in scene's ObjectCoordinateSystem.
+ */
+ bool tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const;
+
+ /// constructor
ScenePrimitive2D(
const primitive3d::Primitive3DSequence& rxChildren3D,
const attribute::SdrSceneAttribute& rSdrSceneAttribute,
@@ -97,23 +142,23 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rObjectTransformation,
const geometry::ViewInformation3D& rViewInformation3D);
- // get data
+ /// data ead access
const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; }
const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return maSdrSceneAttribute; }
const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return maSdrLightingAttribute; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // get local decomposition. Overloaded since this decomposition is view-dependent
+ /// get local decomposition. Overloaded since this decomposition is view-dependent
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
index b749000ee566..0e3f7258441a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
@@ -46,33 +46,50 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** ShadowPrimitive2D class
+
+ This primitive defines a generic shadow geometry construction
+ for 2D objects. It decomposes to a TransformPrimitive2D embedded
+ into a ModifiedColorPrimitive2D.
+
+ It's for primtive usage convenience, so that not everyone has
+ to implement the generic shadow construction by himself.
+
+ The same geometry as sequence of primitives is used as geometry and
+ as shadow. Since these are RefCounted Uno-Api objects, no extra objects
+ are needed for the shadow itself; all the local decompositions of the
+ original geometry can be reused from the renderer for shadow visualisation.
+ */
class ShadowPrimitive2D : public GroupPrimitive2D
{
private:
+ /// the shadow transformation, normally just an offset
basegfx::B2DHomMatrix maShadowTransform;
- basegfx::BColor maShadowColor;
- protected:
- // create decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// the shadow color to which all geometry is to be forced
+ basegfx::BColor maShadowColor;
public:
+ /// constructor
ShadowPrimitive2D(
const basegfx::B2DHomMatrix& rShadowTransform,
const basegfx::BColor& rShadowColor,
const Primitive2DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
const basegfx::BColor& getShadowColor() const { return maShadowColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx
index 9ccb91e7bebd..c86e4c91bb86 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/structuretagprimitive2d.hxx
@@ -45,30 +45,34 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This class is used to provode simple support for adding grouped
- // pdf writer structured element information like used in sd from
- // unomodel.cxx where a ViewObjectContactRedirector is used to add
- // such information for diverse objects.
- // This primitive encapsulates these and the VCLPdfRenderer uses it
- // to apply the needed infos directly to the pdf export in a compatible
- // way.
- // If a renderer ignores this, it just decomposes to it's child
- // content.
+ /** StructureTagPrimitive2D class
+
+ This class is used to provode simple support for adding grouped
+ pdf writer structured element information like used in sd from
+ unomodel.cxx where a ViewObjectContactRedirector is used to add
+ such information for diverse objects.
+ This primitive encapsulates these and the VCLPdfRenderer uses it
+ to apply the needed infos directly to the pdf export in a compatible
+ way.
+ If a renderer ignores this, it just decomposes to it's child
+ content.
+ */
class StructureTagPrimitive2D : public GroupPrimitive2D
{
private:
- // the PDF structure element this grouping represents
+ /// the PDF structure element this grouping represents
vcl::PDFWriter::StructElement maStructureElement;
public:
+ /// constructor
StructureTagPrimitive2D(
const vcl::PDFWriter::StructElement& rStructureElement,
const Primitive2DSequence& rChildren);
- // data access
+ /// data read access
const vcl::PDFWriter::StructElement& getStructureElement() const { return maStructureElement; }
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
index 69023873760a..fe41c2e1824a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
@@ -37,13 +37,14 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTDECORATEDPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
-namespace basegfx {
- class DecomposedB2DHomMatrixContainer;
-} // end of namespace basegfx
+namespace basegfx { namespace tools {
+ class B2DHomMatrixBufferedOnDemandDecompose;
+}}
namespace com { namespace sun { namespace star { namespace i18n {
struct Boundary;
@@ -55,153 +56,102 @@ namespace drawinglayer
{
namespace primitive2d
{
- // This is used for both underline and overline
- enum FontUnderline
- {
- FONT_UNDERLINE_NONE,
- FONT_UNDERLINE_SINGLE,
- FONT_UNDERLINE_DOUBLE,
- FONT_UNDERLINE_DOTTED,
- FONT_UNDERLINE_DASH,
- FONT_UNDERLINE_LONGDASH,
- FONT_UNDERLINE_DASHDOT,
- FONT_UNDERLINE_DASHDOTDOT,
- FONT_UNDERLINE_SMALLWAVE,
- FONT_UNDERLINE_WAVE,
- FONT_UNDERLINE_DOUBLEWAVE,
- FONT_UNDERLINE_BOLD,
- FONT_UNDERLINE_BOLDDOTTED,
- FONT_UNDERLINE_BOLDDASH,
- FONT_UNDERLINE_BOLDLONGDASH,
- FONT_UNDERLINE_BOLDDASHDOT,
- FONT_UNDERLINE_BOLDDASHDOTDOT,
- FONT_UNDERLINE_BOLDWAVE
- };
-
- enum FontStrikeout
- {
- FONT_STRIKEOUT_NONE,
- FONT_STRIKEOUT_SINGLE,
- FONT_STRIKEOUT_DOUBLE,
- FONT_STRIKEOUT_BOLD,
- FONT_STRIKEOUT_SLASH,
- FONT_STRIKEOUT_X
- };
-
- enum FontEmphasisMark
- {
- FONT_EMPHASISMARK_NONE,
- FONT_EMPHASISMARK_DOT,
- FONT_EMPHASISMARK_CIRCLE,
- FONT_EMPHASISMARK_DISC,
- FONT_EMPHASISMARK_ACCENT
- };
-
- enum FontRelief
- {
- FONT_RELIEF_NONE,
- FONT_RELIEF_EMBOSSED,
- FONT_RELIEF_ENGRAVED
- };
+ /** TextDecoratedPortionPrimitive2D class
+ This primitive expands the TextSimplePortionPrimitive2D by common
+ decorations used in the office. It can be decomposed and will create
+ a TextSimplePortionPrimitive2D and all the contained decorations (if used)
+ as geometry.
+ */
class TextDecoratedPortionPrimitive2D : public TextSimplePortionPrimitive2D
{
private:
+ /// decoration definitions
basegfx::BColor maOverlineColor;
basegfx::BColor maTextlineColor;
- FontUnderline meFontOverline;
- FontUnderline meFontUnderline;
- FontStrikeout meFontStrikeout;
- FontEmphasisMark meFontEmphasisMark;
- FontRelief meFontRelief;
+ TextLine meFontOverline;
+ TextLine meFontUnderline;
+ TextStrikeout meTextStrikeout;
+ TextEmphasisMark meTextEmphasisMark;
+ TextRelief meTextRelief;
- // bitfield
+ /// bitfield
unsigned mbUnderlineAbove : 1;
unsigned mbWordLineMode : 1;
unsigned mbEmphasisMarkAbove : 1;
unsigned mbEmphasisMarkBelow : 1;
unsigned mbShadow : 1;
- // helper methods
- void impCreateTextLine(
- std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
- const basegfx::B2DHomMatrix &rUnscaledTransform,
- FontUnderline eLineStyle,
- double fLineOffset,
- double fLineHeight,
- double fLineWidth,
- const basegfx::BColor& rLineColor) const;
-
+ /// helper methods
void impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes) const;
+ const attribute::FontAttribute& rFontAttribute) const;
void impCorrectTextBoundary(
::com::sun::star::i18n::Boundary& rNextWordBoundary) const;
void impSplitSingleWords(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans) const;
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans) const;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
TextDecoratedPortionPrimitive2D(
- // TextSimplePortionPrimitive2D parameters
+ /// TextSimplePortionPrimitive2D parameters
const basegfx::B2DHomMatrix& rNewTransform,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes,
+ const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor,
- // local parameters
+ /// local parameters
const basegfx::BColor& rOverlineColor,
const basegfx::BColor& rTextlineColor,
- FontUnderline eFontOverline = FONT_UNDERLINE_NONE,
- FontUnderline eFontUnderline = FONT_UNDERLINE_NONE,
+ TextLine eFontOverline = TEXT_LINE_NONE,
+ TextLine eFontUnderline = TEXT_LINE_NONE,
bool bUnderlineAbove = false,
- FontStrikeout eFontStrikeout = FONT_STRIKEOUT_NONE,
+ TextStrikeout eTextStrikeout = TEXT_STRIKEOUT_NONE,
bool bWordLineMode = false,
- FontEmphasisMark eFontEmphasisMark = FONT_EMPHASISMARK_NONE,
+ TextEmphasisMark eTextEmphasisMark = TEXT_EMPHASISMARK_NONE,
bool bEmphasisMarkAbove = true,
bool bEmphasisMarkBelow = false,
- FontRelief eFontRelief = FONT_RELIEF_NONE,
+ TextRelief eTextRelief = TEXT_RELIEF_NONE,
bool bShadow = false);
- // get data
- FontUnderline getFontOverline() const { return meFontOverline; }
- FontUnderline getFontUnderline() const { return meFontUnderline; }
- FontStrikeout getFontStrikeout() const { return meFontStrikeout; }
- FontEmphasisMark getFontEmphasisMark() const { return meFontEmphasisMark; }
- FontRelief getFontRelief() const { return meFontRelief; }
+ /// data read access
+ TextLine getFontOverline() const { return meFontOverline; }
+ TextLine getFontUnderline() const { return meFontUnderline; }
+ TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
+ TextEmphasisMark getTextEmphasisMark() const { return meTextEmphasisMark; }
+ TextRelief getTextRelief() const { return meTextRelief; }
basegfx::BColor getOverlineColor() const { return maOverlineColor; }
basegfx::BColor getTextlineColor() const { return maTextlineColor; }
-
bool getUnderlineAbove() const { return mbUnderlineAbove; }
bool getWordLineMode() const { return mbWordLineMode; }
bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove; }
bool getEmphasisMarkBelow() const { return mbEmphasisMarkBelow; }
bool getShadow() const { return mbShadow; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
index 128b1ea5a210..77b64d16ea24 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
@@ -36,7 +36,7 @@
#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTEFFECTPRIMITIVE2D_HXX
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -45,6 +45,7 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TextEffectStyle2D definition */
enum TextEffectStyle2D
{
TEXTEFFECTSTYLE2D_RELIEF_EMBOSSED_DEFAULT,
@@ -54,46 +55,59 @@ namespace drawinglayer
TEXTEFFECTSTYLE2D_OUTLINE
};
- class TextEffectPrimitive2D : public GroupPrimitive2D
+ /** TextEffectPrimitive2D class
+
+ This primitive embeds text primitives (normally, as can be seen can
+ also be used for any other primitives) which have some TextEffect applied
+ and create the needed geometry and embedding on decomposition.
+ */
+ class TextEffectPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // the style to apply, the direction and the rotation center
+ /// the text (or other) content
+ Primitive2DSequence maTextContent;
+
+ /// the style to apply, the direction and the rotation center
const basegfx::B2DPoint maRotationCenter;
double mfDirection;
TextEffectStyle2D meTextEffectStyle2D;
- // the last used object to view transformtion used from getDecomposition
- // for decide buffering
+ /** the last used object to view transformtion used from getDecomposition
+ for decide buffering
+ */
basegfx::B2DHomMatrix maLastObjectToViewTransformation;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// construcor
TextEffectPrimitive2D(
- const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rTextContent,
const basegfx::B2DPoint& rRotationCenter,
double fDirection,
TextEffectStyle2D eTextEffectStyle2D);
- // get data
+ /// data read access
+ const Primitive2DSequence& getTextContent() const { return maTextContent; }
const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; }
double getDirection() const { return mfDirection; }
TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // own get range implementation to solve more effective. Content is by definition displaced
- // by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
- // own basegfx::B2DRange
+ /** own get range implementation to solve more effective. Content is by definition displaced
+ by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
+ own basegfx::B2DRange
+ */
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
- // Overload standard getDecomposition call to be view-dependent here
+ /// Overload standard getDecomposition call to be view-dependent here
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx
new file mode 100644
index 000000000000..b0e7dc8c241e
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textenumsprimitive2d.hxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: wrongspellprimitive2d.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <vcl/vclenum.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TextLine definition
+
+ This is used for both underline and overline
+ */
+ enum TextLine
+ {
+ TEXT_LINE_NONE,
+ TEXT_LINE_SINGLE,
+ TEXT_LINE_DOUBLE,
+ TEXT_LINE_DOTTED,
+ TEXT_LINE_DASH,
+ TEXT_LINE_LONGDASH,
+ TEXT_LINE_DASHDOT,
+ TEXT_LINE_DASHDOTDOT,
+ TEXT_LINE_SMALLWAVE,
+ TEXT_LINE_WAVE,
+ TEXT_LINE_DOUBLEWAVE,
+ TEXT_LINE_BOLD,
+ TEXT_LINE_BOLDDOTTED,
+ TEXT_LINE_BOLDDASH,
+ TEXT_LINE_BOLDLONGDASH,
+ TEXT_LINE_BOLDDASHDOT,
+ TEXT_LINE_BOLDDASHDOTDOT,
+ TEXT_LINE_BOLDWAVE
+ };
+
+ /** helper to convert LineStyle */
+ TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle);
+ FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle);
+
+ /** FontStrikeout definition */
+ enum TextStrikeout
+ {
+ TEXT_STRIKEOUT_NONE,
+ TEXT_STRIKEOUT_SINGLE,
+ TEXT_STRIKEOUT_DOUBLE,
+ TEXT_STRIKEOUT_BOLD,
+ TEXT_STRIKEOUT_SLASH,
+ TEXT_STRIKEOUT_X
+ };
+
+ /** helper to convert FontStrikeout */
+ TextStrikeout mapFontStrikeoutToTextStrikeout(::FontStrikeout eFontStrikeout);
+ ::FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eFontStrikeout);
+
+ /** TextEmphasisMark definition */
+ enum TextEmphasisMark
+ {
+ TEXT_EMPHASISMARK_NONE,
+ TEXT_EMPHASISMARK_DOT,
+ TEXT_EMPHASISMARK_CIRCLE,
+ TEXT_EMPHASISMARK_DISC,
+ TEXT_EMPHASISMARK_ACCENT
+ };
+
+ /** TextRelief definition */
+ enum TextRelief
+ {
+ TEXT_RELIEF_NONE,
+ TEXT_RELIEF_EMBOSSED,
+ TEXT_RELIEF_ENGRAVED
+ };
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTENUMSPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
index 1160704c0fa3..3f9c02b6e9bd 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
@@ -45,17 +45,23 @@ namespace drawinglayer
{
namespace primitive2d
{
- // text format hierarchy helper class. It decomposes to it's
- // content, so all direct renderers may ignore it. If You need
- // to know more about line hierarchies You may react on it and
- // also need to take care that the source of data uses it.
+ /** TextHierarchyLinePrimitive2D class
+
+ Text format hierarchy helper class. It decomposes to it's
+ content, so all direct renderers may ignore it. If You need
+ to know more about line hierarchies You may react on it and
+ also need to take care that the source of data uses it.
+
+ This primitive encapsulates text lines.
+ */
class TextHierarchyLinePrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyLinePrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -67,14 +73,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- // see TextHierarchyLinePrimitive2D comment
+ /** TextHierarchyBulletPrimitive2D class
+
+ This primitive encapsulates text bullets.
+ */
class TextHierarchyBulletPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyBulletPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -86,14 +96,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- // see TextHierarchyLinePrimitive2D comment
+ /** TextHierarchyParagraphPrimitive2D class
+
+ This primitive encapsulates text paragraphs.
+ */
class TextHierarchyParagraphPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyParagraphPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -105,14 +119,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- // see TextHierarchyLinePrimitive2D comment
+ /** TextHierarchyBlockPrimitive2D class
+
+ This primitive encapsulates text blocks.
+ */
class TextHierarchyBlockPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyBlockPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -124,19 +142,28 @@ namespace drawinglayer
{
namespace primitive2d
{
- // type enum
+ /** FieldType definition */
enum FieldType
{
- FIELD_TYPE_COMMON, // unspecified. If more info is needed for a FieldType,
- // create a new type and it's handling
- FIELD_TYPE_PAGE, // uses "FIELD_SEQ_BEGIN;PageField" -> special handling
- FIELD_TYPE_URL // uses URL as string -> special handling
+ /** unspecified. If more info is needed for a FieldType,
+ create a new type and it's handling
+ */
+ FIELD_TYPE_COMMON,
+
+ /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
+ FIELD_TYPE_PAGE,
+
+ /** uses URL as string -> special handling */
+ FIELD_TYPE_URL
};
- // see TextHierarchyLinePrimitive2D comment.
- // Also: This type uses a type enum to transport the encapsulated field
- // type. Also added is a String which is type-dependent. E.g. for URL
- // fields, it contains the URL.
+ /** TextHierarchyFieldPrimitive2D class
+
+ This primitive encapsulates text fields.
+ Also: This type uses a type enum to transport the encapsulated field
+ type. Also added is a String which is type-dependent. E.g. for URL
+ fields, it contains the URL.
+ */
class TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
{
private:
@@ -144,19 +171,20 @@ namespace drawinglayer
rtl::OUString maString;
public:
+ /// constructor
TextHierarchyFieldPrimitive2D(
const Primitive2DSequence& rChildren,
const FieldType& rFieldType,
const rtl::OUString& rString);
- // get data
+ /// data read access
FieldType getType() const { return meType; }
const rtl::OUString& getString() const { return maString; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -168,20 +196,24 @@ namespace drawinglayer
{
namespace primitive2d
{
- // #i97628#
- // Primitive to encapsulate text from an active text edit; some
- // renderers need to suppress this output due to painting the
- // edited text in e.g. an OutlinerEditView. It's derived from
- // GroupPrimitive2D, so the implicit decomposition will use the
- // content. To suppress, this primitive needs to be parsed by
- // the renderer without taking any action
+ /** TextHierarchyEditPrimitive2D class
+
+ #i97628#
+ Primitive to encapsulate text from an active text edit; some
+ renderers need to suppress this output due to painting the
+ edited text in e.g. an OutlinerEditView. It's derived from
+ GroupPrimitive2D, so the implicit decomposition will use the
+ content. To suppress, this primitive needs to be parsed by
+ the renderer without taking any action.
+ */
class TextHierarchyEditPrimitive2D : public GroupPrimitive2D
{
private:
public:
+ /// constructor
TextHierarchyEditPrimitive2D(const Primitive2DSequence& rChildren);
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
index df09718a7582..f3de43c22fd7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -49,9 +49,10 @@ class VirtualDevice;
class Font;
class String;
class OutputDevice;
+class GDIMetaFile;
-namespace drawinglayer { namespace primitive2d {
- class FontAttributes;
+namespace drawinglayer { namespace attribute {
+ class FontAttribute;
}}
namespace basegfx {
@@ -66,18 +67,27 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TextLayouterDevice class
+
+ This helper class exists to isolate all accesses to VCL
+ text formatting/handling functionality for primitive implementations.
+ When in the future FontHandling may move to an own library independent
+ from VCL, primitives will be prepared.
+ */
class TextLayouterDevice
{
- // internally used VirtualDevice
+ /// internally used VirtualDevice
VirtualDevice& mrDevice;
public:
+ /// constructor/destructor
TextLayouterDevice();
~TextLayouterDevice();
+ /// tooling methods
void setFont(const Font& rFont);
- void setFontAttributes(
- const FontAttributes& rFontAttributes,
+ void setFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
double fFontScaleX,
double fFontScaleY,
const ::com::sun::star::lang::Locale & rLocale);
@@ -105,6 +115,15 @@ namespace drawinglayer
const String& rText,
xub_StrLen nIndex,
xub_StrLen nLength) const;
+
+ double getFontAscent() const;
+ double getFontDescent() const;
+
+ void addTextRectActions(
+ const Rectangle& rRectangle,
+ const String& rText,
+ sal_uInt16 nStyle,
+ GDIMetaFile& rGDIMetaFile);
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -116,23 +135,25 @@ namespace drawinglayer
{
namespace primitive2d
{
- // Create a VCL-Font based on the definitions in FontAttributes
- // and the given FontScaling. The FontScaling defines the FontHeight
- // (fFontScaleY) and the FontWidth (fFontScaleX). The combination of
- // both defines FontStretching, where no stretching happens at
- // fFontScaleY == fFontScaleX
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
+ /** Create a VCL-Font based on the definitions in FontAttribute
+ and the given FontScaling. The FontScaling defines the FontHeight
+ (fFontScaleY) and the FontWidth (fFontScaleX). The combination of
+ both defines FontStretching, where no stretching happens at
+ fFontScaleY == fFontScaleX
+ */
+ Font getVclFontFromFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
const ::com::sun::star::lang::Locale & rLocale);
- // Generate FontAttributes DataSet derived from the given VCL-Font.
- // The FontScaling with fFontScaleY, fFontScaleX relationship (see
- // above) will be set in return parameter o_rSize to allow further
- // processing
- FontAttributes getFontAttributesFromVclFont(
+ /** Generate FontAttribute DataSet derived from the given VCL-Font.
+ The FontScaling with fFontScaleY, fFontScaleX relationship (see
+ above) will be set in return parameter o_rSize to allow further
+ processing
+ */
+ attribute::FontAttribute getFontAttributeFromVclFont(
basegfx::B2DVector& o_rSize,
const Font& rFont,
bool bRTL,
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
new file mode 100644
index 000000000000..a103d607e85f
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textdecoratedprimitive2d.hxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class TextLinePrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometric definitions
+ basegfx::B2DHomMatrix maObjectTransformation;
+ double mfWidth;
+ double mfOffset;
+ double mfHeight;
+
+ /// decoration definitions
+ TextLine meTextLine;
+ basegfx::BColor maLineColor;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextLinePrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ double fOffset,
+ double fHeight,
+ TextLine eTextLine,
+ const basegfx::BColor& rLineColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ double getWidth() const { return mfWidth; }
+ double getOffset() const { return mfOffset; }
+ double getHeight() const { return mfHeight; }
+ TextLine getTextLine() const { return meTextLine; }
+ const basegfx::BColor& getLineColor() const { return maLineColor; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index d7f9bdb1e89a..bbcd8e335e23 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -43,6 +43,7 @@
#include <basegfx/color/bcolor.hxx>
#include <vector>
#include <com/sun/star/lang/Locale.hpp>
+#include <drawinglayer/attribute/fontattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -60,123 +61,91 @@ namespace drawinglayer
{
namespace primitive2d
{
- class FontAttributes
+ /** TextSimplePortionPrimitive2D class
+
+ This is the basic primitive for representing a text portion. It contains
+ all needed information. If it is not handled by a renderer, it's decomposition
+ will provide the text PolyPolygon outlines as filled polygons, correctly
+ transformed.
+
+ To get better text quality, it is suggested to handle tis primitive directly
+ in a renderer. In that case, e.g. hintings on the system can be supported.
+ */
+ class TextSimplePortionPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
- // core data
- String maFamilyName; // Font Family Name
- String maStyleName; // Font Style Name
- sal_uInt16 mnWeight; // Font weight
-
- // bitfield
- unsigned mbSymbol : 1; // Symbol Font Flag
- unsigned mbVertical : 1; // Vertical Text Flag
- unsigned mbItalic : 1; // Italic Flag
- unsigned mbOutline : 1; // Outline Flag
- unsigned mbRTL : 1; // RTL Flag
- unsigned mbBiDiStrong : 1; // BiDi Flag
- // TODO: pair kerning and CJK kerning
+ /// text range transformation from unit range ([0.0 .. 1.0]) to text range
+ basegfx::B2DHomMatrix maTextTransform;
- public:
- FontAttributes(
- const String& rFamilyName,
- const String& rStyleName,
- sal_uInt16 nWeight,
- bool bSymbol = false,
- bool bVertical = false,
- bool bItalic = false,
- bool bOutline = false,
- bool bRTL = false,
- bool bBiDiStrong = false)
- : maFamilyName(rFamilyName),
- maStyleName(rStyleName),
- mnWeight(nWeight),
- mbSymbol(bSymbol),
- mbVertical(bVertical),
- mbItalic(bItalic),
- mbOutline(bOutline),
- mbRTL(bRTL),
- mbBiDiStrong(bBiDiStrong)
- {
- }
-
- // compare operator
- bool operator==(const FontAttributes& rCompare) const;
-
- // data access
- const String& getFamilyName() const { return maFamilyName; }
- const String& getStyleName() const { return maStyleName; }
- sal_uInt16 getWeight() const { return mnWeight; }
- bool getSymbol() const { return mbSymbol; }
- bool getVertical() const { return mbVertical; }
- bool getItalic() const { return mbItalic; }
- bool getOutline() const { return mbOutline; }
- bool getRTL() const { return mbRTL; }
- bool getBiDiStrong() const { return mbBiDiStrong; }
- };
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
+ /// The text, used from maTextPosition up to maTextPosition + maTextLength
+ String maText;
-//////////////////////////////////////////////////////////////////////////////
+ /// The index from where on maText is used
+ xub_StrLen maTextPosition;
-namespace drawinglayer
-{
- namespace primitive2d
- {
- class TextSimplePortionPrimitive2D : public BasePrimitive2D
- {
- private:
- basegfx::B2DHomMatrix maTextTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
- String maText; // the text, used from maTextPosition up to maTextPosition + maTextLength
- xub_StrLen maTextPosition; // the index from where on maText is used
- xub_StrLen maTextLength; // the length for maText usage, starting from maTextPosition
- ::std::vector< double > maDXArray; // the DX array scale-independent in unit coordinates
- FontAttributes maFontAttributes; // the font to use
- ::com::sun::star::lang::Locale maLocale; // the Locale for the text
- basegfx::BColor maFontColor; // font color
-
- // #i96669# add simple range buffering for this primitive
+ /// The length for maText usage, starting from maTextPosition
+ xub_StrLen maTextLength;
+
+ /// The DX array scale-independent in unit coordinates
+ ::std::vector< double > maDXArray;
+
+ /// The font to use
+ attribute::FontAttribute maFontAttribute;
+
+ /// The Locale for the text
+ ::com::sun::star::lang::Locale maLocale;
+
+ /// font color
+ basegfx::BColor maFontColor;
+
+ /// #i96669# add simple range buffering for this primitive
basegfx::B2DRange maB2DRange;
protected:
- // local decomposition.
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes,
+ const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor);
- // helpers
- // get text outlines as polygons and their according ObjectTransformation. Handles all
- // the necessary VCL outline extractins, scaling adaptions and other stuff.
+ /// helpers
+ /** get text outlines as polygons and their according ObjectTransformation. Handles all
+ the necessary VCL outline extractins, scaling adaptions and other stuff.
+ */
void getTextOutlinesAndTransformation(basegfx::B2DPolyPolygonVector& rTarget, basegfx::B2DHomMatrix& rTransformation) const;
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTextTransform() const { return maTextTransform; }
const String& getText() const { return maText; }
xub_StrLen getTextPosition() const { return maTextPosition; }
xub_StrLen getTextLength() const { return maTextLength; }
const ::std::vector< double >& getDXArray() const { return maDXArray; }
- const FontAttributes& getFontAttributes() const { return maFontAttributes; }
+ const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
const basegfx::BColor& getFontColor() const { return maFontColor; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
+
+ /// small helper to have a compare operator for Locale
+ bool LocalesAreEqual(const ::com::sun::star::lang::Locale& rA, const ::com::sun::star::lang::Locale& rB);
+
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
new file mode 100644
index 000000000000..34d7d31fb93a
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textdecoratedprimitive2d.hxx,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/attribute/fontattribute.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D
+ {
+ private:
+ /// geometric definitions
+ basegfx::B2DHomMatrix maObjectTransformation;
+ double mfWidth;
+
+ /// decoration definitions
+ basegfx::BColor maFontColor;
+
+ public:
+ /// constructor
+ BaseTextStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
+ double getWidth() const { return mfWidth; }
+ const basegfx::BColor& getFontColor() const { return maFontColor; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
+ {
+ private:
+ sal_Unicode maStrikeoutChar;
+ attribute::FontAttribute maFontAttribute;
+ ::com::sun::star::lang::Locale maLocale;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextCharacterStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor,
+ sal_Unicode aStrikeoutChar,
+ const attribute::FontAttribute& rFontAttribute,
+ const ::com::sun::star::lang::Locale& rLocale);
+
+ /// data read access
+ sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; }
+ const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
+ const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ class TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D
+ {
+ private:
+ double mfHeight;
+ double mfOffset;
+ TextStrikeout meTextStrikeout;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ TextGeometryStrikeoutPrimitive2D(
+ const basegfx::B2DHomMatrix& rObjectTransformation,
+ double fWidth,
+ const basegfx::BColor& rFontColor,
+ double fHeight,
+ double fOffset,
+ TextStrikeout eTextStrikeout);
+
+ /// data read access
+ double getHeight() const { return mfHeight; }
+ double getOffset() const { return mfOffset; }
+ TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
+
+ /// compare operator
+ virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
index 1646667342af..1723cc708ea8 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
@@ -45,26 +45,47 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TransformPrimitive2D class
+
+ This is one of the basic grouping primitives and it provides
+ embedding a sequence of primitives (a geometry) into a
+ transformation. All renderers have to handle this, usually by
+ building a current transformation stack (linear combination)
+ and applying this to all to-be-rendered geometry. If not handling
+ this, the output will be mostly wrong since this primitive is
+ widely used.
+
+ It does transform by embedding an existing geometry into a
+ transformation as Child-content. This allows re-usage of the
+ refcounted Uno-Api primitives and their existung, buffered
+ decompositions.
+
+ It could e.g. be used to show a single object geometry in 1000
+ different, transformed states without the need to create those
+ thousand primitive contents.
+ */
class TransformPrimitive2D : public GroupPrimitive2D
{
private:
+ // the transformation to apply to the child geometry
basegfx::B2DHomMatrix maTransformation;
public:
+ /// constructor
TransformPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
const Primitive2DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
index 44f3f738b67e..6e8970e7bee5 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
@@ -44,27 +44,37 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** UnifiedAlphaPrimitive2D class
+
+ This primitive encapsualtes a child hierarchy and defines
+ that it shall be visualized with the given transparency. That
+ transparency is unique for all contained geometry, so that
+ e.g. overlapping polygons in the child geometry will not show
+ regions of combined transparency, but be all rendered with the
+ defined, single transparency.
+ */
class UnifiedAlphaPrimitive2D : public GroupPrimitive2D
{
private:
- double mfAlpha; // unified transparence
-
- protected:
- // create decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// the unified alpha transparence
+ double mfAlpha;
public:
+ /// constructor
UnifiedAlphaPrimitive2D(
const Primitive2DSequence& rChildren,
double fAlpha);
- // get data
+ /// data read access
double getAlpha() const { return mfAlpha; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
new file mode 100644
index 000000000000..ffe47cfe1b72
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bitmapprimitive2d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/wall.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** WallpaperBitmapPrimitive2D class
+
+ This is a specialized primtive for the Wallpaper definitions included in
+ VCL and Metafiles. The extraordinary about the bitmap definition part of
+ the Wallpaper is that it uses PIXEL size of the given Bitmap and not
+ the logic and/or discrete size derived by PrefMapMode/PrefSize methods.
+ To emulate this, a ViewTransformation dependent primitive is needed which
+ takes over the correct scaling(s).
+
+ Since a specialized primitive is needed anyways, i opted to also add the
+ layouting which is dependent from WallpaperStyle; thus it does not need
+ to be handled anywhere else in the future.
+ */
+ class WallpaperBitmapPrimitive2D : public ViewTransformationDependentPrimitive2D
+ {
+ private:
+ basegfx::B2DRange maObjectRange;
+ BitmapEx maBitmapEx;
+ WallpaperStyle meWallpaperStyle;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ WallpaperBitmapPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const BitmapEx& rBitmapEx,
+ WallpaperStyle eWallpaperStyle);
+
+ /// data read access
+ const basegfx::B2DRange& getLocalObjectRange() const { return maObjectRange; }
+ const BitmapEx& getBitmapEx() const { return maBitmapEx ; }
+ WallpaperStyle getWallpaperStyle() const { return meWallpaperStyle; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get B2Drange
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_WALLPAPERPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
index 8bd739298059..3ceae01ed3b2 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
@@ -47,35 +47,53 @@ namespace drawinglayer
{
namespace primitive2d
{
- class WrongSpellPrimitive2D : public BasePrimitive2D
+ /** WrongSpellPrimitive2D class
+
+ This is a helper primitive to hold evtl. WrongSpell visualisations
+ in the sequence of primitives. The primitive holds this information
+ separated form the TextPortions to where it belongs to tot expand the
+ TextSimplePortionPrimitive2D more as needed.
+
+ A renderer who does not want to visualize this (if contained at all)
+ can detect and ignore this primitive. If it's decomposition is used,
+ it will be visualized as red wavelines.
+
+ The geometric definition defines a line on the X-Axis (no Y-coordinates)
+ which will when transformed by Transformation, create the coordinate data.
+ */
+ class WrongSpellPrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
+ /// geometry definition
basegfx::B2DHomMatrix maTransformation;
double mfStart;
double mfStop;
+
+ /// color (usually red)
basegfx::BColor maColor;
protected:
- // create local decomposition
- virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
+ /// constructor
WrongSpellPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
double fStart,
double fStop,
const basegfx::BColor& rColor);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
double getStart() const { return mfStart; }
double getStop() const { return mfStop; }
const basegfx::BColor& getColor() const { return maColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
index faeac28b0c0c..9bf56edb2c53 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
@@ -43,16 +43,17 @@
#include <basegfx/range/b3drange.hxx>
//////////////////////////////////////////////////////////////////////////////
-// defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock
-// Added to be able to simply change identification stuff later, e.g. add
-// a identification string and/or ID to the interface and to the implementation
-// ATM used to delclare implement getPrimitiveID()
+/** defines for DeclPrimitrive3DIDBlock and ImplPrimitrive3DIDBlock
+ Added to be able to simply change identification stuff later, e.g. add
+ a identification string and/or ID to the interface and to the implementation
+ ATM used to delclare implement getPrimitive3DID()
+ */
#define DeclPrimitrive3DIDBlock() \
- virtual sal_uInt32 getPrimitiveID() const;
+ virtual sal_uInt32 getPrimitive3DID() const;
#define ImplPrimitrive3DIDBlock(TheClass, TheID) \
- sal_uInt32 TheClass::getPrimitiveID() const { return TheID; }
+ sal_uInt32 TheClass::getPrimitive3DID() const { return TheID; }
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -61,6 +62,13 @@ namespace drawinglayer { namespace geometry {
class ViewInformation3D;
}}
+namespace drawinglayer { namespace primitive3d {
+ /// typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference
+ typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference;
+ typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence;
+}}
+
//////////////////////////////////////////////////////////////////////////////
// basePrimitive3D class
@@ -68,99 +76,145 @@ namespace drawinglayer
{
namespace primitive3d
{
- // typedefs for basePrimitive3DImplBase, Primitive3DSequence and Primitive3DReference
- typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitive3D > BasePrimitive3DImplBase;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive3D > Primitive3DReference;
- typedef ::com::sun::star::uno::Sequence< Primitive3DReference > Primitive3DSequence;
+ /** BasePrimitive3D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ The description/functionality is identical with the 2D case in baseprimitive2d.hxx,
+ please see there for detailed information.
+ Current Basic 3D Primitives are:
+
+ - PolygonHairlinePrimitive3D (for 3D hairlines)
+ - PolyPolygonMaterialPrimitive3D (for 3D filled plane polygons)
+
+ That's all for 3D!
+ */
class BasePrimitive3D
: private boost::noncopyable,
protected comphelper::OBaseMutex,
public BasePrimitive3DImplBase
{
private:
- // a sequence used for buffering the last createLocalDecomposition() result. Use
- // the protected access methods to change. Only implementations of getDecomposition()
- // should make use.
- Primitive3DSequence maLocalDecomposition;
-
protected:
- // access methods to maLocalDecomposition. The usage of this methods may allow
- // later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
- // implementations for buffering the last decomposition.
- const Primitive3DSequence& getLocalDecomposition() const { return maLocalDecomposition; }
- void setLocalDecomposition(const Primitive3DSequence& rNew) { maLocalDecomposition = rNew; }
-
- // method which is to be used to implement the local decomposition of a 2D primitive. The default
- // implementation will just return an empty decomposition
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
- // constructor
+ // constructor/destructor
BasePrimitive3D();
+ virtual ~BasePrimitive3D();
- // the ==operator is mainly needed to allow testing newly-created high level primitives against their last
- // incarnation which buffers/holds the decompositionsThe default implementation
- // uses getPrimitiveID()-calls to test if it's the same ID at last. Overloaded implementation are then
- // based on this implementation
+ /** the ==operator is mainly needed to allow testing newly-created high level primitives against their last
+ incarnation which buffers/holds the decompositionsThe default implementation
+ uses getPrimitive3DID()-calls to test if it's the same ID at last. Overloaded implementation are then
+ based on this implementation.
+ */
virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
bool operator!=( const BasePrimitive3D& rPrimitive ) const { return !operator==(rPrimitive); }
- // This method is for places where using the C++ implementation directly is possible. The subprocessing
- // and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation
- // will use getDecomposition results to create the range
+ /** This method is for places where using the C++ implementation directly is possible. The subprocessing
+ and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation
+ will use getDecomposition results to create the range
+ */
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID for fast identifying of known primitive implementations in renderers. These use
- // the the defines from primitivetypes3d.hxx to define unique IDs.
- virtual sal_uInt32 getPrimitiveID() const = 0;
+ /** provide unique ID for fast identifying of known primitive implementations in renderers. These use
+ the the defines from primitivetypes3d.hxx to define unique IDs.
+ */
+ virtual sal_uInt32 getPrimitive3DID() const = 0;
- // The getDecomposition default implementation will on demand use createLocalDecomposition() if maLocalDecomposition is empty.
- // It will set maLocalDecomposition to this obtained decomposition to buffer it.
- // If the decomposition is also ViewInformation-dependent, this method needs to be overloaded and the
- // ViewInformation for the last decomposition needs to be remembered, too, and be used in the next call to decide if
- // the buffered decomposition may be reused or not.
+ /// The default implementation returns an empty sequence
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
//
// Methods from XPrimitive3D
//
- // The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
- // will get the ViewInformation from the ViewParameters for that purpose
+ /** The getDecomposition implementation for UNO API will use getDecomposition from this implementation. It
+ will get the ViewInformation from the ViewParameters for that purpose
+ */
virtual Primitive3DSequence SAL_CALL getDecomposition( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
- // the getRange default implemenation will use getDecomposition to create the range information from merging
- // getRange results from the single local decomposition primitives.
+ /** the getRange default implemenation will use getDecomposition to create the range information from merging
+ getRange results from the single local decomposition primitives.
+ */
virtual ::com::sun::star::geometry::RealRectangle3D SAL_CALL getRange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters ) throw ( ::com::sun::star::uno::RuntimeException );
};
} // end of namespace primitive3d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+// BufferedDecompositionPrimitive3D class
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ /** BufferedDecompositionPrimitive3D class
+
+ Baseclass for all C++ implementations of com::sun::star::graphic::XPrimitive2D
+
+ The description/functionality is identical with the 2D case in baseprimitive2d.hxx,
+ please see there for detailed information
+ */
+ class BufferedDecompositionPrimitive3D
+ : public BasePrimitive3D
+ {
+ private:
+ /// a sequence used for buffering the last create3DDecomposition() result
+ Primitive3DSequence maBuffered3DDecomposition;
+
+ protected:
+ /** access methods to maBuffered3DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
+ void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
+
+ /** method which is to be used to implement the local decomposition of a 2D primitive. The default
+ implementation will just return an empty decomposition
+ */
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ public:
+ // constructor
+ BufferedDecompositionPrimitive3D();
+
+ /** The getDecomposition default implementation will on demand use create3DDecomposition() if
+ maBuffered3DDecomposition is empty. It will set maBuffered3DDecomposition to this obtained decomposition
+ to buffer it. If the decomposition is also ViewInformation-dependent, this method needs to be
+ overloaded and the ViewInformation for the last decomposition needs to be remembered, too, and
+ be used in the next call to decide if the buffered decomposition may be reused or not.
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// tooling
namespace drawinglayer
{
namespace primitive3d
{
- // get B3DRange from a given Primitive3DReference
+ /// get B3DRange from a given Primitive3DReference
basegfx::B3DRange getB3DRangeFromPrimitive3DReference(const Primitive3DReference& rCandidate, const geometry::ViewInformation3D& aViewInformation);
- // get range3D from a given Primitive3DSequence
+ /// get range3D from a given Primitive3DSequence
basegfx::B3DRange getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, const geometry::ViewInformation3D& aViewInformation);
- // compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
- // and using compare operator
+ /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
+ and using compare operator
+ */
bool arePrimitive3DReferencesEqual(const Primitive3DReference& rA, const Primitive3DReference& rB);
- // compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally
+ /// compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally
bool arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB);
- // concatenate sequence
+ /// concatenate sequence
void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource);
- // concatenate single Primitive3D
+ /// concatenate single Primitive3D
void appendPrimitive3DReferenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DReference& rSource);
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
index 029b4c664fe2..69e406c75d67 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
@@ -44,27 +44,45 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** GroupPrimitive3D class
+
+ Baseclass for all grouping 3D primitives
+
+ The description/functionality is identical with the 2D case in groupprimitive2d.hxx,
+ please see there for detailed information.
+
+ Current Basic 3D StatePrimitives are:
+
+ - ModifiedColorPrimitive3D (for a stack of color modifications)
+ - ShadowPrimitive3D (for 3D objects with shadow; this is a special case
+ since the shadow of a 3D primitive is a 2D primitive set)
+ - TexturePrimitive3D (with the following variations)
+ - GradientTexturePrimitive3D (for 3D gradient fill)
+ - BitmapTexturePrimitive3D (for 3D Bitmap fill)
+ - AlphaTexturePrimitive3D (for 3D transparence)
+ - HatchTexturePrimitive3D (for 3D hatch fill)
+ - TransformPrimitive3D (for a transformation stack)
+ */
class GroupPrimitive3D : public BasePrimitive3D
{
private:
- // the children. Declared private since this shall never be changed at all after construction
+ /// the children. Declared private since this shall never be changed at all after construction
Primitive3DSequence maChildren;
- protected:
- // local decomposition. Implementation will just return children
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
- // constructor
+ /// constructor
GroupPrimitive3D(const Primitive3DSequence& rChildren);
- // data access
+ /// data read access
Primitive3DSequence getChildren() const { return maChildren; }
- // compare operator
+ /// compare operator
virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
- // provide unique ID
+ /// local decomposition. Implementation will just return children
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
index c1feccaaa10c..2675a1284779 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
@@ -44,16 +44,32 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** HatchTexturePrimitive3D class
+
+ HatchTexturePrimitive3D is derived from GroupPrimitive3D, but implements
+ a decomposition which is complicated enough for buffering. Since the group
+ primitive has no default buffering, it is necessary here to add a local
+ buffering mechanism for the decomposition
+ */
class HatchTexturePrimitive3D : public TexturePrimitive3D
{
private:
+ /// the hatch definition
attribute::FillHatchAttribute maHatch;
+ /// the buffered decomposed hatch
+ Primitive3DSequence maBuffered3DDecomposition;
+
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// helper: local decomposition
+ Primitive3DSequence impCreate3DDecomposition() const;
+
+ /// local access methods to maBufferedDecomposition
+ const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
+ void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
public:
+ /// constructor
HatchTexturePrimitive3D(
const attribute::FillHatchAttribute& rHatch,
const Primitive3DSequence& rChildren,
@@ -61,13 +77,16 @@ namespace drawinglayer
bool bModulate,
bool bFilter);
- // get data
+ /// data read access
const attribute::FillHatchAttribute& getHatch() const { return maHatch; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// local decomposition.
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
index 28029f223b1b..4779241033b0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
@@ -44,32 +44,37 @@ namespace drawinglayer
{
namespace primitive3d
{
- // This primitive is used to represent geometry for non-visible objects,
- // e.g. a 3D cube without fill attributes. To still be able to use
- // primitives for HitTest functionality, the 3d decompositions produce
- // an as much as possible simplified fill geometry encapsulated in this
- // primtive when there is no fill geometry. Currently, the 3d hit test
- // uses only areas, so maybe in a further enchanced version this will change
- // to 'if neither filled nor lines' creation criteria. The whole primitive
- // decomposes to nothing, so no one not knowing it will be influenced. Only
- // helper processors for hit test (and maybe BoundRect extractors) will
- // use it and it's children subcontent.
+ /** HitTestPrimitive3D class
+
+ This primitive is used to represent geometry for non-visible objects,
+ e.g. a 3D cube without fill attributes. To still be able to use
+ primitives for HitTest functionality, the 3d decompositions produce
+ an as much as possible simplified fill geometry encapsulated in this
+ primtive when there is no fill geometry. Currently, the 3d hit test
+ uses only areas, so maybe in a further enchanced version this will change
+ to 'if neither filled nor lines' creation criteria. The whole primitive
+ decomposes to nothing, so no one not knowing it will be influenced. Only
+ helper processors for hit test (and maybe BoundRect extractors) will
+ use it and it's children subcontent.
+ */
class HitTestPrimitive3D : public GroupPrimitive3D
{
- protected:
- // local decomposition. Implementation will return empty Primitive3DSequence
- // since this is no visualisation data
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
+ /// constructor
HitTestPrimitive3D(const Primitive3DSequence& rChildren);
- // despite returning an empty decomposition since it's no visualisation data,
- // range calculation is intended to use invisible replacement geometry, so
- // the local implementation will return the children's range
+ /** despite returning an empty decomposition since it's no visualisation data,
+ range calculation is intended to use invisible replacement geometry, so
+ the local implementation will return the children's range
+ */
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /** local decomposition. Implementation will return empty Primitive3DSequence
+ since this is no visualisation data
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
index 0771e8117fc5..3840bf71a397 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
@@ -45,23 +45,32 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** ModifiedColorPrimitive3D class
+
+ This primitive is a grouping primitive and allows to define
+ how the colors of it's child content shall be modified for
+ visualisation. Please see the ModifiedColorPrimitive2D
+ description for more info.
+ */
class ModifiedColorPrimitive3D : public GroupPrimitive3D
{
private:
+ /// The ColorModifier to use
basegfx::BColorModifier maColorModifier;
public:
+ /// constructor
ModifiedColorPrimitive3D(
const Primitive3DSequence& rChildren,
const basegfx::BColorModifier& rColorModifier);
- // get data
+ /// data read access
const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
index 9de2dc5949e7..c73850e4f794 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
@@ -48,28 +48,40 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** PolygonHairlinePrimitive3D class
+
+ This primitive defines a Hairline in 3D. Since hairlines are view-dependent,
+ this primitive is view-dependent, too.
+
+ This is one of the non-decomposable 3D primitives, so a renderer
+ should proccess it.
+ */
class PolygonHairlinePrimitive3D : public BasePrimitive3D
{
private:
+ /// the hairline geometry
basegfx::B3DPolygon maPolygon;
+
+ /// the hairline color
basegfx::BColor maBColor;
public:
+ /// constructor
PolygonHairlinePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const basegfx::BColor& rBColor);
- // get data
+ /// data read access
const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -81,36 +93,49 @@ namespace drawinglayer
{
namespace primitive3d
{
- class PolygonStrokePrimitive3D : public BasePrimitive3D
+ /** PolygonStrokePrimitive3D class
+
+ This primitive defines a 3D line with line width, line join, line color
+ and stroke attributes. It will be decomposed dependent on the definition
+ to the needed primitives, e.g. filled Tubes for fat lines.
+ */
+ class PolygonStrokePrimitive3D : public BufferedDecompositionPrimitive3D
{
private:
+ /// the line geometry
basegfx::B3DPolygon maPolygon;
+
+ /// the line attributes like width, join and color
attribute::LineAttribute maLineAttribute;
+
+ /// the line stroking (if used)
attribute::StrokeAttribute maStrokeAttribute;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
PolygonStrokePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute);
+ /// constructor without stroking
PolygonStrokePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute);
- // get data
+ /// data read access
basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; }
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
index 8a9b293a8c5e..f5d45f7c1639 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
@@ -52,19 +52,38 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** PolygonStrokePrimitive3D class
+
+ This 3D primitive extends a 3D hairline to a 3D tube which is
+ e.g. used for fat lines in 3D. It's decomposition will create all
+ 3D objects needed for the line tubes and the edge roundings
+ in full 3D.
+ */
class PolygonTubePrimitive3D : public PolygonHairlinePrimitive3D
{
private:
+ /// hold the last decompositon since it's expensive
+ Primitive3DSequence maLast3DDecomposition;
+
+ /// visualisation parameters
double mfRadius;
double mfDegreeStepWidth;
double mfMiterMinimumAngle;
basegfx::B2DLineJoin maLineJoin;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /** access methods to maLast3DDecomposition. The usage of this methods may allow
+ later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
+ implementations for buffering the last decomposition.
+ */
+ const Primitive3DSequence& getLast3DDecomposition() const { return maLast3DDecomposition; }
+ void setLast3DDecomposition(const Primitive3DSequence& rNew) { maLast3DDecomposition = rNew; }
+
+ /// local decomposition.
+ Primitive3DSequence impCreate3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
PolygonTubePrimitive3D(
const basegfx::B3DPolygon& rPolygon,
const basegfx::BColor& rBColor,
@@ -72,16 +91,21 @@ namespace drawinglayer
double fDegreeStepWidth = 10.0 * F_PI180,
double fMiterMinimumAngle = 15.0 * F_PI180);
- // get data
+ /// data read access
double getRadius() const { return mfRadius; }
double getDegreeStepWidth() const { return mfDegreeStepWidth; }
double getMiterMinimumAngle() const { return mfMiterMinimumAngle; }
basegfx::B2DLineJoin getLineJoin() const { return maLineJoin; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /** local decomposition. Use own buffering since we are not derived from
+ BufferedDecompositionPrimitive3D
+ */
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
index 1c5b9e400bbb..091e8181e38f 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
@@ -46,33 +46,45 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** PolyPolygonMaterialPrimitive3D class
+
+ This primitive defines a planar 3D PolyPolygon filled with a single color.
+ This is one of the non-decomposable primitives, so a renderer
+ should proccess it.
+
+ It is assumed here that the PolyPolgon is a single plane in 3D.
+ */
class PolyPolygonMaterialPrimitive3D : public BasePrimitive3D
{
private:
+ /// the PolyPolygon geometry
basegfx::B3DPolyPolygon maPolyPolygon;
+
+ /// the fill parameters
attribute::MaterialAttribute3D maMaterial;
- // bitfield
+ /// bitfield
unsigned mbDoubleSided : 1;
public:
+ /// constructor
PolyPolygonMaterialPrimitive3D(
const basegfx::B3DPolyPolygon& rPolyPolygon,
const attribute::MaterialAttribute3D& rMaterial,
bool bDoubleSided);
- // get data
+ /// data read access
const basegfx::B3DPolyPolygon& getB3DPolyPolygon() const { return maPolyPolygon; }
const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
bool getDoubleSided() const { return mbDoubleSided; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
index 57f31a46a557..b3a57f2677dc 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
@@ -44,26 +44,33 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrCubePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D cube definition.
+ The cube is implicitely in unit coordinates and the given transformation
+ defines it's geometry in space.
+ */
class SdrCubePrimitive3D : public SdrPrimitive3D
{
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
index 772e030781fe..5b793a6928f8 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
@@ -42,6 +42,7 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
namespace basegfx {
class B3DPolygon;
class B3DPolyPolygon;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
index 43ae13d4625f..b80198d127d2 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx
@@ -53,7 +53,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- // Slice3D types
+ /** SliceType3D definition */
enum SliceType3D
{
SLICETYPE3D_REGULAR, // normal geoemtry Slice3D
@@ -61,7 +61,7 @@ namespace drawinglayer
SLICETYPE3D_BACKCAP // back cap
};
- // class to hold one Slice3D
+ /// class to hold one Slice3D
class Slice3D
{
protected:
@@ -92,10 +92,10 @@ namespace drawinglayer
SliceType3D getSliceType() const { return maSliceType; }
};
- // typedef for a group of Slice3Ds
+ /// typedef for a group of Slice3Ds
typedef ::std::vector< Slice3D > Slice3DVector;
- // helpers for creation
+ /// helpers for creation
void createLatheSlices(
Slice3DVector& rSliceVector,
const basegfx::B2DPolyPolygon& rSource,
@@ -117,7 +117,7 @@ namespace drawinglayer
bool bCloseFront,
bool bCloseBack);
- // helpers for geometry extraction
+ /// helpers for geometry extraction
basegfx::B3DPolyPolygon extractHorizontalLinesFromSlice(const Slice3DVector& rSliceVector, bool bCloseHorLines);
basegfx::B3DPolyPolygon extractVerticalLinesFromSlice(const Slice3DVector& rSliceVector);
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
index a6d386bf194a..a810e0f5ec8e 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
@@ -45,23 +45,34 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrExtrudePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D extrude definition.
+ The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D
+ and gets extruded in Z-Direction by Depth.
+
+ Various possibilities e.g. for creating diagonals (edge roudings in 3D)
+ and similar are given.
+
+ The decomposition will create all necessary 3D planes for visualisation.
+ */
class SdrExtrudePrimitive3D : public SdrPrimitive3D
{
private:
- // geometry helper for slices
+ /// geometry helper for slices
basegfx::B2DPolyPolygon maCorrectedPolyPolygon;
Slice3DVector maSlices;
- // primitive data
+ /// primitive geometry data
basegfx::B2DPolyPolygon maPolyPolygon;
double mfDepth;
double mfDiagonal;
double mfBackScale;
- // decomposition data when ReducedLineGeometry is used, see get3DDecomposition
+ /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
geometry::ViewInformation3D* mpLastRLGViewInformation;
- // bitfield
+ /// bitfield
unsigned mbSmoothNormals : 1; // Plane self
unsigned mbSmoothHorizontalNormals : 1; // always
unsigned mbSmoothLids : 1; // Front/back
@@ -69,17 +80,18 @@ namespace drawinglayer
unsigned mbCloseFront : 1;
unsigned mbCloseBack : 1;
- // create slices
+ /// create slices
void impCreateSlices();
- // get (evtl. create) slices
+ /// get (evtl. create) slices
const Slice3DVector& getSlices() const;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrExtrudePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
@@ -97,7 +109,7 @@ namespace drawinglayer
bool bCloseBack);
virtual ~SdrExtrudePrimitive3D();
- // data access
+ /// data read access
const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
double getDepth() const { return mfDepth; }
double getDiagonal() const { return mfDiagonal; }
@@ -109,16 +121,16 @@ namespace drawinglayer
bool getCloseFront() const { return mbCloseFront; }
bool getCloseBack() const { return mbCloseBack; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
+ /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
index 99d06e256431..084ce5bce35e 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
@@ -45,14 +45,25 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrLathePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D rotation definition.
+ The given 2D PolyPolygon geometry is imagined as lying on the XY-plane in 3D
+ and gets rotated around the Y-Axis.
+
+ Various possibilities e.g. for creating diagonals (edge roudings in 3D)
+ and similar are given.
+
+ The decomposition will create all necessary 3D planes for visualisation.
+ */
class SdrLathePrimitive3D : public SdrPrimitive3D
{
private:
- // geometry helper for slices
+ /// geometry helper for slices
basegfx::B2DPolyPolygon maCorrectedPolyPolygon;
Slice3DVector maSlices;
- // primitive data
+ /// primitive geometry data
basegfx::B2DPolyPolygon maPolyPolygon;
sal_uInt32 mnHorizontalSegments;
sal_uInt32 mnVerticalSegments;
@@ -60,10 +71,10 @@ namespace drawinglayer
double mfBackScale;
double mfRotation;
- // decomposition data when ReducedLineGeometry is used, see get3DDecomposition
+ /// decomposition data when ReducedLineGeometry is used, see get3DDecomposition
geometry::ViewInformation3D* mpLastRLGViewInformation;
- // bitfield
+ /// bitfield
unsigned mbSmoothNormals : 1; // Plane self
unsigned mbSmoothHorizontalNormals : 1; // always
unsigned mbSmoothLids : 1; // Front/back
@@ -71,14 +82,14 @@ namespace drawinglayer
unsigned mbCloseFront : 1;
unsigned mbCloseBack : 1;
- // create slices
+ /// create slices
void impCreateSlices();
- // get (evtl. create) slices
+ /// get (evtl. create) slices
const Slice3DVector& getSlices() const;
protected:
- // local helpers
+ /// local helpers
void impCreateOutlines(
const geometry::ViewInformation3D& rViewInformation,
const basegfx::B3DPolygon& rLoopA,
@@ -90,10 +101,11 @@ namespace drawinglayer
const basegfx::B2DPoint& rStart,
const basegfx::B2DPoint& rEnd) const;
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrLathePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
@@ -113,7 +125,7 @@ namespace drawinglayer
bool bCloseBack);
virtual ~SdrLathePrimitive3D();
- // data access
+ /// data read access
const basegfx::B2DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
@@ -127,16 +139,16 @@ namespace drawinglayer
bool getCloseFront() const { return mbCloseFront; }
bool getCloseBack() const { return mbCloseBack; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
+ /// Overloaded to allow for reduced line mode to decide if to buffer decomposition or not
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
index 4eec829afeb5..a6c68bd16da8 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
@@ -44,17 +44,28 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrPolyPolygonPrimitive3D class
+
+ This 3D primitive defines a PolyPolgon in space which may have
+ Line- and FillStyles and extra 3D surface attributes. It is assumed
+ that the given 3D PolyPolgon (which may contain texture and normal
+ information) is planar in 3D.
+
+ The decomposition will include all needed 3D data for visualisation,
+ including FatLines and fill styles.
+ */
class SdrPolyPolygonPrimitive3D : public SdrPrimitive3D
{
private:
- // the polyPolygon evtl with normals and texture coordinates
+ /// the planar polyPolygon evtl with normals and texture coordinates
basegfx::B3DPolyPolygon maPolyPolygon3D;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrPolyPolygonPrimitive3D(
const basegfx::B3DPolyPolygon& rPolyPolygon3D,
const basegfx::B3DHomMatrix& rTransform,
@@ -62,16 +73,16 @@ namespace drawinglayer
const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- // data access
+ /// data access
const basegfx::B3DPolyPolygon& getPolyPolygon3D() const { return maPolyPolygon3D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
index 6b381445716e..4dd620848387 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
@@ -47,39 +47,49 @@
namespace drawinglayer
{
+ /** SdrPrimitive3D class
+
+ Base class for the more complicated geometric primitives, so
+ derive from buffered primitive to allow overloading of
+ create3DDecomposition there.
+ */
namespace primitive3d
{
- class SdrPrimitive3D : public BasePrimitive3D
+ class SdrPrimitive3D : public BufferedDecompositionPrimitive3D
{
private:
+ /// object surface attributes
basegfx::B3DHomMatrix maTransform;
basegfx::B2DVector maTextureSize;
attribute::SdrLineFillShadowAttribute maSdrLFSAttribute;
attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute;
protected:
- // Standard implementation for primitive3D which
- // will use maTransform as range and expand by evtl. line width / 2
+ /** Standard implementation for primitive3D which
+ will use maTransform as range and expand by evtl. line width / 2
+ */
basegfx::B3DRange getStandard3DRange() const;
- // implementation for primitive3D which
- // will use given Slice3Ds and expand by evtl. line width / 2
+ /** implementation for primitive3D which
+ will use given Slice3Ds and expand by evtl. line width / 2
+ */
basegfx::B3DRange get3DRangeFromSlices(const Slice3DVector& rSlices) const;
public:
+ /// constructor
SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- // data access
+ /// data read access
const basegfx::B3DHomMatrix& getTransform() const { return maTransform; }
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
const attribute::SdrLineFillShadowAttribute& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
index 358298e30456..52e646e6b4dc 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
@@ -44,17 +44,25 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** SdrSpherePrimitive3D class
+
+ This 3D primitive expands the SdrPrimitive3D to a 3D sphere definition.
+ The sphere is implicitely in unit coordinates and the given transformation
+ defines it's geometry in space.
+ */
class SdrSpherePrimitive3D : public SdrPrimitive3D
{
private:
+ /// additional geometry definitions
sal_uInt32 mnHorizontalSegments;
sal_uInt32 mnVerticalSegments;
protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// local decomposition.
+ virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
public:
+ /// constructor
SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
@@ -63,17 +71,17 @@ namespace drawinglayer
sal_uInt32 nHorizontalSegments,
sal_uInt32 nVerticalSegments);
- // data access
+ /// data read access
sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
index d511c89a9998..cb8e9cd385d0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
@@ -46,17 +46,29 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** ShadowPrimitive3D class
+
+ This 3D grouping primitive is used to define a shadow for
+ 3d geometry by embedding it. The shadow of 3D objects are
+ 2D polygons, so the shadow transformation is a 2D transformation.
+
+ If the Shadow3D flag is set, the shadow definition has to be
+ combined with the scene and camera definition to create the correct
+ projected shadow 2D-Polygons.
+ */
class ShadowPrimitive3D : public GroupPrimitive3D
{
protected:
+ /// 2D shadow definition
basegfx::B2DHomMatrix maShadowTransform;
basegfx::BColor maShadowColor;
double mfShadowTransparence;
- // bitfield
+ /// bitfield
unsigned mbShadow3D : 1;
public:
+ /// constructor
ShadowPrimitive3D(
const basegfx::B2DHomMatrix& rShadowTransform,
const basegfx::BColor& rShadowColor,
@@ -64,16 +76,16 @@ namespace drawinglayer
bool bShadow3D,
const Primitive3DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
const basegfx::BColor& getShadowColor() const { return maShadowColor; }
double getShadowTransparence() const { return mfShadowTransparence; }
bool getShadow3D() const { return mbShadow3D; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
index 15b8e1265709..f8b81e357ea5 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
@@ -47,31 +47,39 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** TexturePrimitive3D class
+
+ This 3D grouping primitive is used to define a texture for
+ 3d geometry by embedding it. It is used as bae class for
+ extended texture definitions
+ */
class TexturePrimitive3D : public GroupPrimitive3D
{
private:
+ /// texture geometry definition
basegfx::B2DVector maTextureSize;
- // bitfield
- // flag if texture shall be modulated with white interpolated color
+ /// bitfield
+ /// flag if texture shall be modulated with white interpolated color
unsigned mbModulate : 1;
- // flag if texture shall be filtered
+ /// flag if texture shall be filtered
unsigned mbFilter : 1;
public:
+ /// constructor
TexturePrimitive3D(
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter);
- // get data
+ /// data read access
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
bool getModulate() const { return mbModulate; }
bool getFilter() const { return mbFilter; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
};
} // end of namespace primitive3d
@@ -83,27 +91,34 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** UnifiedAlphaTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a unified
+ alpha (transparence) texture definition. All 3D primitives
+ embedded here will be shown with the given transparency.
+ */
class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D
{
private:
+ /// transparency definition
double mfTransparence;
- protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
+ /// constructor
UnifiedAlphaTexturePrimitive3D(
double fTransparence,
const Primitive3DSequence& rChildren);
- // get data
+ /// data read access
double getTransparence() const { return mfTransparence; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// local decomposition.
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -115,16 +130,20 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** GradientTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a gradient texture
+ definition. All 3D primitives embedded here will be shown with the
+ defined gradient.
+ */
class GradientTexturePrimitive3D : public TexturePrimitive3D
{
private:
+ /// the gradient definition
attribute::FillGradientAttribute maGradient;
- protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
public:
+ /// constructor
GradientTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
@@ -132,13 +151,13 @@ namespace drawinglayer
bool bModulate,
bool bFilter);
- // get data
+ /// data read access
const attribute::FillGradientAttribute& getGradient() const { return maGradient; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -150,30 +169,34 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** BitmapTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a bitmap texture
+ definition. All 3D primitives embedded here will be shown with the
+ defined bitmap (maybe tiled if defined).
+ */
class BitmapTexturePrimitive3D : public TexturePrimitive3D
{
private:
- attribute::FillBitmapAttribute maBitmap;
-
- protected:
- // local decomposition.
- virtual Primitive3DSequence createLocalDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+ /// bitmap fill attribute
+ attribute::FillBitmapAttribute maFillBitmapAttribute;
public:
+ /// constructor
BitmapTexturePrimitive3D(
- const attribute::FillBitmapAttribute& rBitmap,
+ const attribute::FillBitmapAttribute& rFillBitmapAttribute,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize,
bool bModulate,
bool bFilter);
- // get data
- const attribute::FillBitmapAttribute& getBitmap() const { return maBitmap; }
+ /// data read access
+ const attribute::FillBitmapAttribute& getFillBitmapAttribute() const { return maFillBitmapAttribute; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
@@ -185,18 +208,26 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** AlphaTexturePrimitive3D class
+
+ This 3D primitive expands TexturePrimitive3D to a alpha texture
+ definition. For alpha definition, a gradient is used. The values in
+ that gradient will be interpreted as luminance Alpha-Values. All 3D
+ primitives embedded here will be shown with the defined transparence.
+ */
class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D
{
public:
+ /// constructor
AlphaTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize);
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
index 720f28445dec..bbf2b8444969 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
@@ -45,26 +45,37 @@ namespace drawinglayer
{
namespace primitive3d
{
+ /** TransformPrimitive3D class
+
+ This is one of the basic grouping 3D primitives and it provides
+ embedding a sequence of primitives (a geometry) into a
+ 3D transformation.
+
+ Please see the description for TransformPrimitive2D since these
+ primitives are pretty similar.
+ */
class TransformPrimitive3D : public GroupPrimitive3D
{
private:
+ // the 3D transformation to apply
basegfx::B3DHomMatrix maTransformation;
public:
+ /// constructor
TransformPrimitive3D(
const basegfx::B3DHomMatrix& rTransformation,
const Primitive3DSequence& rChildren);
- // get data
+ /// data read access
const basegfx::B3DHomMatrix& getTransformation() const { return maTransformation; }
- // compare operator
+ /// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
- // get range
+ /// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
- // provide unique ID
+ /// provide unique ID
DeclPrimitrive3DIDBlock()
};
} // end of namespace primitive3d
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
index 1eeaefd2dade..c0ab33052883 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -43,6 +43,7 @@
namespace basegfx { class B2DPolygon; }
namespace basegfx { class B2DPolyPolygon; }
+namespace drawinglayer { namespace primitive2d { class ScenePrimitive2D; }}
//////////////////////////////////////////////////////////////////////////////
@@ -80,6 +81,7 @@ namespace drawinglayer
bool checkFillHitWithTolerance(
const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDiscreteHitTolerance);
+ void check3DHit(const primitive2d::ScenePrimitive2D& rCandidate);
public:
HitTestProcessor2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
index f0d0ff881bc5..38e7e5143b8a 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
@@ -97,7 +97,7 @@ namespace drawinglayer
basegfx::B2DPolyPolygon maClipPolyPolygon;
// the target MetaFile
- GDIMetaFile& mrMetaFile;
+ GDIMetaFile* mpMetaFile;
// do not allow embedding SvtGraphicFills into each other,
// use a counter to prevent that
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index e29b413190ab..ff77cc3fd5d0 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -51,6 +51,7 @@ namespace drawinglayer { namespace primitive2d {
class BitmapPrimitive2D;
class FillBitmapPrimitive2D;
class PolyPolygonGradientPrimitive2D;
+ class PolyPolygonBitmapPrimitive2D;
class PolyPolygonColorPrimitive2D;
class MetafilePrimitive2D;
class MaskPrimitive2D;
@@ -63,6 +64,7 @@ namespace drawinglayer { namespace primitive2d {
class PolygonStrokePrimitive2D;
class ControlPrimitive2D;
class PagePreviewPrimitive2D;
+ class EpsPrimitive2D;
}}
//////////////////////////////////////////////////////////////////////////////
@@ -100,6 +102,7 @@ namespace drawinglayer
void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
void RenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapCandidate);
void RenderPolyPolygonGradientPrimitive2D(const primitive2d::PolyPolygonGradientPrimitive2D& rPolygonCandidate);
+ void RenderPolyPolygonBitmapPrimitive2D(const primitive2d::PolyPolygonBitmapPrimitive2D& rPolygonCandidate);
void RenderPolyPolygonColorPrimitive2D(const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate);
void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate);
void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
@@ -111,6 +114,7 @@ namespace drawinglayer
void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
void RenderPointArrayPrimitive2D(const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
void RenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
+ void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& rEpsPrimitive2D);
/////////////////////////////////////////////////////////////////////////////
// DrawMode adaption support
diff --git a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
new file mode 100644
index 000000000000..8a800d6d24b1
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: zbufferprocessor3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-06-24 15:30:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+
+#include <drawinglayer/processor3d/defaultprocessor3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor3d
+ {
+ class CutFindProcessor : public BaseProcessor3D
+ {
+ private:
+ // the start and stop point for the cut vector
+ basegfx::B3DPoint maFront;
+ basegfx::B3DPoint maBack;
+
+ // the found cut points
+ ::std::vector< basegfx::B3DPoint > maResult;
+
+ // #i102956# the transformation change from TransformPrimitive3D processings
+ // needs to be remembered to be able to transform found cuts to the
+ // basic coordinate system the processor starts with
+ basegfx::B3DHomMatrix maCombinedTransform;
+
+ // bitfield
+ bool mbAnyHit : 1;
+
+ // as tooling, the process() implementation takes over API handling and calls this
+ // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
+
+ public:
+ CutFindProcessor(const geometry::ViewInformation3D& rViewInformation,
+ const basegfx::B3DPoint& rFront,
+ const basegfx::B3DPoint& rBack,
+ bool bAnyHit);
+
+ // data access
+ const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
+ bool getAnyHit() const { return mbAnyHit; }
+ };
+ } // end of namespace processor3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
+
+// eof
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index 0068b32c24ae..ee5b96d98a03 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -39,6 +39,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\sceneprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sceneprimitive2d.hxx
..\inc\drawinglayer\primitive2d\shadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\shadowprimitive2d.hxx
..\inc\drawinglayer\primitive2d\structuretagprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\structuretagprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\textenumsprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textenumsprimitive2d.hxx
..\inc\drawinglayer\primitive2d\texteffectprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\texteffectprimitive2d.hxx
..\inc\drawinglayer\primitive2d\textlayoutdevice.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textlayoutdevice.hxx
..\inc\drawinglayer\primitive2d\textprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textprimitive2d.hxx
@@ -90,12 +91,15 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor2d
mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\baseprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\baseprocessor3d.hxx
+..\inc\drawinglayer\processor3d\cutfindprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\cutfindprocessor3d.hxx
+..\inc\drawinglayer\processor3d\defaultprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\defaultprocessor3d.hxx
..\inc\drawinglayer\processor3d\zbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\zbufferprocessor3d.hxx
..\inc\drawinglayer\processor3d\tbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\tbufferprocessor3d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute
..\inc\drawinglayer\attribute\fillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillattribute.hxx
..\inc\drawinglayer\attribute\fillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillbitmapattribute.hxx
+..\inc\drawinglayer\attribute\fontattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fontattribute.hxx
..\inc\drawinglayer\attribute\materialattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\materialattribute3d.hxx
..\inc\drawinglayer\attribute\sdrallattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrallattribute3d.hxx
..\inc\drawinglayer\attribute\sdrattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute.hxx
diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx b/drawinglayer/source/attribute/fillbitmapattribute.cxx
index 539e85ab2733..99afb234bda5 100644
--- a/drawinglayer/source/attribute/fillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx
@@ -44,8 +44,12 @@ namespace drawinglayer
{
namespace attribute
{
- FillBitmapAttribute::FillBitmapAttribute(const Bitmap& rBitmap, const basegfx::B2DPoint& rTopLeft, const basegfx::B2DVector& rSize, bool bTiling)
- : maBitmap(rBitmap),
+ FillBitmapAttribute::FillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft,
+ const basegfx::B2DVector& rSize,
+ bool bTiling)
+ : maBitmapEx(rBitmapEx),
maTopLeft(rTopLeft),
maSize(rSize),
mbTiling(bTiling)
@@ -54,10 +58,10 @@ namespace drawinglayer
bool FillBitmapAttribute::operator==(const FillBitmapAttribute& rCandidate) const
{
- return (maBitmap == rCandidate.maBitmap
- && maTopLeft == rCandidate.maTopLeft
- && maSize == rCandidate.maSize
- && mbTiling == rCandidate.mbTiling);
+ return (getBitmapEx() == rCandidate.getBitmapEx()
+ && getTopLeft() == rCandidate.getTopLeft()
+ && getSize() == rCandidate.getSize()
+ && getTiling() == rCandidate.getTiling());
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
new file mode 100644
index 000000000000..5163e2f6a59a
--- /dev/null
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: strokeattribute.cxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/fontattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ bool FontAttribute::operator==(const FontAttribute& rCompare) const
+ {
+ return (getFamilyName() == rCompare.getFamilyName()
+ && getStyleName() == rCompare.getStyleName()
+ && getWeight() == rCompare.getWeight()
+ && getSymbol() == rCompare.getSymbol()
+ && getVertical() == rCompare.getVertical()
+ && getItalic() == rCompare.getItalic()
+ && getOutline() == rCompare.getOutline()
+ && getRTL() == rCompare.getRTL()
+ && getBiDiStrong() == rCompare.getBiDiStrong());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/makefile.mk b/drawinglayer/source/attribute/makefile.mk
index fa91224e64b6..65f899f67177 100644
--- a/drawinglayer/source/attribute/makefile.mk
+++ b/drawinglayer/source/attribute/makefile.mk
@@ -47,6 +47,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES= \
$(SLO)$/fillattribute.obj \
$(SLO)$/fillbitmapattribute.obj \
+ $(SLO)$/fontattribute.obj \
$(SLO)$/materialattribute3d.obj \
$(SLO)$/sdrallattribute3d.obj \
$(SLO)$/sdrattribute.obj \
diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
index c35d0ba5c15f..d7e9090b0f62 100644
--- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
@@ -228,7 +228,7 @@ namespace drawinglayer
aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight);
}
- return FillBitmapAttribute(aBitmap, aBitmapTopLeft, aBitmapSize, mbTiling);
+ return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, mbTiling);
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 372de9936935..3a3fd68831db 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -81,12 +81,18 @@ namespace drawinglayer
basegfx::B2DRange maDiscreteViewport;
// the DrawPage which is target of visualisation. This is needed e.g. for
- // the view-dependent decomposition of PageNumber TextFields
+ // the view-dependent decomposition of PageNumber TextFields.
+ // This parameter is buffered here, but mainly resides in mxExtendedInformation,
+ // so it will be interpreted, but held there. It will also not be added
+ // to mxExtendedInformation in impFillViewInformationFromContent (it's there already)
uno::Reference< drawing::XDrawPage > mxVisualizedPage;
// the point in time
double mfViewTime;
+ // bitfield
+ bool mbReducedDisplayQuality : 1;
+
// the complete PropertyValue representation (if already created)
uno::Sequence< beans::PropertyValue > mxViewInformation;
@@ -125,6 +131,12 @@ namespace drawinglayer
return s_sNameProperty;
}
+ const ::rtl::OUString& getNamePropertyReducedDisplayQuality()
+ {
+ static ::rtl::OUString s_sNameProperty(RTL_CONSTASCII_USTRINGPARAM("ReducedDisplayQuality"));
+ return s_sNameProperty;
+ }
+
void impInterpretPropertyValues(const uno::Sequence< beans::PropertyValue >& rViewParameters)
{
if(rViewParameters.hasElements())
@@ -139,7 +151,17 @@ namespace drawinglayer
{
const beans::PropertyValue& rProp = rViewParameters[a];
- if(rProp.Name == getNamePropertyObjectTransformation())
+ if(rProp.Name == getNamePropertyReducedDisplayQuality())
+ {
+ // extra information; add to filtered information
+ mxExtendedInformation[nExtendedInsert++] = rProp;
+
+ // for performance reasons, also cache content locally
+ sal_Bool bSalBool(false);
+ rProp.Value >>= bSalBool;
+ mbReducedDisplayQuality = bSalBool;
+ }
+ else if(rProp.Name == getNamePropertyObjectTransformation())
{
com::sun::star::geometry::AffineMatrix2D aAffineMatrix2D;
rProp.Value >>= aAffineMatrix2D;
@@ -185,6 +207,7 @@ namespace drawinglayer
const bool bViewportUsed(!maViewport.isEmpty());
const bool bTimeUsed(0.0 < mfViewTime);
const bool bVisualizedPageUsed(mxVisualizedPage.is());
+ const bool bReducedDisplayQualityUsed(true == mbReducedDisplayQuality);
const bool bExtraInformation(mxExtendedInformation.hasElements());
sal_uInt32 nIndex(0);
const sal_uInt32 nCount(
@@ -193,6 +216,7 @@ namespace drawinglayer
(bViewportUsed ? 1 : 0) +
(bTimeUsed ? 1 : 0) +
(bVisualizedPageUsed ? 1 : 0) +
+ (bReducedDisplayQualityUsed ? 1 : 0) +
(bExtraInformation ? mxExtendedInformation.getLength() : 0));
mxViewInformation.realloc(nCount);
@@ -265,6 +289,7 @@ namespace drawinglayer
maDiscreteViewport(),
mxVisualizedPage(rxDrawPage),
mfViewTime(fViewTime),
+ mbReducedDisplayQuality(false),
mxViewInformation(),
mxExtendedInformation()
{
@@ -281,6 +306,7 @@ namespace drawinglayer
maDiscreteViewport(),
mxVisualizedPage(),
mfViewTime(),
+ mbReducedDisplayQuality(false),
mxViewInformation(rViewParameters),
mxExtendedInformation()
{
@@ -355,6 +381,11 @@ namespace drawinglayer
return mxVisualizedPage;
}
+ bool getReducedDisplayQuality() const
+ {
+ return mbReducedDisplayQuality;
+ }
+
const uno::Sequence< beans::PropertyValue >& getViewInformationSequence() const
{
if(!mxViewInformation.hasElements())
@@ -501,6 +532,11 @@ namespace drawinglayer
return mpViewInformation2D->getDiscreteViewport();
}
+ bool ViewInformation2D::getReducedDisplayQuality() const
+ {
+ return mpViewInformation2D->getReducedDisplayQuality();
+ }
+
const uno::Sequence< beans::PropertyValue >& ViewInformation2D::getViewInformationSequence() const
{
return mpViewInformation2D->getViewInformationSequence();
diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
index 13f1f699f1ab..df38c627ec9f 100644
--- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
@@ -52,33 +52,12 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence AnimatedSwitchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
- {
- if(getChildren().hasElements())
- {
- const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
- const sal_uInt32 nLen(getChildren().getLength());
- sal_uInt32 nIndex(basegfx::fround(fState * (double)nLen));
-
- if(nIndex >= nLen)
- {
- nIndex = nLen - 1L;
- }
-
- const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_QUERY_THROW);
- return Primitive2DSequence(&xRef, 1L);
- }
-
- return Primitive2DSequence();
- }
-
AnimatedSwitchPrimitive2D::AnimatedSwitchPrimitive2D(
const animation::AnimationEntry& rAnimationEntry,
const Primitive2DSequence& rChildren,
bool bIsTextAnimation)
: GroupPrimitive2D(rChildren),
mpAnimationEntry(0),
- mfDecomposeViewTime(0.0),
mbIsTextAnimation(bIsTextAnimation)
{
// clone given animation description
@@ -105,29 +84,22 @@ namespace drawinglayer
Primitive2DSequence AnimatedSwitchPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if(getLocalDecomposition().hasElements() && mfDecomposeViewTime != rViewInformation.getViewTime())
+ if(getChildren().hasElements())
{
- // conditions of last local decomposition have changed, delete
- const_cast< AnimatedSwitchPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
- }
+ const double fState(getAnimationEntry().getStateAtTime(rViewInformation.getViewTime()));
+ const sal_uInt32 nLen(getChildren().getLength());
+ sal_uInt32 nIndex(basegfx::fround(fState * (double)nLen));
- if(!getLocalDecomposition().hasElements())
- {
- // remember time
- const_cast< AnimatedSwitchPrimitive2D* >(this)->mfDecomposeViewTime = rViewInformation.getViewTime();
- }
+ if(nIndex >= nLen)
+ {
+ nIndex = nLen - 1L;
+ }
- // use parent implementation
- return GroupPrimitive2D::get2DDecomposition(rViewInformation);
- }
+ const Primitive2DReference xRef(getChildren()[nIndex], uno::UNO_QUERY_THROW);
+ return Primitive2DSequence(&xRef, 1L);
+ }
- basegfx::B2DRange AnimatedSwitchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
- {
- // to get range from decomposition and not from group content, call implementation from
- // BasePrimitive2D here
- return BasePrimitive2D::getB2DRange(rViewInformation);
+ return Primitive2DSequence();
}
// provide unique ID
@@ -142,7 +114,15 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence AnimatedBlinkPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ AnimatedBlinkPrimitive2D::AnimatedBlinkPrimitive2D(
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation)
+ : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation)
+ {
+ }
+
+ Primitive2DSequence AnimatedBlinkPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
if(getChildren().hasElements())
{
@@ -157,14 +137,6 @@ namespace drawinglayer
return Primitive2DSequence();
}
- AnimatedBlinkPrimitive2D::AnimatedBlinkPrimitive2D(
- const animation::AnimationEntry& rAnimationEntry,
- const Primitive2DSequence& rChildren,
- bool bIsTextAnimation)
- : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation)
- {
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(AnimatedBlinkPrimitive2D, PRIMITIVE2D_ID_ANIMATEDBLINKPRIMITIVE2D)
@@ -172,41 +144,30 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
-// helper class for AnimatedInterpolatePrimitive2D
namespace drawinglayer
{
namespace primitive2d
{
- BufferedMatrixDecompose::BufferedMatrixDecompose(const basegfx::B2DHomMatrix& rMatrix)
- : maB2DHomMatrix(rMatrix),
- maScale(0.0, 0.0),
- maTranslate(0.0, 0.0),
- mfRotate(0.0),
- mfShearX(0.0),
- mbDecomposed(false)
+ AnimatedInterpolatePrimitive2D::AnimatedInterpolatePrimitive2D(
+ const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack,
+ const animation::AnimationEntry& rAnimationEntry,
+ const Primitive2DSequence& rChildren,
+ bool bIsTextAnimation)
+ : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation),
+ maMatrixStack()
{
- }
+ // copy matrices to locally pre-decomposed matrix stack
+ const sal_uInt32 nCount(rmMatrixStack.size());
+ maMatrixStack.reserve(nCount);
- void BufferedMatrixDecompose::ensureDecompose() const
- {
- if(!mbDecomposed)
+ for(sal_uInt32 a(0L); a < nCount; a++)
{
- BufferedMatrixDecompose* pThis = const_cast< BufferedMatrixDecompose* >(this);
- maB2DHomMatrix.decompose(pThis->maScale, pThis->maTranslate, pThis->mfRotate, pThis->mfShearX);
- pThis->mbDecomposed = true;
+ maMatrixStack.push_back(basegfx::tools::B2DHomMatrixBufferedDecompose(rmMatrixStack[a]));
}
}
- } // end of anonymous namespace
-} // end of namespace drawinglayer
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- Primitive2DSequence AnimatedInterpolatePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence AnimatedInterpolatePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
const sal_uInt32 nSize(maMatrixStack.size());
@@ -227,21 +188,18 @@ namespace drawinglayer
const sal_uInt32 nIndA(sal_uInt32(floor(fIndex)));
const double fOffset(fIndex - (double)nIndA);
basegfx::B2DHomMatrix aTargetTransform;
+ std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose >::const_iterator aMatA(maMatrixStack.begin() + nIndA);
if(basegfx::fTools::equalZero(fOffset))
{
// use matrix from nIndA directly
- aTargetTransform = maMatrixStack[nIndA].getB2DHomMatrix();
+ aTargetTransform = aMatA->getB2DHomMatrix();
}
else
{
- // interpolate. Get involved matrices and ensure they are decomposed
+ // interpolate. Get involved buffered decomposed matrices
const sal_uInt32 nIndB((nIndA + 1L) % nSize);
- std::vector< BufferedMatrixDecompose >::const_iterator aMatA(maMatrixStack.begin() + nIndA);
- std::vector< BufferedMatrixDecompose >::const_iterator aMatB(maMatrixStack.begin() + nIndB);
-
- aMatA->ensureDecompose();
- aMatB->ensureDecompose();
+ std::vector< basegfx::tools::B2DHomMatrixBufferedDecompose >::const_iterator aMatB(maMatrixStack.begin() + nIndB);
// interpolate for fOffset [0.0 .. 1.0[
const basegfx::B2DVector aScale(basegfx::interpolate(aMatA->getScale(), aMatB->getScale(), fOffset));
@@ -250,10 +208,8 @@ namespace drawinglayer
const double fShearX(((aMatB->getShearX() - aMatA->getShearX()) * fOffset) + aMatA->getShearX());
// build matrix for state
- aTargetTransform.scale(aScale.getX(), aScale.getY());
- aTargetTransform.shearX(fShearX);
- aTargetTransform.rotate(fRotate);
- aTargetTransform.translate(aTranslate.getX(), aTranslate.getY());
+ aTargetTransform = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale, fShearX, fRotate, aTranslate);
}
// create new transform primitive reference, return new sequence
@@ -266,23 +222,6 @@ namespace drawinglayer
}
}
- AnimatedInterpolatePrimitive2D::AnimatedInterpolatePrimitive2D(
- const std::vector< basegfx::B2DHomMatrix >& rmMatrixStack,
- const animation::AnimationEntry& rAnimationEntry,
- const Primitive2DSequence& rChildren,
- bool bIsTextAnimation)
- : AnimatedSwitchPrimitive2D(rAnimationEntry, rChildren, bIsTextAnimation),
- maMatrixStack()
- {
- // copy matrices
- const sal_uInt32 nCount(rmMatrixStack.size());
-
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- maMatrixStack.push_back(BufferedMatrixDecompose(rmMatrixStack[a]));
- }
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(AnimatedInterpolatePrimitive2D, PRIMITIVE2D_ID_ANIMATEDINTERPOLATEPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
index cff797451954..d425b1ea3138 100644
--- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
@@ -54,7 +54,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence BackgroundColorPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence BackgroundColorPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
if(!rViewInformation.getViewport().isEmpty())
{
@@ -70,7 +70,7 @@ namespace drawinglayer
BackgroundColorPrimitive2D::BackgroundColorPrimitive2D(
const basegfx::BColor& rBColor)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maBColor(rBColor),
maLastViewport()
{
@@ -78,7 +78,7 @@ namespace drawinglayer
bool BackgroundColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const BackgroundColorPrimitive2D& rCompare = (BackgroundColorPrimitive2D&)rPrimitive;
@@ -98,20 +98,20 @@ namespace drawinglayer
{
::osl::MutexGuard aGuard( m_aMutex );
- if(getLocalDecomposition().hasElements() && (maLastViewport != rViewInformation.getViewport()))
+ if(getBuffered2DDecomposition().hasElements() && (maLastViewport != rViewInformation.getViewport()))
{
// conditions of last local decomposition have changed, delete
- const_cast< BackgroundColorPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< BackgroundColorPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember ViewRange
const_cast< BackgroundColorPrimitive2D* >(this)->maLastViewport = rViewInformation.getViewport();
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 63941512bfb0..dffde631b8c3 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -50,20 +50,18 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence BasePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ BasePrimitive2D::BasePrimitive2D()
+ : BasePrimitive2DImplBase(m_aMutex)
{
- return Primitive2DSequence();
}
- BasePrimitive2D::BasePrimitive2D()
- : BasePrimitive2DImplBase(m_aMutex),
- maLocalDecomposition()
+ BasePrimitive2D::~BasePrimitive2D()
{
}
bool BasePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
{
- return (getPrimitiveID() == rPrimitive.getPrimitiveID());
+ return (getPrimitive2DID() == rPrimitive.getPrimitive2DID());
}
basegfx::B2DRange BasePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
@@ -71,17 +69,9 @@ namespace drawinglayer
return getB2DRangeFromPrimitive2DSequence(get2DDecomposition(rViewInformation), rViewInformation);
}
- Primitive2DSequence BasePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence BasePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if(!getLocalDecomposition().hasElements())
- {
- const Primitive2DSequence aNewSequence(createLocalDecomposition(rViewInformation));
- const_cast< BasePrimitive2D* >(this)->setLocalDecomposition(aNewSequence);
- }
-
- return getLocalDecomposition();
+ return Primitive2DSequence();
}
Primitive2DSequence SAL_CALL BasePrimitive2D::getDecomposition( const uno::Sequence< beans::PropertyValue >& rViewParameters ) throw ( uno::RuntimeException )
@@ -99,6 +89,38 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence BufferedDecompositionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return Primitive2DSequence();
+ }
+
+ BufferedDecompositionPrimitive2D::BufferedDecompositionPrimitive2D()
+ : BasePrimitive2D(),
+ maBuffered2DDecomposition()
+ {
+ }
+
+ Primitive2DSequence BufferedDecompositionPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if(!getBuffered2DDecomposition().hasElements())
+ {
+ const Primitive2DSequence aNewSequence(create2DDecomposition(rViewInformation));
+ const_cast< BufferedDecompositionPrimitive2D* >(this)->setBuffered2DDecomposition(aNewSequence);
+ }
+
+ return getBuffered2DDecomposition();
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
// tooling
namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
index 5900900bcf06..43de0ef3b514 100644
--- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
@@ -65,8 +65,8 @@ namespace drawinglayer
{
const BitmapPrimitive2D& rCompare = (BitmapPrimitive2D&)rPrimitive;
- return (maBitmapEx == rCompare.maBitmapEx
- && maTransform == rCompare.maTransform);
+ return (getBitmapEx() == rCompare.getBitmapEx()
+ && getTransform() == rCompare.getTransform());
}
return false;
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index ba73f920cb08..1341a22f0d89 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -49,7 +49,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence BorderLinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence BorderLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence xRetval;
@@ -194,7 +194,7 @@ namespace drawinglayer
bool bCreateInside,
bool bCreateOutside,
const basegfx::BColor& rRGBColor)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maStart(rStart),
maEnd(rEnd),
mfLeftWidth(fLeftWidth),
@@ -212,7 +212,7 @@ namespace drawinglayer
bool BorderLinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const BorderLinePrimitive2D& rCompare = (BorderLinePrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 6241eeb2fa73..5d536fa8812f 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -54,6 +54,7 @@
#include <svtools/optionsdrawinglayer.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <vcl/window.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -230,12 +231,8 @@ namespace drawinglayer
}
// short form for scale and translate transformation
- basegfx::B2DHomMatrix aBitmapTransform;
-
- aBitmapTransform.set(0L, 0L, aBitmapSizeLogic.getX());
- aBitmapTransform.set(1L, 1L, aBitmapSizeLogic.getY());
- aBitmapTransform.set(0L, 2L, aTranslate.getX());
- aBitmapTransform.set(1L, 2L, aTranslate.getY());
+ const basegfx::B2DHomMatrix aBitmapTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aBitmapSizeLogic.getX(), aBitmapSizeLogic.getY(), aTranslate.getX(), aTranslate.getY()));
// create primitive
xRetval = new BitmapPrimitive2D(BitmapEx(aContent), aBitmapTransform);
@@ -266,7 +263,7 @@ namespace drawinglayer
return xRetval;
}
- Primitive2DSequence ControlPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence ControlPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
// try to create a bitmap decomposition. If that fails for some reason,
// at least create a replacement decomposition.
@@ -283,7 +280,7 @@ namespace drawinglayer
ControlPrimitive2D::ControlPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const uno::Reference< awt::XControlModel >& rxControlModel)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
mxControlModel(rxControlModel),
mxXControl(),
@@ -295,7 +292,7 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform,
const uno::Reference< awt::XControlModel >& rxControlModel,
const uno::Reference< awt::XControl >& rxXControl)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
mxControlModel(rxControlModel),
mxXControl(rxXControl),
@@ -316,7 +313,7 @@ namespace drawinglayer
bool ControlPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
// use base class compare operator
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const ControlPrimitive2D& rCompare = (ControlPrimitive2D&)rPrimitive;
@@ -365,23 +362,23 @@ namespace drawinglayer
::osl::MutexGuard aGuard( m_aMutex );
const basegfx::B2DVector aNewScaling(rViewInformation.getObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0));
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
if(!maLastViewScaling.equal(aNewScaling))
{
// conditions of last local decomposition have changed, delete
- const_cast< ControlPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< ControlPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember ViewTransformation
const_cast< ControlPrimitive2D* >(this)->maLastViewScaling = aNewScaling;
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
new file mode 100644
index 000000000000..6e3a5b8e516e
--- /dev/null
+++ b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: bitmapprimitive2d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence DiscreteBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // use getViewTransformation() and getObjectTransformation() from
+ // ObjectAndViewTransformationDependentPrimitive2D to create a BitmapPrimitive2D
+ // with the correct mapping
+ Primitive2DSequence xRetval;
+
+ if(!getBitmapEx().IsEmpty())
+ {
+ // get discrete size
+ const Size& rSizePixel = getBitmapEx().GetSizePixel();
+ const basegfx::B2DVector aDiscreteSize(rSizePixel.Width(), rSizePixel.Height());
+
+ // get inverse ViewTransformation
+ basegfx::B2DHomMatrix aInverseViewTransformation(getViewTransformation());
+ aInverseViewTransformation.invert();
+
+ // get size and position in world coordinates
+ const basegfx::B2DVector aWorldSize(aInverseViewTransformation * aDiscreteSize);
+ const basegfx::B2DPoint aWorldTopLeft(getObjectTransformation() * getTopLeft());
+
+ // build object matrix in world coordinates so that the top-left
+ // position remains, but eventual transformations (e.g. rotations)
+ // in the ObjectToView stack remain and get correctly applied
+ basegfx::B2DHomMatrix aObjectTransform;
+
+ aObjectTransform.set(0, 0, aWorldSize.getX());
+ aObjectTransform.set(1, 1, aWorldSize.getY());
+ aObjectTransform.set(0, 2, aWorldTopLeft.getX());
+ aObjectTransform.set(1, 2, aWorldTopLeft.getY());
+
+ // get inverse ObjectTransformation
+ basegfx::B2DHomMatrix aInverseObjectTransformation(getObjectTransformation());
+ aInverseObjectTransformation.invert();
+
+ // transform to object coordinate system
+ aObjectTransform = aInverseObjectTransformation * aObjectTransform;
+
+ // create BitmapPrimitive2D with now object-local coordinate data
+ const Primitive2DReference xRef(new BitmapPrimitive2D(getBitmapEx(), aObjectTransform));
+ xRetval = Primitive2DSequence(&xRef, 1);
+ }
+
+ return xRetval;
+ }
+
+ DiscreteBitmapPrimitive2D::DiscreteBitmapPrimitive2D(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft)
+ : ObjectAndViewTransformationDependentPrimitive2D(),
+ maBitmapEx(rBitmapEx),
+ maTopLeft(rTopLeft)
+ {
+ }
+
+ bool DiscreteBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(ObjectAndViewTransformationDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const DiscreteBitmapPrimitive2D& rCompare = (DiscreteBitmapPrimitive2D&)rPrimitive;
+
+ return (getBitmapEx() == rCompare.getBitmapEx()
+ && getTopLeft() == rCompare.getTopLeft());
+ }
+
+ return false;
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(DiscreteBitmapPrimitive2D, PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
index 5805c02a61ed..0c0a863733de 100644
--- a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
@@ -84,7 +84,7 @@ namespace drawinglayer
return maShadowPrimitives.hasElements();
}
- Primitive2DSequence Embedded3DPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence Embedded3DPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
// use info to create a yellow 2d rectangle, similar to empty 3d scenes and/or groups
const basegfx::B2DRange aLocal2DRange(getB2DRange(rViewInformation));
@@ -102,7 +102,7 @@ namespace drawinglayer
const basegfx::B3DVector& rLightNormal,
double fShadowSlant,
const basegfx::B3DRange& rScene3DRange)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
mxChildren3D(rxChildren3D),
maObjectTransformation(rObjectTransformation),
maViewInformation3D(rViewInformation3D),
@@ -118,7 +118,7 @@ namespace drawinglayer
bool Embedded3DPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const Embedded3DPrimitive2D& rCompare = static_cast< const Embedded3DPrimitive2D& >(rPrimitive);
diff --git a/drawinglayer/source/primitive2d/epsprimitive2d.cxx b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
new file mode 100644
index 000000000000..5854e90cfb9f
--- /dev/null
+++ b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: backgroundcolorprimitive2d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence EpsPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence xRetval;
+ const GDIMetaFile& rSubstituteContent = getMetaFile();
+
+ if(rSubstituteContent.GetActionCount())
+ {
+ // the default decomposition will use the Metafile replacement visualisation.
+ // To really use the Eps data, a renderer has to know and interpret this primitive
+ // directly.
+ xRetval.realloc(1);
+
+ xRetval[0] = Primitive2DReference(
+ new MetafilePrimitive2D(
+ getEpsTransform(),
+ rSubstituteContent));
+ }
+
+ return xRetval;
+ }
+
+ EpsPrimitive2D::EpsPrimitive2D(
+ const basegfx::B2DHomMatrix& rEpsTransform,
+ const GfxLink& rGfxLink,
+ const GDIMetaFile& rMetaFile)
+ : BufferedDecompositionPrimitive2D(),
+ maEpsTransform(rEpsTransform),
+ maGfxLink(rGfxLink),
+ maMetaFile(rMetaFile)
+ {
+ }
+
+ bool EpsPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
+ {
+ const EpsPrimitive2D& rCompare = (EpsPrimitive2D&)rPrimitive;
+
+ return (getEpsTransform() == rCompare.getEpsTransform()
+ && getGfxLink().IsEqual(rCompare.getGfxLink())
+ && getMetaFile() == rCompare.getMetaFile());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange EpsPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // use own implementation to quickly answer the getB2DRange question.
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(getEpsTransform());
+
+ return aRetval;
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(EpsPrimitive2D, PRIMITIVE2D_ID_EPSPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
index 125c2cb42193..ab9e9d19f6d2 100644
--- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
@@ -54,9 +54,9 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence FillBitmapPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence FillBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- const Size aTileSizePixel(getFillBitmap().getBitmap().GetSizePixel());
+ const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
Primitive2DSequence aRetval;
// is there a tile with some size at all?
@@ -79,7 +79,7 @@ namespace drawinglayer
aNewMatrix *= getTransformation();
// create bitmap primitive and add to result
- const Primitive2DReference xRef(new BitmapPrimitive2D(BitmapEx(getFillBitmap().getBitmap()), aNewMatrix));
+ const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix));
aRetval[a] = xRef;
}
}
@@ -94,7 +94,7 @@ namespace drawinglayer
aObjectTransform *= getTransformation();
// create bitmap primitive and add exclusive to decomposition (hand over ownership)
- const Primitive2DReference xRef(new BitmapPrimitive2D(BitmapEx(getFillBitmap().getBitmap()), aObjectTransform));
+ const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform));
aRetval = Primitive2DSequence(&xRef, 1L);
}
}
@@ -105,7 +105,7 @@ namespace drawinglayer
FillBitmapPrimitive2D::FillBitmapPrimitive2D(
const basegfx::B2DHomMatrix& rTransformation,
const attribute::FillBitmapAttribute& rFillBitmap)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransformation(rTransformation),
maFillBitmap(rFillBitmap)
{
@@ -113,7 +113,7 @@ namespace drawinglayer
bool FillBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const FillBitmapPrimitive2D& rCompare = static_cast< const FillBitmapPrimitive2D& >(rPrimitive);
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index ff0c031b38a1..625dae6cb93a 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -54,37 +54,27 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence FillGradientPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ void FillGradientPrimitive2D::generateMatricesAndColors(
+ std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ std::vector< basegfx::BColor >& rColors) const
{
- const attribute::GradientStyle aGradientStyle(maFillGradient.getStyle());
- ::std::vector< basegfx::B2DHomMatrix > aMatrices;
- ::std::vector< basegfx::BColor > aColors;
- basegfx::B2DPolygon aUnitPolygon;
- sal_uInt32 nSteps(maFillGradient.getSteps());
-
- if(attribute::GRADIENTSTYLE_RADIAL == aGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == aGradientStyle)
- {
- const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
- aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
- }
- else
- {
- aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
- }
+ rMatrices.clear();
+ rColors.clear();
// make sure steps is not too high/low
const basegfx::BColor aStart(maFillGradient.getStartColor());
const basegfx::BColor aEnd(maFillGradient.getEndColor());
const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
+ sal_uInt32 nSteps(maFillGradient.getSteps());
- if(nSteps == 0L)
+ if(nSteps == 0)
{
nSteps = nMaxSteps;
}
- if(nSteps < 2L)
+ if(nSteps < 2)
{
- nSteps = 2L;
+ nSteps = 2;
}
if(nSteps > nMaxSteps)
@@ -92,82 +82,184 @@ namespace drawinglayer
nSteps = nMaxSteps;
}
- switch(aGradientStyle)
+ switch(maFillGradient.getStyle())
{
case attribute::GRADIENTSTYLE_LINEAR:
{
texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
- aGradient.appendTransformations(aMatrices);
- aGradient.appendColors(aColors);
+ aGradient.appendTransformations(rMatrices);
+ aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
- aGradient.appendTransformations(aMatrices);
- aGradient.appendColors(aColors);
+ aGradient.appendTransformations(rMatrices);
+ aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY());
- aGradient.appendTransformations(aMatrices);
- aGradient.appendColors(aColors);
+ aGradient.appendTransformations(rMatrices);
+ aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
- aGradient.appendTransformations(aMatrices);
- aGradient.appendColors(aColors);
+ aGradient.appendTransformations(rMatrices);
+ aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
- aGradient.appendTransformations(aMatrices);
- aGradient.appendColors(aColors);
+ aGradient.appendTransformations(rMatrices);
+ aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
- aGradient.appendTransformations(aMatrices);
- aGradient.appendColors(aColors);
+ aGradient.appendTransformations(rMatrices);
+ aGradient.appendColors(rColors);
break;
}
}
+ }
+ Primitive2DSequence FillGradientPrimitive2D::createOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const
+ {
// prepare return value
- Primitive2DSequence aRetval(aColors.size() ? aMatrices.size() + 1L : aMatrices.size());
+ Primitive2DSequence aRetval(rColors.size() ? rMatrices.size() + 1 : rMatrices.size());
// create solid fill with start color
- if(aColors.size())
+ if(rColors.size())
{
// create primitive
- const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), aColors[0L]));
- aRetval[0L] = xRef;
+ const Primitive2DReference xRef(
+ new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())),
+ rColors[0]));
+ aRetval[0] = xRef;
}
// create solid fill steps
- for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ for(sal_uInt32 a(0); a < rMatrices.size(); a++)
{
// create part polygon
- basegfx::B2DPolygon aNewPoly(aUnitPolygon);
- aNewPoly.transform(aMatrices[a]);
+ basegfx::B2DPolygon aNewPoly(rUnitPolygon);
+ aNewPoly.transform(rMatrices[a]);
// create solid fill
- const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aNewPoly), aColors[a + 1L]));
- aRetval[a + 1L] = xRef;
+ const Primitive2DReference xRef(
+ new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aNewPoly),
+ rColors[a + 1]));
+ aRetval[a + 1] = xRef;
+ }
+
+ return aRetval;
+ }
+
+ Primitive2DSequence FillGradientPrimitive2D::createNonOverlappingFill(
+ const std::vector< basegfx::B2DHomMatrix >& rMatrices,
+ const std::vector< basegfx::BColor >& rColors,
+ const basegfx::B2DPolygon& rUnitPolygon) const
+ {
+ // prepare return value
+ Primitive2DSequence aRetval;
+ const sal_uInt32 nMatricesSize(rMatrices.size());
+
+ if(nMatricesSize)
+ {
+ basegfx::B2DPolygon aOuterPoly(rUnitPolygon);
+ aOuterPoly.transform(rMatrices[0]);
+ basegfx::B2DPolyPolygon aCombinedPolyPoly(aOuterPoly);
+ const sal_uInt32 nEntryCount(rColors.size() ? rMatrices.size() + 1 : rMatrices.size());
+ sal_uInt32 nIndex(0);
+
+ aRetval.realloc(nEntryCount);
+
+ if(rColors.size())
+ {
+ basegfx::B2DRange aOuterPolyRange(aOuterPoly.getB2DRange());
+ aOuterPolyRange.expand(getObjectRange());
+ aCombinedPolyPoly.append(basegfx::tools::createPolygonFromRect(aOuterPolyRange));
+ aRetval[nIndex++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(aCombinedPolyPoly, rColors[0]));
+ aCombinedPolyPoly = basegfx::B2DPolyPolygon(aOuterPoly);
+ }
+
+ for(sal_uInt32 a(1); a < nMatricesSize - 1; a++)
+ {
+ basegfx::B2DPolygon aInnerPoly(rUnitPolygon);
+ aInnerPoly.transform(rMatrices[a]);
+ aCombinedPolyPoly.append(aInnerPoly);
+ aRetval[nIndex++] = Primitive2DReference(new PolyPolygonColorPrimitive2D(aCombinedPolyPoly, rColors[a]));
+ aCombinedPolyPoly = basegfx::B2DPolyPolygon(aInnerPoly);
+ }
+
+ if(rColors.size())
+ {
+ aRetval[nIndex] = Primitive2DReference(new PolyPolygonColorPrimitive2D(
+ aCombinedPolyPoly, rColors[rColors.size() - 1]));
+ }
}
return aRetval;
}
+ Primitive2DSequence FillGradientPrimitive2D::createFill(bool bOverlapping) const
+ {
+ // prepare shape of the Unit Polygon
+ basegfx::B2DPolygon aUnitPolygon;
+
+ if(attribute::GRADIENTSTYLE_RADIAL == maFillGradient.getStyle()
+ || attribute::GRADIENTSTYLE_ELLIPTICAL == maFillGradient.getStyle())
+ {
+ const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
+ aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
+ }
+ else
+ {
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ }
+
+ // get the transform matrices and colors (where colors
+ // will have one more entry that matrices)
+ std::vector< basegfx::B2DHomMatrix > aMatrices;
+ std::vector< basegfx::BColor > aColors;
+ generateMatricesAndColors(aMatrices, aColors);
+
+ if(bOverlapping)
+ {
+ return createOverlappingFill(aMatrices, aColors, aUnitPolygon);
+ }
+ else
+ {
+ return createNonOverlappingFill(aMatrices, aColors, aUnitPolygon);
+ }
+ }
+
+ Primitive2DSequence FillGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // default creates overlapping fill which works with AntiAliasing and without.
+ // The non-overlapping version does not create single filled polygons, but
+ // PolyPolygons where each one describes a 'ring' for the gradient such
+ // that the rings will not overlap. This is useful fir the old XOR-paint
+ // 'trick' of VCL which is recorded in Metafiles; so this version may be
+ // used from the MetafilePrimitive2D in it's decomposition.
+ return createFill(true);
+ }
+
FillGradientPrimitive2D::FillGradientPrimitive2D(
const basegfx::B2DRange& rObjectRange,
const attribute::FillGradientAttribute& rFillGradient)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maObjectRange(rObjectRange),
maFillGradient(rFillGradient)
{
@@ -175,7 +267,7 @@ namespace drawinglayer
bool FillGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index 06d04111686d..9e6e69516d43 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -55,7 +55,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence FillHatchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// create hatch
const basegfx::BColor aHatchColor(maFillHatch.getColor());
@@ -125,7 +125,7 @@ namespace drawinglayer
const basegfx::B2DRange& rObjectRange,
const basegfx::BColor& rBColor,
const attribute::FillHatchAttribute& rFillHatch)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maObjectRange(rObjectRange),
maFillHatch(rFillHatch),
maBColor(rBColor)
@@ -134,7 +134,7 @@ namespace drawinglayer
bool FillHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 1ed826dab562..6d1540594dc9 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -56,6 +56,18 @@
#include <vcl/svapp.hxx>
//////////////////////////////////////////////////////////////////////////////
+// includes for testing MetafilePrimitive2D::create2DDecomposition
+
+// this switch defines if the test code is included or not
+#undef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+
+#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+#include <vcl/gradient.hxx>
+#include <vcl/pngread.hxx>
+#include <vcl/lineinfo.hxx>
+#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+
+//////////////////////////////////////////////////////////////////////////////
namespace
{
@@ -211,19 +223,52 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence GraphicPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence GraphicPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D&
+#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+ rViewInformation
+#else
+ /*rViewInformation*/
+#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+ ) const
{
Primitive2DSequence aRetval;
if(255L != getGraphicAttr().GetTransparency())
{
- // get transformed graphic. Suppress rotation and cropping, only filtering is needed
- // here (and may be replaced later on). Cropping is handled below as mask primitive (if set)
+ Primitive2DReference xPrimitive;
+
+ // do not apply mirroring from GraphicAttr to the Metafile by calling
+ // GetTransformedGraphic, this will try to mirror the Metafile using Scale()
+ // at the Metafile. This again calls Scale at the single MetaFile actions,
+ // but this implementation never worked. I reworked that implementations,
+ // but for security reasons i will try not to use it.
+ basegfx::B2DHomMatrix aTransform(getTransform());
+
+ if(getGraphicAttr().IsMirrored())
+ {
+ // content needs mirroring
+ const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ);
+ const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT);
+
+ // mirror by applying negative scale to the unit primitive and
+ // applying the object transformation on it.
+ aTransform = basegfx::tools::createScaleB2DHomMatrix(
+ bHMirr ? -1.0 : 1.0,
+ bVMirr ? -1.0 : 1.0);
+ aTransform.translate(
+ bHMirr ? 1.0 : 0.0,
+ bVMirr ? 1.0 : 0.0);
+ aTransform = getTransform() * aTransform;
+ }
+
+ // Get transformed graphic. Suppress rotation and cropping, only filtering is needed
+ // here (and may be replaced later on). Cropping is handled below as mask primitive (if set).
+ // Also need to suppress mirroring, it is part of the transformation now (see above).
GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
- aSuppressGraphicAttr.SetCrop(0L, 0L, 0L, 0L);
+ aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
aSuppressGraphicAttr.SetRotation(0);
- Graphic aTransformedGraphic(getGraphicObject().GetTransformedGraphic(&aSuppressGraphicAttr));
- Primitive2DReference xPrimitive;
+ aSuppressGraphicAttr.SetMirrorFlags(0);
+ const Graphic aTransformedGraphic(getGraphicObject().GetTransformedGraphic(&aSuppressGraphicAttr));
switch(aTransformedGraphic.GetType())
{
@@ -244,7 +289,7 @@ namespace drawinglayer
{
animation::AnimationEntryFixed aTime((double)aData.stepTime(a), (double)a / (double)aData.count());
aAnimationLoop.append(aTime);
- const Primitive2DReference xRef(new BitmapPrimitive2D(aData.stepBitmapEx(a), getTransform()));
+ const Primitive2DReference xRef(new BitmapPrimitive2D(aData.stepBitmapEx(a), aTransform));
aBitmapPrimitives[a] = xRef;
}
@@ -258,7 +303,7 @@ namespace drawinglayer
}
else
{
- xPrimitive = Primitive2DReference(new BitmapPrimitive2D(aTransformedGraphic.GetBitmapEx(), getTransform()));
+ xPrimitive = Primitive2DReference(new BitmapPrimitive2D(aTransformedGraphic.GetBitmapEx(), aTransform));
}
break;
@@ -266,37 +311,480 @@ namespace drawinglayer
case GRAPHIC_GDIMETAFILE :
{
- // create MetafilePrimitive2D
- const GDIMetaFile& rMetafile = aTransformedGraphic.GetGDIMetaFile();
-
- xPrimitive = Primitive2DReference(
- new MetafilePrimitive2D(
- getTransform(),
- rMetafile));
-
- // #i100357# find out if clipping is needed for this primitive. Unfortunately,
- // there exist Metafiles who's content is bigger than the proposed PrefSize set
- // at them. This is an error, but we need to work around this
- const Size aMetaFilePrefSize(rMetafile.GetPrefSize());
- const Size aMetaFileRealSize(
- const_cast< GDIMetaFile& >(rMetafile).GetBoundRect(
- *Application::GetDefaultDevice()).GetSize());
-
- if(aMetaFileRealSize.getWidth() > aMetaFilePrefSize.getWidth()
- || aMetaFileRealSize.getHeight() > aMetaFilePrefSize.getHeight())
+#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+ static bool bDoTest(false);
+
+ if(bDoTest)
{
- // clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon
- const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1);
- basegfx::B2DPolygon aMaskPolygon(
- basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aMaskPolygon.transform(getTransform());
+ // All this is/was test code for testing MetafilePrimitive2D::create2DDecomposition
+ // extensively. It may be needed again when diverse actions need debugging, so i leave
+ // it in here, but take it out using USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE.
+ // Use it by compiling with the code, insert any DrawObject, convert to Metafile. The
+ // debugger will then stop here (when breakpoint set, of course). You may enter single
+ // parts of actions and/or change to true what You want to check.
+ GDIMetaFile aMtf;
+ VirtualDevice aOut;
+ const basegfx::B2DRange aRange(getB2DRange(rViewInformation));
+ const Rectangle aRectangle(
+ basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()),
+ basegfx::fround(aRange.getMaxX()), basegfx::fround(aRange.getMaxY()));
+ const Point aOrigin(aRectangle.TopLeft());
+ const Fraction aScaleX(aRectangle.getWidth());
+ const Fraction aScaleY(aRectangle.getHeight());
+ MapMode aMapMode(MAP_100TH_MM, aOrigin, aScaleX, aScaleY);
+
+ Size aDummySize(2, 2);
+ aOut.SetOutputSizePixel(aDummySize);
+ aOut.EnableOutput(FALSE);
+ aOut.SetMapMode(aMapMode);
+
+ aMtf.Clear();
+ aMtf.Record(&aOut);
+
+ const Fraction aNeutralFraction(1, 1);
+ const MapMode aRelativeMapMode(
+ MAP_RELATIVE,
+ Point(-aRectangle.Left(), -aRectangle.Top()),
+ aNeutralFraction, aNeutralFraction);
+ aOut.SetMapMode(aRelativeMapMode);
+
+ if(false)
+ {
+ const sal_Int32 nHor(aRectangle.getWidth() / 4);
+ const sal_Int32 nVer(aRectangle.getHeight() / 4);
+ const Rectangle aCenteredRectangle(
+ aRectangle.Left() + nHor, aRectangle.Top() + nVer,
+ aRectangle.Right() - nHor, aRectangle.Bottom() - nVer);
+ aOut.SetClipRegion(aCenteredRectangle);
+ }
+
+ if(false)
+ {
+ const Rectangle aRightRectangle(aRectangle.TopCenter(), aRectangle.BottomRight());
+ aOut.IntersectClipRegion(aRightRectangle);
+ }
+
+ if(false)
+ {
+ const Rectangle aRightRectangle(aRectangle.TopCenter(), aRectangle.BottomRight());
+ const Rectangle aBottomRectangle(aRectangle.LeftCenter(), aRectangle.BottomRight());
+ Region aRegion(aRightRectangle);
+ aRegion.Intersect(aBottomRectangle);
+ aOut.IntersectClipRegion(aRegion);
+ }
+
+ if(false)
+ {
+ const sal_Int32 nHor(aRectangle.getWidth() / 10);
+ const sal_Int32 nVer(aRectangle.getHeight() / 10);
+ aOut.MoveClipRegion(nHor, nVer);
+ }
+
+ if(false)
+ {
+ Wallpaper aWallpaper(Color(COL_BLACK));
+ aOut.DrawWallpaper(aRectangle, aWallpaper);
+ }
+
+ if(false)
+ {
+ Wallpaper aWallpaper(Gradient(GRADIENT_LINEAR, Color(COL_RED), Color(COL_GREEN)));
+ aOut.DrawWallpaper(aRectangle, aWallpaper);
+ }
+
+ if(false)
+ {
+ SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ);
+ vcl::PNGReader aPNGReader(aRead);
+ BitmapEx aBitmapEx(aPNGReader.Read());
+ Wallpaper aWallpaper(aBitmapEx);
+ aOut.DrawWallpaper(aRectangle, aWallpaper);
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+ Color aColor(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0));
+
+ for(sal_uInt32 a(0); a < 5000; a++)
+ {
+ const Point aPoint(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+
+ if(!(a % 3))
+ {
+ aColor = Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0));
+ }
+
+ aOut.DrawPixel(aPoint, aColor);
+ }
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor();
+
+ for(sal_uInt32 a(0); a < 5000; a++)
+ {
+ const Point aPoint(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ aOut.DrawPixel(aPoint);
+ }
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor();
+
+ Point aStart(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ Point aStop(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+
+ LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fHor / 50.0));
+ bool bUseLineInfo(false);
+
+ for(sal_uInt32 a(0); a < 20; a++)
+ {
+ if(!(a%6))
+ {
+ bUseLineInfo = !bUseLineInfo;
+ }
+
+ if(!(a%4))
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ }
+
+ if(a%3)
+ {
+ aStart = aStop;
+ aStop = Point(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ }
+ else
+ {
+ aStart = Point(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ aStop = Point(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ }
+
+ if(bUseLineInfo)
+ {
+ aOut.DrawLine(aStart, aStop, aLineInfo);
+ }
+ else
+ {
+ aOut.DrawLine(aStart, aStop);
+ }
+ }
+ }
+
+ if(false)
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawRect(aRectangle);
+ }
+
+ if(false)
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ const sal_uInt32 nHor(aRectangle.getWidth() / 10);
+ const sal_uInt32 nVer(aRectangle.getHeight() / 10);
+ aOut.DrawRect(aRectangle, nHor, nVer);
+ }
+
+ if(false)
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawEllipse(aRectangle);
+ }
+
+ if(false)
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawArc(aRectangle, aRectangle.TopLeft(), aRectangle.BottomCenter());
+ }
+
+ if(false)
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawPie(aRectangle, aRectangle.TopLeft(), aRectangle.BottomCenter());
+ }
+
+ if(false)
+ {
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawChord(aRectangle, aRectangle.TopLeft(), aRectangle.BottomCenter());
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+
+ for(sal_uInt32 b(0); b < 5; b++)
+ {
+ const sal_uInt32 nCount(basegfx::fround(rand() * (20 / 32767.0)));
+ const bool bClose(basegfx::fround(rand() / 32767.0));
+ Polygon aPolygon(nCount + (bClose ? 1 : 0));
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const Point aPoint(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ aPolygon[a] = aPoint;
+ }
+
+ if(bClose)
+ {
+ aPolygon[aPolygon.GetSize() - 1] = aPolygon[0];
+ }
+
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+
+ if(!(b%2))
+ {
+ const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fHor / 50.0));
+ aOut.DrawPolyLine(aPolygon, aLineInfo);
+ }
+ else
+ {
+ aOut.DrawPolyLine(aPolygon);
+ }
+ }
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+
+ for(sal_uInt32 b(0); b < 5; b++)
+ {
+ const sal_uInt32 nCount(basegfx::fround(rand() * (20 / 32767.0)));
+ const bool bClose(basegfx::fround(rand() / 32767.0));
+ Polygon aPolygon(nCount + (bClose ? 1 : 0));
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const Point aPoint(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ aPolygon[a] = aPoint;
+ }
+
+ if(bClose)
+ {
+ aPolygon[aPolygon.GetSize() - 1] = aPolygon[0];
+ }
+
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawPolygon(aPolygon);
+ }
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+ PolyPolygon aPolyPolygon;
+
+ for(sal_uInt32 b(0); b < 3; b++)
+ {
+ const sal_uInt32 nCount(basegfx::fround(rand() * (6 / 32767.0)));
+ const bool bClose(basegfx::fround(rand() / 32767.0));
+ Polygon aPolygon(nCount + (bClose ? 1 : 0));
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const Point aPoint(
+ aRectangle.Left() + basegfx::fround(rand() * (fHor / 32767.0)),
+ aRectangle.Top() + basegfx::fround(rand() * (fVer / 32767.0)));
+ aPolygon[a] = aPoint;
+ }
+
+ if(bClose)
+ {
+ aPolygon[aPolygon.GetSize() - 1] = aPolygon[0];
+ }
+
+ aPolyPolygon.Insert(aPolygon);
+ }
+
+ aOut.SetLineColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.SetFillColor(Color(basegfx::BColor(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0)));
+ aOut.DrawPolyPolygon(aPolyPolygon);
+ }
+
+ if(false)
+ {
+ SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ);
+ vcl::PNGReader aPNGReader(aRead);
+ BitmapEx aBitmapEx(aPNGReader.Read());
+ aOut.DrawBitmapEx(aRectangle.TopLeft(), aBitmapEx);
+ }
+
+ if(false)
+ {
+ SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ);
+ vcl::PNGReader aPNGReader(aRead);
+ BitmapEx aBitmapEx(aPNGReader.Read());
+ aOut.DrawBitmapEx(aRectangle.TopLeft(), aRectangle.GetSize(), aBitmapEx);
+ }
+
+ if(false)
+ {
+ SvFileStream aRead((const String&)String(ByteString( "c:\\test.png" ), RTL_TEXTENCODING_UTF8), STREAM_READ);
+ vcl::PNGReader aPNGReader(aRead);
+ BitmapEx aBitmapEx(aPNGReader.Read());
+ const Size aSizePixel(aBitmapEx.GetSizePixel());
+ aOut.DrawBitmapEx(
+ aRectangle.TopLeft(),
+ aRectangle.GetSize(),
+ Point(0, 0),
+ Size(aSizePixel.Width() /2, aSizePixel.Height() / 2),
+ aBitmapEx);
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+ const Point aPointA(
+ aRectangle.Left() + basegfx::fround(fHor * 0.2),
+ aRectangle.Top() + basegfx::fround(fVer * 0.3));
+ const Point aPointB(
+ aRectangle.Left() + basegfx::fround(fHor * 0.2),
+ aRectangle.Top() + basegfx::fround(fVer * 0.5));
+ const Point aPointC(
+ aRectangle.Left() + basegfx::fround(fHor * 0.2),
+ aRectangle.Top() + basegfx::fround(fVer * 0.7));
+ const String aText(ByteString("Hello, World!"), RTL_TEXTENCODING_UTF8);
+
+ const String aFontName(ByteString("Comic Sans MS"), RTL_TEXTENCODING_UTF8);
+ Font aFont(aFontName, Size(0, 1000));
+ aFont.SetAlign(ALIGN_BASELINE);
+ aFont.SetColor(COL_RED);
+ //sal_Int32* pDXArray = new sal_Int32[aText.Len()];
+
+ aFont.SetOutline(true);
+ aOut.SetFont(aFont);
+ aOut.DrawText(aPointA, aText, 0, aText.Len());
+
+ aFont.SetShadow(true);
+ aOut.SetFont(aFont);
+ aOut.DrawText(aPointB, aText, 0, aText.Len());
+
+ aFont.SetRelief(RELIEF_EMBOSSED);
+ aOut.SetFont(aFont);
+ aOut.DrawText(aPointC, aText, 0, aText.Len());
+
+ //delete pDXArray;
+ }
+
+ if(false)
+ {
+ const double fHor(aRectangle.getWidth());
+ const double fVer(aRectangle.getHeight());
+ const Point aPointA(
+ aRectangle.Left() + basegfx::fround(fHor * 0.2),
+ aRectangle.Top() + basegfx::fround(fVer * 0.3));
+ const Point aPointB(
+ aRectangle.Left() + basegfx::fround(fHor * 0.2),
+ aRectangle.Top() + basegfx::fround(fVer * 0.5));
+ const Point aPointC(
+ aRectangle.Left() + basegfx::fround(fHor * 0.2),
+ aRectangle.Top() + basegfx::fround(fVer * 0.7));
+ const String aText(ByteString("Hello, World!"), RTL_TEXTENCODING_UTF8);
+
+ const String aFontName(ByteString("Comic Sans MS"), RTL_TEXTENCODING_UTF8);
+ Font aFont(aFontName, Size(0, 1000));
+ aFont.SetAlign(ALIGN_BASELINE);
+ aFont.SetColor(COL_RED);
+
+ aOut.SetFont(aFont);
+ const sal_Int32 nWidth(aOut.GetTextWidth(aText, 0, aText.Len()));
+ aOut.DrawText(aPointA, aText, 0, aText.Len());
+ aOut.DrawTextLine(aPointA, nWidth, STRIKEOUT_SINGLE, UNDERLINE_SINGLE, UNDERLINE_SMALLWAVE);
+ aOut.DrawTextLine(aPointB, nWidth, STRIKEOUT_SINGLE, UNDERLINE_SINGLE, UNDERLINE_SMALLWAVE);
+ aOut.DrawTextLine(aPointC, nWidth, STRIKEOUT_SINGLE, UNDERLINE_SINGLE, UNDERLINE_SMALLWAVE);
+ }
+
+ aMtf.Stop();
+ aMtf.WindStart();
+ aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ aMtf.SetPrefSize(Size(aRectangle.getWidth(), aRectangle.getHeight()));
+
+ xPrimitive = Primitive2DReference(
+ new MetafilePrimitive2D(
+ aTransform,
+ aMtf));
+ }
+ else
+ {
+#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
+ // create MetafilePrimitive2D
+ const Graphic aGraphic(getGraphicObject().GetGraphic());
+ const GDIMetaFile& rMetafile = aTransformedGraphic.GetGDIMetaFile();
xPrimitive = Primitive2DReference(
- new MaskPrimitive2D(
- basegfx::B2DPolyPolygon(aMaskPolygon),
- aChildContent));
+ new MetafilePrimitive2D(
+ aTransform,
+ rMetafile));
+
+ // #i100357# find out if clipping is needed for this primitive. Unfortunately,
+ // there exist Metafiles who's content is bigger than the proposed PrefSize set
+ // at them. This is an error, but we need to work around this
+ const Size aMetaFilePrefSize(rMetafile.GetPrefSize());
+ const Size aMetaFileRealSize(
+ const_cast< GDIMetaFile& >(rMetafile).GetBoundRect(
+ *Application::GetDefaultDevice()).GetSize());
+
+ if(aMetaFileRealSize.getWidth() > aMetaFilePrefSize.getWidth()
+ || aMetaFileRealSize.getHeight() > aMetaFilePrefSize.getHeight())
+ {
+ // clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon
+ const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1);
+ basegfx::B2DPolygon aMaskPolygon(
+ basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ aMaskPolygon.transform(aTransform);
+
+ xPrimitive = Primitive2DReference(
+ new MaskPrimitive2D(
+ basegfx::B2DPolyPolygon(aMaskPolygon),
+ aChildContent));
+ }
+#ifdef USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
}
+#endif // USE_DEBUG_CODE_TO_TEST_METAFILE_DECOMPOSE
break;
}
@@ -319,7 +807,9 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create ranges. The current object range is just scale and translate
- const basegfx::B2DRange aCurrent(aTranslate.getX(), aTranslate.getY(), aTranslate.getX() + aScale.getX(), aTranslate.getY() + aScale.getY());
+ const basegfx::B2DRange aCurrent(
+ aTranslate.getX(), aTranslate.getY(),
+ aTranslate.getX() + aScale.getX(), aTranslate.getY() + aScale.getY());
// calculate scalings between real image size and logic object size. This
// is necessary since the crop values are relative to original bitmap size
@@ -369,11 +859,15 @@ namespace drawinglayer
// build new object transformation for transform primitive which contains xPrimitive
basegfx::B2DHomMatrix aNewObjectTransform(getTransform());
aNewObjectTransform.invert();
- aNewObjectTransform.scale(aCropped.getWidth(), aCropped.getHeight());
- aNewObjectTransform.translate(aCropped.getMinX() - aCurrent.getMinX(), aCropped.getMinY() - aCurrent.getMinY());
- aNewObjectTransform.shearX(fShearX);
- aNewObjectTransform.rotate(fRotate);
- aNewObjectTransform.translate(aTranslate.getX(), aTranslate.getY());
+ aNewObjectTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aCropped.getWidth(), aCropped.getHeight(),
+ aCropped.getMinX() - aCurrent.getMinX(), aCropped.getMinY() - aCurrent.getMinY())
+ * aNewObjectTransform;
+
+ // add shear, rotate and translate using combined matrix to speedup
+ const basegfx::B2DHomMatrix aCombinedMatrix(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ aNewObjectTransform = aCombinedMatrix * aNewObjectTransform;
// prepare TransformPrimitive2D with xPrimitive
const Primitive2DReference xTransformPrimitive(new TransformPrimitive2D(aNewObjectTransform, Primitive2DSequence(&xPrimitive, 1L)));
@@ -410,7 +904,7 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform,
const GraphicObject& rGraphicObject,
const GraphicAttr& rGraphicAttr)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maGraphicObject(rGraphicObject),
maGraphicAttr(rGraphicAttr)
@@ -420,7 +914,7 @@ namespace drawinglayer
GraphicPrimitive2D::GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
const GraphicObject& rGraphicObject)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maGraphicObject(rGraphicObject),
maGraphicAttr()
@@ -429,7 +923,7 @@ namespace drawinglayer
bool GraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const GraphicPrimitive2D& rCompare = (GraphicPrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
index df4171309389..d2bd4b9d5243 100644
--- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
@@ -42,6 +42,7 @@
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -53,7 +54,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence GridPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence GridPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
Primitive2DSequence aRetval;
@@ -65,10 +66,8 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create grid matrix which transforms from scaled logic to view
- basegfx::B2DHomMatrix aRST;
- aRST.shearX(fShearX);
- aRST.rotate(fRotate);
- aRST.translate(aTranslate.getX(), aTranslate.getY());
+ basegfx::B2DHomMatrix aRST(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
aRST *= rViewInformation.getObjectToViewTransformation();
// get step widths
@@ -248,7 +247,7 @@ namespace drawinglayer
sal_uInt32 nSubdivisionsY,
const basegfx::BColor& rBColor,
const BitmapEx& rCrossMarker)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
mfWidth(fWidth),
mfHeight(fHeight),
@@ -265,7 +264,7 @@ namespace drawinglayer
bool GridPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const GridPrimitive2D& rCompare = (GridPrimitive2D&)rPrimitive;
@@ -299,16 +298,16 @@ namespace drawinglayer
{
::osl::MutexGuard aGuard( m_aMutex );
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
if(maLastViewport != rViewInformation.getViewport() || maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation())
{
// conditions of last local decomposition have changed, delete
- const_cast< GridPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< GridPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember ViewRange and ViewTransformation
const_cast< GridPrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation();
@@ -316,7 +315,7 @@ namespace drawinglayer
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
index ae899af6e84d..c9e2a1ea1438 100644
--- a/drawinglayer/source/primitive2d/groupprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
@@ -49,12 +49,6 @@ namespace drawinglayer
{
namespace primitive2d
{
- /// default: just return children, so all renderers not supporting group will use it's content
- Primitive2DSequence GroupPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
- {
- return getChildren();
- }
-
GroupPrimitive2D::GroupPrimitive2D( const Primitive2DSequence& rChildren )
: BasePrimitive2D(),
maChildren(rChildren)
@@ -77,6 +71,12 @@ namespace drawinglayer
return false;
}
+ /// default: just return children, so all renderers not supporting group will use it's content
+ Primitive2DSequence GroupPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return getChildren();
+ }
+
// provide unique ID
ImplPrimitrive2DIDBlock(GroupPrimitive2D, PRIMITIVE2D_ID_GROUPPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
index 3232e635b561..251ac110acd6 100644
--- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
@@ -54,7 +54,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence HelplinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence HelplinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
std::vector< BasePrimitive2D* > aTempPrimitiveTarget;
@@ -167,7 +167,7 @@ namespace drawinglayer
const basegfx::BColor& rRGBColA,
const basegfx::BColor& rRGBColB,
double fDiscreteDashLength)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPosition(rPosition),
maDirection(rDirection),
meStyle(eStyle),
@@ -181,7 +181,7 @@ namespace drawinglayer
bool HelplinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const HelplinePrimitive2D& rCompare = (HelplinePrimitive2D&)rPrimitive;
@@ -200,16 +200,16 @@ namespace drawinglayer
{
::osl::MutexGuard aGuard( m_aMutex );
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
if(maLastViewport != rViewInformation.getViewport() || maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation())
{
// conditions of last local decomposition have changed, delete
- const_cast< HelplinePrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< HelplinePrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember ViewRange and ViewTransformation
const_cast< HelplinePrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation();
@@ -217,7 +217,7 @@ namespace drawinglayer
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx b/drawinglayer/source/primitive2d/hittestprimitive2d.cxx
index daf65abd81d4..137f8cf8ad5c 100644
--- a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/hittestprimitive2d.cxx
@@ -49,12 +49,6 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence HitTestPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
- {
- // return empty sequence
- return Primitive2DSequence();
- }
-
HitTestPrimitive2D::HitTestPrimitive2D(
const Primitive2DSequence& rChildren)
: GroupPrimitive2D(rChildren)
@@ -66,6 +60,12 @@ namespace drawinglayer
return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation);
}
+ Primitive2DSequence HitTestPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ // return empty sequence
+ return Primitive2DSequence();
+ }
+
// provide unique ID
ImplPrimitrive2DIDBlock(HitTestPrimitive2D, PRIMITIVE2D_ID_HITTESTPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk
index e10d1ddbcc71..c9a3cc191a35 100644
--- a/drawinglayer/source/primitive2d/makefile.mk
+++ b/drawinglayer/source/primitive2d/makefile.mk
@@ -53,7 +53,9 @@ SLOFILES= \
$(SLO)$/borderlineprimitive2d.obj \
$(SLO)$/chartprimitive2d.obj \
$(SLO)$/controlprimitive2d.obj \
+ $(SLO)$/discretebitmapprimitive2d.obj \
$(SLO)$/embedded3dprimitive2d.obj \
+ $(SLO)$/epsprimitive2d.obj \
$(SLO)$/fillbitmapprimitive2d.obj \
$(SLO)$/fillgradientprimitive2d.obj \
$(SLO)$/fillhatchprimitive2d.obj \
@@ -77,12 +79,16 @@ SLOFILES= \
$(SLO)$/shadowprimitive2d.obj \
$(SLO)$/structuretagprimitive2d.obj \
$(SLO)$/texteffectprimitive2d.obj \
+ $(SLO)$/textenumsprimitive2d.obj \
$(SLO)$/textlayoutdevice.obj \
+ $(SLO)$/textlineprimitive2d.obj \
$(SLO)$/textprimitive2d.obj \
+ $(SLO)$/textstrikeoutprimitive2d.obj \
$(SLO)$/textdecoratedprimitive2d.obj \
$(SLO)$/texthierarchyprimitive2d.obj \
$(SLO)$/transformprimitive2d.obj \
$(SLO)$/unifiedalphaprimitive2d.obj \
+ $(SLO)$/wallpaperprimitive2d.obj \
$(SLO)$/wrongspellprimitive2d.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
index 5737b9ef6cec..acb2335c0d1f 100644
--- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
@@ -55,7 +55,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence MarkerArrayPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence MarkerArrayPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
Primitive2DSequence xRetval;
const std::vector< basegfx::B2DPoint >& rPositions = getPositions();
@@ -100,7 +100,7 @@ namespace drawinglayer
MarkerArrayPrimitive2D::MarkerArrayPrimitive2D(
const std::vector< basegfx::B2DPoint >& rPositions,
const BitmapEx& rMarker)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPositions(rPositions),
maMarker(rMarker)
{
@@ -108,7 +108,7 @@ namespace drawinglayer
bool MarkerArrayPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const MarkerArrayPrimitive2D& rCompare = (MarkerArrayPrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/maskprimitive2d.cxx b/drawinglayer/source/primitive2d/maskprimitive2d.cxx
index 20a4c98db67d..b32abae874ca 100644
--- a/drawinglayer/source/primitive2d/maskprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/maskprimitive2d.cxx
@@ -69,6 +69,11 @@ namespace drawinglayer
return false;
}
+ basegfx::B2DRange MaskPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return getMask().getB2DRange();
+ }
+
// provide unique ID
ImplPrimitrive2DIDBlock(MaskPrimitive2D, PRIMITIVE2D_ID_MASKPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
index 7799b8e66d0e..ba8f81448968 100644
--- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
@@ -53,7 +53,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence MediaPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence MediaPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
Primitive2DSequence xRetval(1);
@@ -114,7 +114,7 @@ namespace drawinglayer
const rtl::OUString& rURL,
const basegfx::BColor& rBackgroundColor,
sal_uInt32 nDiscreteBorder)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maURL(rURL),
maBackgroundColor(rBackgroundColor),
@@ -124,7 +124,7 @@ namespace drawinglayer
bool MediaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const MediaPrimitive2D& rCompare = (MediaPrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 2d1c0428a6a3..2fb3d119d4bd 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -39,6 +39,39 @@
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
+#include <vcl/lineinfo.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <vcl/metaact.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <vcl/salbtype.hxx>
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
+#include <vcl/svapp.hxx>
+#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/wallpaperprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
+#include <i18npool/mslangid.hxx>
+#include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
+#include <numeric>
//////////////////////////////////////////////////////////////////////////////
@@ -46,14 +79,2980 @@ using namespace com::sun::star;
//////////////////////////////////////////////////////////////////////////////
+namespace
+{
+ /** helper class for graphic context
+
+ This class allows to hold a complete status of classic
+ VCL OutputDevice stati. This data is needed for correct
+ interpretation of the MetaFile action flow.
+ */
+ class PropertyHolder
+ {
+ private:
+ /// current transformation (aka MapMode)
+ basegfx::B2DHomMatrix maTransformation;
+ MapUnit maMapUnit;
+
+ /// current colors
+ basegfx::BColor maLineColor;
+ basegfx::BColor maFillColor;
+ basegfx::BColor maTextColor;
+ basegfx::BColor maTextFillColor;
+ basegfx::BColor maTextLineColor;
+ basegfx::BColor maOverlineColor;
+
+ /// clipping, font, etc.
+ Region maRegion;
+ Font maFont;
+ RasterOp maRasterOp;
+ sal_uInt32 mnLayoutMode;
+ LanguageType maLanguageType;
+ sal_uInt16 mnPushFlags;
+
+ /// bitfield
+ /// contains all active markers
+ bool mbLineColor : 1;
+ bool mbFillColor : 1;
+ bool mbTextColor : 1;
+ bool mbTextFillColor : 1;
+ bool mbTextLineColor : 1;
+ bool mbOverlineColor : 1;
+ bool mbRegion : 1;
+
+ public:
+ PropertyHolder()
+ : maTransformation(),
+ maMapUnit(MAP_100TH_MM),
+ maLineColor(),
+ maFillColor(),
+ maTextColor(COL_BLACK),
+ maTextFillColor(),
+ maTextLineColor(),
+ maOverlineColor(),
+ maRegion(),
+ maFont(),
+ maRasterOp(ROP_OVERPAINT),
+ mnLayoutMode(0),
+ maLanguageType(0),
+ mnPushFlags(0),
+ mbLineColor(false),
+ mbFillColor(false),
+ mbTextColor(true),
+ mbTextFillColor(false),
+ mbTextLineColor(false),
+ mbOverlineColor(false),
+ mbRegion(false)
+ {
+ }
+
+ ~PropertyHolder()
+ {
+ }
+
+ /// read/write accesses
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
+ void setTransformation(const basegfx::B2DHomMatrix& rNew) { if(rNew != maTransformation) maTransformation = rNew; }
+
+ MapUnit getMapUnit() const { return maMapUnit; }
+ void setMapUnit(MapUnit eNew) { if(eNew != maMapUnit) maMapUnit = eNew; }
+
+ const basegfx::BColor& getLineColor() const { return maLineColor; }
+ void setLineColor(const basegfx::BColor& rNew) { if(rNew != maLineColor) maLineColor = rNew; }
+ bool getLineColorActive() const { return mbLineColor; }
+ void setLineColorActive(bool bNew) { if(bNew != mbLineColor) mbLineColor = bNew; }
+
+ const basegfx::BColor& getFillColor() const { return maFillColor; }
+ void setFillColor(const basegfx::BColor& rNew) { if(rNew != maFillColor) maFillColor = rNew; }
+ bool getFillColorActive() const { return mbFillColor; }
+ void setFillColorActive(bool bNew) { if(bNew != mbFillColor) mbFillColor = bNew; }
+
+ const basegfx::BColor& getTextColor() const { return maTextColor; }
+ void setTextColor(const basegfx::BColor& rNew) { if(rNew != maTextColor) maTextColor = rNew; }
+ bool getTextColorActive() const { return mbTextColor; }
+ void setTextColorActive(bool bNew) { if(bNew != mbTextColor) mbTextColor = bNew; }
+
+ const basegfx::BColor& getTextFillColor() const { return maTextFillColor; }
+ void setTextFillColor(const basegfx::BColor& rNew) { if(rNew != maTextFillColor) maTextFillColor = rNew; }
+ bool getTextFillColorActive() const { return mbTextFillColor; }
+ void setTextFillColorActive(bool bNew) { if(bNew != mbTextFillColor) mbTextFillColor = bNew; }
+
+ const basegfx::BColor& getTextLineColor() const { return maTextLineColor; }
+ void setTextLineColor(const basegfx::BColor& rNew) { if(rNew != maTextLineColor) maTextLineColor = rNew; }
+ bool getTextLineColorActive() const { return mbTextLineColor; }
+ void setTextLineColorActive(bool bNew) { if(bNew != mbTextLineColor) mbTextLineColor = bNew; }
+
+ const basegfx::BColor& getOverlineColor() const { return maOverlineColor; }
+ void setOverlineColor(const basegfx::BColor& rNew) { if(rNew != maOverlineColor) maOverlineColor = rNew; }
+ bool getOverlineColorActive() const { return mbOverlineColor; }
+ void setOverlineColorActive(bool bNew) { if(bNew != mbOverlineColor) mbOverlineColor = bNew; }
+
+ const Region& getRegion() const { return maRegion; }
+ void setRegion(const Region& rRegion) { if(rRegion != maRegion) maRegion = rRegion; }
+ bool getRegionActive() const { return mbRegion; }
+ void setRegionActive(bool bNew) { if(bNew != mbRegion) mbRegion = bNew; }
+
+ const Font& getFont() const { return maFont; }
+ void setFont(const Font& rFont) { if(rFont != maFont) maFont = rFont; }
+
+ const RasterOp& getRasterOp() const { return maRasterOp; }
+ void setRasterOp(const RasterOp& rRasterOp) { if(rRasterOp != maRasterOp) maRasterOp = rRasterOp; }
+ bool isRasterOpInvert() const { return (ROP_XOR == maRasterOp || ROP_INVERT == maRasterOp); }
+ bool isRasterOpForceBlack() const { return ROP_0 == maRasterOp; }
+ bool isRasterOpActive() const { return isRasterOpInvert() || isRasterOpForceBlack(); }
+
+ sal_uInt32 getLayoutMode() const { return mnLayoutMode; }
+ void setLayoutMode(sal_uInt32 nNew) { if(nNew != mnLayoutMode) mnLayoutMode = nNew; }
+
+ LanguageType getLanguageType() const { return maLanguageType; }
+ void setLanguageType(LanguageType aNew) { if(aNew != maLanguageType) maLanguageType = aNew; }
+
+ sal_uInt16 getPushFlags() const { return mnPushFlags; }
+ void setPushFlags(sal_uInt16 nNew) { if(nNew != mnPushFlags) mnPushFlags = nNew; }
+
+ bool getLineOrFillActive() const { return (mbLineColor || mbFillColor); }
+ };
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ /** stack for properites
+
+ This class builds a stack based on the PropertyHolder
+ class. It encapsulates the pointer/new/delete usage to
+ make it safe and implements the push/pop as needed by a
+ VCL Metafile interpreter. The critical part here are the
+ flag values VCL OutputDevice uses here; not all stuff is
+ pushed and thus needs to be copied at pop.
+ */
+ class PropertyHolders
+ {
+ private:
+ std::vector< PropertyHolder* > maPropertyHolders;
+
+ public:
+ PropertyHolders()
+ {
+ maPropertyHolders.push_back(new PropertyHolder());
+ }
+
+ sal_uInt32 size()
+ {
+ return maPropertyHolders.size();
+ }
+
+ void Push(sal_uInt16 nPushFlags)
+ {
+ if(nPushFlags)
+ {
+ OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: PUSH with no property holders (!)");
+ PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back());
+ pNew->setPushFlags(nPushFlags);
+ maPropertyHolders.push_back(pNew);
+ }
+ }
+
+ void Pop()
+ {
+ OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: POP with no property holders (!)");
+ const sal_uInt32 nSize(maPropertyHolders.size());
+
+ if(nSize)
+ {
+ const PropertyHolder* pTip = maPropertyHolders.back();
+ const sal_uInt16 nPushFlags(pTip->getPushFlags());
+
+ if(nPushFlags)
+ {
+ if(nSize > 1)
+ {
+ // copy back content for all non-set flags
+ PropertyHolder* pLast = maPropertyHolders[nSize - 2];
+
+ if(PUSH_ALL != nPushFlags)
+ {
+ if(!(nPushFlags & PUSH_LINECOLOR ))
+ {
+ pLast->setLineColor(pTip->getLineColor());
+ pLast->setLineColorActive(pTip->getLineColorActive());
+ }
+ if(!(nPushFlags & PUSH_FILLCOLOR ))
+ {
+ pLast->setFillColor(pTip->getFillColor());
+ pLast->setFillColorActive(pTip->getFillColorActive());
+ }
+ if(!(nPushFlags & PUSH_FONT ))
+ {
+ pLast->setFont(pTip->getFont());
+ }
+ if(!(nPushFlags & PUSH_TEXTCOLOR ))
+ {
+ pLast->setTextColor(pTip->getTextColor());
+ pLast->setTextColorActive(pTip->getTextColorActive());
+ }
+ if(!(nPushFlags & PUSH_MAPMODE ))
+ {
+ pLast->setTransformation(pTip->getTransformation());
+ pLast->setMapUnit(pTip->getMapUnit());
+ }
+ if(!(nPushFlags & PUSH_CLIPREGION ))
+ {
+ pLast->setRegion(pTip->getRegion());
+ pLast->setRegionActive(pTip->getRegionActive());
+ }
+ if(!(nPushFlags & PUSH_RASTEROP ))
+ {
+ pLast->setRasterOp(pTip->getRasterOp());
+ }
+ if(!(nPushFlags & PUSH_TEXTFILLCOLOR ))
+ {
+ pLast->setTextFillColor(pTip->getTextFillColor());
+ pLast->setTextFillColorActive(pTip->getTextFillColorActive());
+ }
+ if(!(nPushFlags & PUSH_TEXTALIGN ))
+ {
+ if(pLast->getFont().GetAlign() != pTip->getFont().GetAlign())
+ {
+ Font aFont(pLast->getFont());
+ aFont.SetAlign(pTip->getFont().GetAlign());
+ pLast->setFont(aFont);
+ }
+ }
+ if(!(nPushFlags & PUSH_REFPOINT ))
+ {
+ // not supported
+ }
+ if(!(nPushFlags & PUSH_TEXTLINECOLOR ))
+ {
+ pLast->setTextLineColor(pTip->getTextLineColor());
+ pLast->setTextLineColorActive(pTip->getTextLineColorActive());
+ }
+ if(!(nPushFlags & PUSH_TEXTLAYOUTMODE ))
+ {
+ pLast->setLayoutMode(pTip->getLayoutMode());
+ }
+ if(!(nPushFlags & PUSH_TEXTLANGUAGE ))
+ {
+ pLast->setLanguageType(pTip->getLanguageType());
+ }
+ if(!(nPushFlags & PUSH_OVERLINECOLOR ))
+ {
+ pLast->setOverlineColor(pTip->getOverlineColor());
+ pLast->setOverlineColorActive(pTip->getOverlineColorActive());
+ }
+ }
+ }
+
+ // execute the pop
+ delete maPropertyHolders.back();
+ maPropertyHolders.pop_back();
+ }
+ }
+ }
+
+ PropertyHolder& Current()
+ {
+ OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: CURRENT with no property holders (!)");
+ return *maPropertyHolders.back();
+ }
+
+ ~PropertyHolders()
+ {
+ while(maPropertyHolders.size())
+ {
+ delete maPropertyHolders.back();
+ maPropertyHolders.pop_back();
+ }
+ }
+ };
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ /** helper to convert a Region to a B2DPolyPolygon
+ when it does not yet contain one. In the future
+ this may be expanded to merge the polygons created
+ from rectangles or use a special algo to directly turn
+ the spans of regions to a single, already merged
+ PolyPolygon.
+ */
+ basegfx::B2DPolyPolygon getB2DPolyPolygonFromRegion(const Region& rRegion)
+ {
+ basegfx::B2DPolyPolygon aRetval;
+
+ if(!rRegion.IsEmpty())
+ {
+ Region aRegion(rRegion);
+ aRetval = aRegion.GetB2DPolyPolygon();
+
+ if(!aRetval.count())
+ {
+ RegionHandle aRegionHandle(aRegion.BeginEnumRects());
+ Rectangle aRegionRectangle;
+
+ while(aRegion.GetEnumRects(aRegionHandle, aRegionRectangle))
+ {
+ if(!aRegionRectangle.IsEmpty())
+ {
+ const basegfx::B2DRange aRegionRange(
+ aRegionRectangle.Left(), aRegionRectangle.Top(),
+ aRegionRectangle.Right(), aRegionRectangle.Bottom());
+ aRetval.append(basegfx::tools::createPolygonFromRect(aRegionRange));
+ }
+ }
+
+ aRegion.EndEnumRects(aRegionHandle);
+ }
+ }
+
+ return aRetval;
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ /** Helper class to buffer and hold a Primive target vector. It
+ encapsulates the new/delete functionality and aloows to work
+ on pointers of the implementation classes. All data will
+ be converted to uno sequences of uno references when accessing the
+ data.
+ */
+ class TargetHolder
+ {
+ private:
+ std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aTargets;
+
+ public:
+ TargetHolder()
+ : aTargets()
+ {
+ }
+
+ ~TargetHolder()
+ {
+ const sal_uInt32 nCount(aTargets.size());
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ delete aTargets[a];
+ }
+ }
+
+ sal_uInt32 size()
+ {
+ return aTargets.size();
+ }
+
+ void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate)
+ {
+ if(pCandidate)
+ {
+ aTargets.push_back(pCandidate);
+ }
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence(const PropertyHolder& rPropertyHolder)
+ {
+ const sal_uInt32 nCount(aTargets.size());
+ drawinglayer::primitive2d::Primitive2DSequence xRetval(nCount);
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ xRetval[a] = aTargets[a];
+ }
+
+ // All Targets were pointers, but do not need to be deleted since they
+ // were converted to UNO API references now, so they stay as long as
+ // referenced. Do NOT delete the C++ implementation classes here, but clear
+ // the buffer to not delete them in the destructor.
+ aTargets.clear();
+
+ if(xRetval.hasElements() && rPropertyHolder.getRegionActive())
+ {
+ const Region& rRegion = rPropertyHolder.getRegion();
+
+ if(!rRegion.IsEmpty())
+ {
+ basegfx::B2DPolyPolygon aClipPolyPolygon(getB2DPolyPolygonFromRegion(rRegion));
+
+ if(aClipPolyPolygon.count())
+ {
+ aClipPolyPolygon.transform(rPropertyHolder.getTransformation());
+
+ const drawinglayer::primitive2d::Primitive2DReference xMask(
+ new drawinglayer::primitive2d::MaskPrimitive2D(
+ aClipPolyPolygon,
+ xRetval));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xMask, 1);
+ }
+ }
+ }
+
+ return xRetval;
+ }
+ };
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ /** Helper class which builds a stack on the TargetHolder class */
+ class TargetHolders
+ {
+ private:
+ std::vector< TargetHolder* > maTargetHolders;
+
+ public:
+ TargetHolders()
+ {
+ maTargetHolders.push_back(new TargetHolder());
+ }
+
+ sal_uInt32 size()
+ {
+ return maTargetHolders.size();
+ }
+
+ void Push()
+ {
+ maTargetHolders.push_back(new TargetHolder());
+ }
+
+ void Pop()
+ {
+ OSL_ENSURE(maTargetHolders.size(), "TargetHolders: POP with no property holders (!)");
+ if(maTargetHolders.size())
+ {
+ delete maTargetHolders.back();
+ maTargetHolders.pop_back();
+ }
+ }
+
+ TargetHolder& Current()
+ {
+ OSL_ENSURE(maTargetHolders.size(), "TargetHolders: CURRENT with no property holders (!)");
+ return *maTargetHolders.back();
+ }
+
+ ~TargetHolders()
+ {
+ while(maTargetHolders.size())
+ {
+ delete maTargetHolders.back();
+ maTargetHolders.pop_back();
+ }
+ }
+ };
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** NonOverlappingFillGradientPrimitive2D class
+
+ This is a special version of the FillGradientPrimitive2D which decomposes
+ to a non-overlapping geometry version of the gradient. This needs to be
+ used to support the old XOR paint-'trick'.
+
+ It does not need an own identifier since a renderer who wants to interpret
+ it itself may do so. It just overloads the decomposition of the C++
+ implementation class to do an alternative decomposition.
+ */
+ class NonOverlappingFillGradientPrimitive2D : public FillGradientPrimitive2D
+ {
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(
+ const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ NonOverlappingFillGradientPrimitive2D(
+ const basegfx::B2DRange& rObjectRange,
+ const attribute::FillGradientAttribute& rFillGradient)
+ : FillGradientPrimitive2D(rObjectRange, rFillGradient)
+ {
+ }
+ };
+
+ Primitive2DSequence NonOverlappingFillGradientPrimitive2D::create2DDecomposition(
+ const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return createFill(false);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ /** helper to convert a MapMode to a transformation */
+ basegfx::B2DHomMatrix getTransformFromMapMode(const MapMode& rMapMode)
+ {
+ basegfx::B2DHomMatrix aMapping;
+ const Fraction aNoScale(1, 1);
+ const Point& rOrigin(rMapMode.GetOrigin());
+
+ if(0 != rOrigin.X() || 0 != rOrigin.Y())
+ {
+ aMapping.translate(rOrigin.X(), rOrigin.Y());
+ }
+
+ if(rMapMode.GetScaleX() != aNoScale || rMapMode.GetScaleY() != aNoScale)
+ {
+ aMapping.scale(
+ double(rMapMode.GetScaleX()),
+ double(rMapMode.GetScaleY()));
+ }
+
+ return aMapping;
+ }
+
+ /** helper to create a PointArrayPrimitive2D based on current context */
+ void createPointArrayPrimitive(
+ const std::vector< basegfx::B2DPoint >& rPositions,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties,
+ basegfx::BColor aBColor)
+ {
+ if(rPositions.size())
+ {
+ if(rProperties.getTransformation().isIdentity())
+ {
+ rTarget.append(
+ new drawinglayer::primitive2d::PointArrayPrimitive2D(
+ rPositions,
+ aBColor));
+ }
+ else
+ {
+ std::vector< basegfx::B2DPoint > aPositions(rPositions);
+
+ for(sal_uInt32 a(0); a < aPositions.size(); a++)
+ {
+ aPositions[a] = rProperties.getTransformation() * aPositions[a];
+ }
+
+ rTarget.append(
+ new drawinglayer::primitive2d::PointArrayPrimitive2D(
+ aPositions,
+ aBColor));
+ }
+ }
+ }
+
+ /** helper to create a PolygonHairlinePrimitive2D based on current context */
+ void createHairlinePrimitive(
+ const basegfx::B2DPolygon& rLinePolygon,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(rLinePolygon.count())
+ {
+ basegfx::B2DPolygon aLinePolygon(rLinePolygon);
+ aLinePolygon.transform(rProperties.getTransformation());
+ rTarget.append(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aLinePolygon,
+ rProperties.getLineColor()));
+ }
+ }
+
+ /** helper to create a PolyPolygonColorPrimitive2D based on current context */
+ void createFillPrimitive(
+ const basegfx::B2DPolyPolygon& rFillPolyPolygon,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(rFillPolyPolygon.count())
+ {
+ basegfx::B2DPolyPolygon aFillPolyPolygon(rFillPolyPolygon);
+ aFillPolyPolygon.transform(rProperties.getTransformation());
+ rTarget.append(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ aFillPolyPolygon,
+ rProperties.getFillColor()));
+ }
+ }
+
+ /** helper to create a PolygonStrokePrimitive2D based on current context */
+ void createLinePrimitive(
+ const basegfx::B2DPolygon& rLinePolygon,
+ const LineInfo& rLineInfo,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(rLinePolygon.count())
+ {
+ const bool bDashDotUsed(LINE_DASH == rLineInfo.GetStyle());
+ const bool bWidthUsed(rLineInfo.GetWidth() > 1);
+
+ if(bDashDotUsed || bWidthUsed)
+ {
+ basegfx::B2DPolygon aLinePolygon(rLinePolygon);
+ aLinePolygon.transform(rProperties.getTransformation());
+ const drawinglayer::attribute::LineAttribute aLineAttribute(
+ rProperties.getLineColor(),
+ bWidthUsed ? rLineInfo.GetWidth() : 0.0,
+ rLineInfo.GetLineJoin());
+
+ if(bDashDotUsed)
+ {
+ ::std::vector< double > fDotDashArray;
+ const double fDashLen(rLineInfo.GetDashLen());
+ const double fDotLen(rLineInfo.GetDotLen());
+ const double fDistance(rLineInfo.GetDistance());
+
+ for(sal_uInt16 a(0); a < rLineInfo.GetDashCount(); a++)
+ {
+ fDotDashArray.push_back(fDashLen);
+ fDotDashArray.push_back(fDistance);
+ }
+
+ for(sal_uInt16 b(0); b < rLineInfo.GetDotCount(); b++)
+ {
+ fDotDashArray.push_back(fDotLen);
+ fDotDashArray.push_back(fDistance);
+ }
+
+ const double fAccumulated(::std::accumulate(fDotDashArray.begin(), fDotDashArray.end(), 0.0));
+ const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(
+ fDotDashArray,
+ fAccumulated);
+
+ rTarget.append(
+ new drawinglayer::primitive2d::PolygonStrokePrimitive2D(
+ aLinePolygon,
+ aLineAttribute,
+ aStrokeAttribute));
+ }
+ else
+ {
+ rTarget.append(
+ new drawinglayer::primitive2d::PolygonStrokePrimitive2D(
+ aLinePolygon,
+ aLineAttribute));
+ }
+ }
+ else
+ {
+ createHairlinePrimitive(rLinePolygon, rTarget, rProperties);
+ }
+ }
+ }
+
+ /** helper to create needed line and fill primitives based on current context */
+ void createHairlineAndFillPrimitive(
+ const basegfx::B2DPolygon& rPolygon,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(rProperties.getFillColorActive())
+ {
+ createFillPrimitive(basegfx::B2DPolyPolygon(rPolygon), rTarget, rProperties);
+ }
+
+ if(rProperties.getLineColorActive())
+ {
+ createHairlinePrimitive(rPolygon, rTarget, rProperties);
+ }
+ }
+
+ /** helper to create needed line and fill primitives based on current context */
+ void createHairlineAndFillPrimitive(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(rProperties.getFillColorActive())
+ {
+ createFillPrimitive(rPolyPolygon, rTarget, rProperties);
+ }
+
+ if(rProperties.getLineColorActive())
+ {
+ for(sal_uInt32 a(0); a < rPolyPolygon.count(); a++)
+ {
+ createHairlinePrimitive(rPolyPolygon.getB2DPolygon(a), rTarget, rProperties);
+ }
+ }
+ }
+
+ /** helper to create DiscreteBitmapPrimitive2D based on current context.
+ The DiscreteBitmapPrimitive2D is especially created for this usage
+ since no other usage defines a bitmap visualisation based on top-left
+ position and size in pixels. At the end it will create a view-dependent
+ transformed embedding of a BitmapPrimitive2D.
+ */
+ void createBitmapExPrimitive(
+ const BitmapEx& rBitmapEx,
+ const Point& rPoint,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(!rBitmapEx.IsEmpty())
+ {
+ basegfx::B2DPoint aPoint(rPoint.X(), rPoint.Y());
+ aPoint = rProperties.getTransformation() * aPoint;
+
+ rTarget.append(
+ new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D(
+ rBitmapEx,
+ aPoint));
+ }
+ }
+
+ /** helper to create BitmapPrimitive2D based on current context */
+ void createBitmapExPrimitive(
+ const BitmapEx& rBitmapEx,
+ const Point& rPoint,
+ const Size& rSize,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperties)
+ {
+ if(!rBitmapEx.IsEmpty())
+ {
+ basegfx::B2DHomMatrix aObjectTransform;
+
+ aObjectTransform.set(0, 0, rSize.Width());
+ aObjectTransform.set(1, 1, rSize.Height());
+ aObjectTransform.set(0, 2, rPoint.X());
+ aObjectTransform.set(1, 2, rPoint.Y());
+
+ aObjectTransform = rProperties.getTransformation() * aObjectTransform;
+
+ rTarget.append(
+ new drawinglayer::primitive2d::BitmapPrimitive2D(
+ rBitmapEx,
+ aObjectTransform));
+ }
+ }
+
+ /** helper to create a regular BotmapEx from a MaskAction (definitions
+ which use a bitmap without alpha but define one of the colors as
+ transparent)
+ */
+ BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor)
+ {
+ const Color aWhite(COL_WHITE);
+ BitmapPalette aBiLevelPalette(2);
+
+ aBiLevelPalette[0] = aWhite;
+ aBiLevelPalette[1] = rMaskColor;
+
+ Bitmap aMask(rBitmap.CreateMask(aWhite));
+ Bitmap aSolid(rBitmap.GetSizePixel(), 1, &aBiLevelPalette);
+
+ aSolid.Erase(rMaskColor);
+
+ return BitmapEx(aSolid, aMask);
+ }
+
+ /** helper to convert from a VCL Gradient definition to the corresponding
+ data for primitive representation
+ */
+ drawinglayer::attribute::FillGradientAttribute createFillGradientAttribute(const Gradient& rGradient)
+ {
+ const Color aStartColor(rGradient.GetStartColor());
+ const sal_uInt16 nStartIntens(rGradient.GetStartIntensity());
+ basegfx::BColor aStart(aStartColor.getBColor());
+
+ if(nStartIntens != 100)
+ {
+ const basegfx::BColor aBlack;
+ aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01);
+ }
+
+ const Color aEndColor(rGradient.GetEndColor());
+ const sal_uInt16 nEndIntens(rGradient.GetEndIntensity());
+ basegfx::BColor aEnd(aEndColor.getBColor());
+
+ if(nEndIntens != 100)
+ {
+ const basegfx::BColor aBlack;
+ aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
+ }
+
+ drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GRADIENTSTYLE_RECT);
+
+ switch(rGradient.GetStyle())
+ {
+ case GRADIENT_LINEAR :
+ {
+ aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_LINEAR;
+ break;
+ }
+ case GRADIENT_AXIAL :
+ {
+ aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_AXIAL;
+ break;
+ }
+ case GRADIENT_RADIAL :
+ {
+ aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RADIAL;
+ break;
+ }
+ case GRADIENT_ELLIPTICAL :
+ {
+ aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_ELLIPTICAL;
+ break;
+ }
+ case GRADIENT_SQUARE :
+ {
+ aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_SQUARE;
+ break;
+ }
+ default : // GRADIENT_RECT
+ {
+ aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RECT;
+ break;
+ }
+ }
+
+ return drawinglayer::attribute::FillGradientAttribute(
+ aGradientStyle,
+ (double)rGradient.GetBorder() * 0.01,
+ (double)rGradient.GetOfsX() * 0.01,
+ (double)rGradient.GetOfsY() * 0.01,
+ (double)rGradient.GetAngle() * F_PI1800,
+ aStart,
+ aEnd,
+ rGradient.GetSteps());
+ }
+
+ /** helper to convert from a VCL Hatch definition to the corresponding
+ data for primitive representation
+ */
+ drawinglayer::attribute::FillHatchAttribute createFillHatchAttribute(const Hatch& rHatch)
+ {
+ drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HATCHSTYLE_SINGLE);
+
+ switch(rHatch.GetStyle())
+ {
+ default : // case HATCH_SINGLE :
+ {
+ aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE;
+ }
+ case HATCH_DOUBLE :
+ {
+ aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE;
+ }
+ case HATCH_TRIPLE :
+ {
+ aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE;
+ }
+ }
+
+ return drawinglayer::attribute::FillHatchAttribute(
+ aHatchStyle,
+ (double)rHatch.GetDistance(),
+ (double)rHatch.GetAngle() * F_PI1800,
+ rHatch.GetColor().getBColor(),
+ false);
+ }
+
+ /** helper to take needed action on ClipRegion change. This method needs to be called
+ on any Region change, e.g. at the obvious actions doing this, but also at pop-calls
+ whcih change the Region of the current context. It takes care of creating the
+ current embeddec context, set the new Region at the context and eventually prepare
+ a new target for embracing new geometry to the current region
+ */
+ void HandleNewClipRegion(
+ const Region* pRegion,
+ TargetHolders& rTargetHolders,
+ PropertyHolders& rPropertyHolders)
+ {
+ // process evtl. created primitives which belong to the current region settings
+ if(rPropertyHolders.Current().getRegionActive() && rTargetHolders.size() > 1)
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aSubContent;
+
+ if(!rPropertyHolders.Current().getRegion().IsEmpty() && rTargetHolders.Current().size())
+ {
+ aSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ }
+
+ rTargetHolders.Pop();
+
+ if(aSubContent.hasElements())
+ {
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::GroupPrimitive2D(
+ aSubContent));
+ }
+ }
+
+ // apply new settings
+ const bool bNewActive(pRegion && !pRegion->IsEmpty());
+ rPropertyHolders.Current().setRegionActive(bNewActive);
+
+ if(bNewActive)
+ {
+ rPropertyHolders.Current().setRegion(*pRegion);
+
+ // prepare new content holder for new active region
+ rTargetHolders.Push();
+ }
+ }
+
+ /** helper to handle the change of RasterOp. It takes care of encapsulating all current
+ geometry to the current RasterOp (if changed) and needs to be called on any RasterOp
+ change. It will also start a new geometry target to embrace to the new RasterOp if
+ a changuing RasterOp is used. Currently, ROP_XOR and ROP_INVERT are supported using
+ InvertPrimitive2D, and ROP_0 by using a ModifiedColorPrimitive2D to force to black paint
+ */
+ void HandleNewRasterOp(
+ RasterOp aRasterOp,
+ TargetHolders& rTargetHolders,
+ PropertyHolders& rPropertyHolders)
+ {
+ // check if currently active
+ if(rPropertyHolders.Current().isRasterOpActive() && rTargetHolders.size() > 1)
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aSubContent;
+
+ if(rTargetHolders.Current().size())
+ {
+ aSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ }
+
+ rTargetHolders.Pop();
+
+ if(aSubContent.hasElements())
+ {
+ if(rPropertyHolders.Current().isRasterOpForceBlack())
+ {
+ // force content to black
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
+ aSubContent,
+ basegfx::BColorModifier(basegfx::BColor(0.0, 0.0, 0.0))));
+ }
+ else // if(rPropertyHolders.Current().isRasterOpInvert())
+ {
+ // invert content
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::InvertPrimitive2D(
+ aSubContent));
+ }
+ }
+ }
+
+ // apply new settings
+ rPropertyHolders.Current().setRasterOp(aRasterOp);
+
+ // check if now active
+ if(rPropertyHolders.Current().isRasterOpActive())
+ {
+ // prepare new content holder for new invert
+ rTargetHolders.Push();
+ }
+ }
+
+ /** helper to create needed data to emulate the VCL Wallpaper Metafile action.
+ It is a quite mighty action. This helper is for simple color filled background.
+ */
+ drawinglayer::primitive2d::BasePrimitive2D* CreateColorWallpaper(
+ const basegfx::B2DRange& rRange,
+ const basegfx::BColor& rColor,
+ PropertyHolder& rPropertyHolder)
+ {
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(rRange));
+ aOutline.transform(rPropertyHolder.getTransformation());
+
+ return new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aOutline),
+ rColor);
+ }
+
+ /** helper to create needed data to emulate the VCL Wallpaper Metafile action.
+ It is a quite mighty action. This helper is for gradient filled background.
+ */
+ drawinglayer::primitive2d::BasePrimitive2D* CreateGradientWallpaper(
+ const basegfx::B2DRange& rRange,
+ const Gradient& rGradient,
+ PropertyHolder& rPropertyHolder)
+ {
+ const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient));
+
+ if(aAttribute.getStartColor() == aAttribute.getEndColor())
+ {
+ // not really a gradient. Create filled rectangle
+ return CreateColorWallpaper(rRange, aAttribute.getStartColor(), rPropertyHolder);
+ }
+ else
+ {
+ // really a gradient
+ drawinglayer::primitive2d::BasePrimitive2D* pRetval =
+ new drawinglayer::primitive2d::FillGradientPrimitive2D(
+ rRange,
+ aAttribute);
+
+ if(!rPropertyHolder.getTransformation().isIdentity())
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xPrim(pRetval);
+ const drawinglayer::primitive2d::Primitive2DSequence xSeq(&xPrim, 1);
+
+ pRetval = new drawinglayer::primitive2d::TransformPrimitive2D(
+ rPropertyHolder.getTransformation(),
+ xSeq);
+ }
+
+ return pRetval;
+ }
+ }
+
+ /** helper to create needed data to emulate the VCL Wallpaper Metafile action.
+ It is a quite mighty action. This helper decides if color and/or gradient
+ background is needed for the wnated bitmap fill and then creates the needed
+ WallpaperBitmapPrimitive2D. This primitive was created for this purpose and
+ takes over all needed logic of orientations and tiling.
+ */
+ void CreateAndAppendBitmapWallpaper(
+ basegfx::B2DRange aWallpaperRange,
+ const Wallpaper& rWallpaper,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperty)
+ {
+ const BitmapEx aBitmapEx(rWallpaper.GetBitmap());
+ const WallpaperStyle eWallpaperStyle(rWallpaper.GetStyle());
+
+ // if bitmap visualisation is transparent, maybe background
+ // needs to be filled. Create background
+ if(aBitmapEx.IsTransparent()
+ || (WALLPAPER_TILE != eWallpaperStyle && WALLPAPER_SCALE != eWallpaperStyle))
+ {
+ if(rWallpaper.IsGradient())
+ {
+ rTarget.append(
+ CreateGradientWallpaper(
+ aWallpaperRange,
+ rWallpaper.GetGradient(),
+ rProperty));
+ }
+ else if(!rWallpaper.GetColor().GetTransparency())
+ {
+ rTarget.append(
+ CreateColorWallpaper(
+ aWallpaperRange,
+ rWallpaper.GetColor().getBColor(),
+ rProperty));
+ }
+ }
+
+ // use wallpaper rect if set
+ if(rWallpaper.IsRect() && !rWallpaper.GetRect().IsEmpty())
+ {
+ aWallpaperRange = basegfx::B2DRange(
+ rWallpaper.GetRect().Left(), rWallpaper.GetRect().Top(),
+ rWallpaper.GetRect().Right(), rWallpaper.GetRect().Bottom());
+ }
+
+ drawinglayer::primitive2d::BasePrimitive2D* pBitmapWallpaperFill =
+ new drawinglayer::primitive2d::WallpaperBitmapPrimitive2D(
+ aWallpaperRange,
+ aBitmapEx,
+ eWallpaperStyle);
+
+ if(rProperty.getTransformation().isIdentity())
+ {
+ // add directly
+ rTarget.append(pBitmapWallpaperFill);
+ }
+ else
+ {
+ // when a transformation is set, embed to it
+ const drawinglayer::primitive2d::Primitive2DReference xPrim(pBitmapWallpaperFill);
+
+ rTarget.append(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ rProperty.getTransformation(),
+ drawinglayer::primitive2d::Primitive2DSequence(&xPrim, 1)));
+ }
+ }
+
+ /** helper to decide UnderlineAbove for text primitives */
+ bool isUnderlineAbove(const Font& rFont)
+ {
+ if(!rFont.IsVertical())
+ {
+ return false;
+ }
+
+ if((LANGUAGE_JAPANESE == rFont.GetLanguage()) || (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()))
+ {
+ // the underline is right for Japanese only
+ return true;
+ }
+
+ return false;
+ }
+
+ void createFontAttributeTransformAndAlignment(
+ drawinglayer::attribute::FontAttribute& rFontAttribute,
+ basegfx::B2DHomMatrix& rTextTransform,
+ basegfx::B2DVector& rAlignmentOffset,
+ PropertyHolder& rProperty)
+ {
+ const Font& rFont = rProperty.getFont();
+ basegfx::B2DVector aFontScaling;
+
+ rFontAttribute = drawinglayer::attribute::FontAttribute(
+ drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ aFontScaling,
+ rFont,
+ 0 != (rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_RTL),
+ 0 != (rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_STRONG)));
+
+ // add FontScaling
+ rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY());
+
+ // take text align into account
+ if(ALIGN_BASELINE != rFont.GetAlign())
+ {
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(rFont);
+
+ if(ALIGN_TOP == rFont.GetAlign())
+ {
+ rAlignmentOffset.setY(aTextLayouterDevice.getFontAscent());
+ }
+ else // ALIGN_BOTTOM
+ {
+ rAlignmentOffset.setY(-aTextLayouterDevice.getFontDescent());
+ }
+
+ rTextTransform.translate(rAlignmentOffset.getX(), rAlignmentOffset.getY());
+ }
+
+ // add FontRotation (if used)
+ if(rFont.GetOrientation())
+ {
+ rTextTransform.rotate(-rFont.GetOrientation() * F_PI1800);
+ }
+ }
+
+ /** helper which takes complete care for creating the needed text primitives. It
+ takes care of decorated stuff and all the geometry adaptions needed
+ */
+ void proccessMetaTextAction(
+ const Point& rTextStartPosition,
+ const XubString& rText,
+ sal_uInt16 nTextStart,
+ sal_uInt16 nTextLength,
+ sal_Int32* pDXArray,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperty)
+ {
+ drawinglayer::primitive2d::BasePrimitive2D* pResult = 0;
+ const Font& rFont = rProperty.getFont();
+ std::vector< double > aDXArray;
+ basegfx::B2DVector aAlignmentOffset(0.0, 0.0);
+
+ if(nTextLength)
+ {
+ drawinglayer::attribute::FontAttribute aFontAttribute;
+ basegfx::B2DHomMatrix aTextTransform;
+
+ // fill parameters derived from current font
+ createFontAttributeTransformAndAlignment(
+ aFontAttribute,
+ aTextTransform,
+ aAlignmentOffset,
+ rProperty);
+
+ // add TextStartPosition
+ aTextTransform.translate(rTextStartPosition.X(), rTextStartPosition.Y());
+
+ // preapare DXArray (if used)
+ if(pDXArray && nTextLength)
+ {
+ aDXArray.reserve(nTextLength);
+
+ for(xub_StrLen a(0); a < nTextLength; a++)
+ {
+ aDXArray.push_back((double)(*(pDXArray + a)));
+ }
+ }
+
+ // prepare FontColor and Locale
+ const basegfx::BColor aFontColor(rProperty.getTextColor());
+ const com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale(rProperty.getLanguageType()));
+ const bool bWordLineMode(rFont.IsWordLineMode());
+
+ const bool bDecoratedIsNeeded(
+ UNDERLINE_NONE != rFont.GetOverline()
+ || UNDERLINE_NONE != rFont.GetUnderline()
+ || STRIKEOUT_NONE != rFont.GetStrikeout()
+ || EMPHASISMARK_NONE != (rFont.GetEmphasisMark() & EMPHASISMARK_STYLE)
+ || RELIEF_NONE != rFont.GetRelief()
+ || rFont.IsShadow()
+ || bWordLineMode);
+
+ if(bDecoratedIsNeeded)
+ {
+ // prepare overline, underline and srikeout data
+ const drawinglayer::primitive2d::TextLine eFontOverline(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rFont.GetOverline()));
+ const drawinglayer::primitive2d::TextLine eFontUnderline(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rFont.GetUnderline()));
+ const drawinglayer::primitive2d::TextStrikeout eTextStrikeout(drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rFont.GetStrikeout()));
+
+ // check UndelineAbove
+ const bool bUnderlineAbove(drawinglayer::primitive2d::TEXT_LINE_NONE != eFontUnderline && isUnderlineAbove(rFont));
+
+ // prepare emphasis mark data
+ drawinglayer::primitive2d::TextEmphasisMark eTextEmphasisMark(drawinglayer::primitive2d::TEXT_EMPHASISMARK_NONE);
+
+ switch(rFont.GetEmphasisMark() & EMPHASISMARK_STYLE)
+ {
+ case EMPHASISMARK_DOT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DOT; break;
+ case EMPHASISMARK_CIRCLE : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_CIRCLE; break;
+ case EMPHASISMARK_DISC : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DISC; break;
+ case EMPHASISMARK_ACCENT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_ACCENT; break;
+ }
+
+ const bool bEmphasisMarkAbove(rFont.GetEmphasisMark() & EMPHASISMARK_POS_ABOVE);
+ const bool bEmphasisMarkBelow(rFont.GetEmphasisMark() & EMPHASISMARK_POS_BELOW);
+
+ // prepare font relief data
+ drawinglayer::primitive2d::TextRelief eTextRelief(drawinglayer::primitive2d::TEXT_RELIEF_NONE);
+
+ switch(rFont.GetRelief())
+ {
+ case RELIEF_EMBOSSED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_EMBOSSED; break;
+ case RELIEF_ENGRAVED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_ENGRAVED; break;
+ default : break; // RELIEF_NONE, FontRelief_FORCE_EQUAL_SIZE
+ }
+
+ // prepare shadow/outline data
+ const bool bShadow(rFont.IsShadow());
+
+ // TextDecoratedPortionPrimitive2D is needed, create one
+ pResult = new drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D(
+
+ // attributes for TextSimplePortionPrimitive2D
+ aTextTransform,
+ rText,
+ nTextStart,
+ nTextLength,
+ aDXArray,
+ aFontAttribute,
+ aLocale,
+ aFontColor,
+
+ // attributes for TextDecoratedPortionPrimitive2D
+ rProperty.getOverlineColorActive() ? rProperty.getOverlineColor() : aFontColor,
+ rProperty.getTextLineColorActive() ? rProperty.getTextLineColor() : aFontColor,
+ eFontOverline,
+ eFontUnderline,
+ bUnderlineAbove,
+ eTextStrikeout,
+ bWordLineMode,
+ eTextEmphasisMark,
+ bEmphasisMarkAbove,
+ bEmphasisMarkBelow,
+ eTextRelief,
+ bShadow);
+ }
+ else
+ {
+ // TextSimplePortionPrimitive2D is enough
+ pResult = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aTextTransform,
+ rText,
+ nTextStart,
+ nTextLength,
+ aDXArray,
+ aFontAttribute,
+ aLocale,
+ aFontColor);
+ }
+ }
+
+ if(pResult && rProperty.getTextFillColorActive())
+ {
+ // text background is requested, add and encapsulate both to new primitive
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(rFont);
+
+ // get text width
+ double fTextWidth(0.0);
+
+ if(aDXArray.empty())
+ {
+ fTextWidth = aTextLayouterDevice.getTextWidth(rText, nTextStart, nTextLength);
+ }
+ else
+ {
+ fTextWidth = aDXArray.back();
+ }
+
+ if(basegfx::fTools::more(fTextWidth, 0.0))
+ {
+ // build text range
+ const basegfx::B2DRange aTextRange(
+ 0.0, -aTextLayouterDevice.getFontAscent(),
+ fTextWidth, aTextLayouterDevice.getFontDescent());
+
+ // create Transform
+ basegfx::B2DHomMatrix aTextTransform;
+
+ aTextTransform.translate(aAlignmentOffset.getX(), aAlignmentOffset.getY());
+
+ if(rFont.GetOrientation())
+ {
+ aTextTransform.rotate(-rFont.GetOrientation() * F_PI1800);
+ }
+
+ aTextTransform.translate(rTextStartPosition.X(), rTextStartPosition.Y());
+
+ // prepare Primitive2DSequence, put text in foreground
+ drawinglayer::primitive2d::Primitive2DSequence aSequence(2);
+ aSequence[1] = drawinglayer::primitive2d::Primitive2DReference(pResult);
+
+ // prepare filled polygon
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aTextRange));
+ aOutline.transform(aTextTransform);
+
+ aSequence[0] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aOutline),
+ rProperty.getTextFillColor()));
+
+ // set as group at pResult
+ pResult = new drawinglayer::primitive2d::GroupPrimitive2D(aSequence);
+ }
+ }
+
+ if(pResult)
+ {
+ // add created text primitive to target
+ if(rProperty.getTransformation().isIdentity())
+ {
+ rTarget.append(pResult);
+ }
+ else
+ {
+ // when a transformation is set, embed to it
+ const drawinglayer::primitive2d::Primitive2DReference aReference(pResult);
+
+ rTarget.append(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ rProperty.getTransformation(),
+ drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1)));
+ }
+ }
+ }
+
+ /** helper which takes complete care for creating the needed textLine primitives */
+ void proccessMetaTextLineAction(
+ const MetaTextLineAction& rAction,
+ TargetHolder& rTarget,
+ PropertyHolder& rProperty)
+ {
+ const double fLineWidth(fabs((double)rAction.GetWidth()));
+
+ if(fLineWidth > 0.0)
+ {
+ const drawinglayer::primitive2d::TextLine aOverlineMode(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rAction.GetOverline()));
+ const drawinglayer::primitive2d::TextLine aUnderlineMode(drawinglayer::primitive2d::mapFontUnderlineToTextLine(rAction.GetUnderline()));
+ const drawinglayer::primitive2d::TextStrikeout aTextStrikeout(drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rAction.GetStrikeout()));
+
+ const bool bOverlineUsed(drawinglayer::primitive2d::TEXT_LINE_NONE != aOverlineMode);
+ const bool bUnderlineUsed(drawinglayer::primitive2d::TEXT_LINE_NONE != aUnderlineMode);
+ const bool bStrikeoutUsed(drawinglayer::primitive2d::TEXT_STRIKEOUT_NONE != aTextStrikeout);
+
+ if(bUnderlineUsed || bStrikeoutUsed || bOverlineUsed)
+ {
+ std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aTargetVector;
+ basegfx::B2DVector aAlignmentOffset(0.0, 0.0);
+ drawinglayer::attribute::FontAttribute aFontAttribute;
+ basegfx::B2DHomMatrix aTextTransform;
+
+ // fill parameters derived from current font
+ createFontAttributeTransformAndAlignment(
+ aFontAttribute,
+ aTextTransform,
+ aAlignmentOffset,
+ rProperty);
+
+ // add TextStartPosition
+ aTextTransform.translate(rAction.GetStartPoint().X(), rAction.GetStartPoint().Y());
+
+ // prepare TextLayouter (used in most cases)
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ aTextLayouter.setFont(rProperty.getFont());
+
+ if(bOverlineUsed)
+ {
+ // create primitive geometry for overline
+ aTargetVector.push_back(
+ new drawinglayer::primitive2d::TextLinePrimitive2D(
+ aTextTransform,
+ fLineWidth,
+ aTextLayouter.getOverlineOffset(),
+ aTextLayouter.getOverlineHeight(),
+ aOverlineMode,
+ rProperty.getOverlineColor()));
+ }
+
+ if(bUnderlineUsed)
+ {
+ // create primitive geometry for underline
+ aTargetVector.push_back(
+ new drawinglayer::primitive2d::TextLinePrimitive2D(
+ aTextTransform,
+ fLineWidth,
+ aTextLayouter.getUnderlineOffset(),
+ aTextLayouter.getUnderlineHeight(),
+ aUnderlineMode,
+ rProperty.getTextLineColor()));
+ }
+
+ if(bStrikeoutUsed)
+ {
+ // create primitive geometry for strikeout
+ if(drawinglayer::primitive2d::TEXT_STRIKEOUT_SLASH == aTextStrikeout
+ || drawinglayer::primitive2d::TEXT_STRIKEOUT_X == aTextStrikeout)
+ {
+ // strikeout with character
+ const sal_Unicode aStrikeoutChar(
+ drawinglayer::primitive2d::TEXT_STRIKEOUT_SLASH == aTextStrikeout ? '/' : 'X');
+ const com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale(
+ rProperty.getLanguageType()));
+
+ aTargetVector.push_back(
+ new drawinglayer::primitive2d::TextCharacterStrikeoutPrimitive2D(
+ aTextTransform,
+ fLineWidth,
+ rProperty.getTextColor(),
+ aStrikeoutChar,
+ aFontAttribute,
+ aLocale));
+ }
+ else
+ {
+ // strikeout with geometry
+ aTargetVector.push_back(
+ new drawinglayer::primitive2d::TextGeometryStrikeoutPrimitive2D(
+ aTextTransform,
+ fLineWidth,
+ rProperty.getTextColor(),
+ aTextLayouter.getUnderlineHeight(),
+ aTextLayouter.getStrikeoutOffset(),
+ aTextStrikeout));
+ }
+ }
+
+ if(aTargetVector.size())
+ {
+ // add created text primitive to target
+ if(rProperty.getTransformation().isIdentity())
+ {
+ for(sal_uInt32 a(0); a < aTargetVector.size(); a++)
+ {
+ rTarget.append(aTargetVector[a]);
+ }
+ }
+ else
+ {
+ // when a transformation is set, embed to it
+ drawinglayer::primitive2d::Primitive2DSequence xTargets(aTargetVector.size());
+
+ for(sal_uInt32 a(0); a < aTargetVector.size(); a++)
+ {
+ xTargets[a] = drawinglayer::primitive2d::Primitive2DReference(aTargetVector[a]);
+ }
+
+ rTarget.append(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ rProperty.getTransformation(),
+ xTargets));
+ }
+ }
+ }
+ }
+
+ }
+
+ /** This is the main interpreter method. It is designed to handle the given Metafile
+ completely inside the given context and target. It may use and modify the context and
+ target. This design allows to call itself recursively wich adapted contexts and
+ targets as e.g. needed for the META_FLOATTRANSPARENT_ACTION where the content is expressed
+ as a metafile as sub-content.
+
+ This interpreter is as free of VCL functionality as possible. It uses VCL data classes
+ (else reading the data would not be possible), but e.g. does NOT use a local OutputDevice
+ as most other MetaFile interpreters/exporters do to hold and work with the current context.
+ This is necessary to be able to get away from the strong internal VCL-binding.
+
+ It tries to combine e.g. pixel and/or point actions and to stitch together single line primitives
+ where possible (which is not trivial with the possible line geometry definitions).
+
+ It tries to handle clipping no longer as Regions and spans of Rectangles, but as PolyPolygon
+ ClipRegions with (where possible) high precision by using the best possible data quality
+ from the Region. The Region is unavoidable as data container, but nowadays allows the transport
+ of Polygon-based clip regions. Where this is not used, a Polygon is constructed from the
+ Region ranges. All primitive clipping uses the MaskPrimitive2D with Polygon-based clipping.
+
+ I have marked the single MetaActions with:
+
+ SIMPLE, DONE:
+ Simple, e.g nothing to do or value setting in the context
+
+ CHECKED, WORKS WELL:
+ Thoroughly tested with extra written test code which created a replacement
+ Metafile just to test this action in various combinations
+
+ NEEDS IMPLEMENTATION:
+ Not implemented and asserted, but also no usage found, neither in own Metafile
+ creations, nor in EMF/WMF imports (checked with a whole bunch of critical EMF/WMF
+ bugdocs)
+
+ For more commens, see the single action implementations.
+ */
+ void interpretMetafile(
+ const GDIMetaFile& rMetaFile,
+ TargetHolders& rTargetHolders,
+ PropertyHolders& rPropertyHolders,
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation)
+ {
+ const sal_uInt32 nCount(rMetaFile.GetActionCount());
+
+ for(sal_uInt32 nAction(0); nAction < nCount; nAction++)
+ {
+ MetaAction* pAction = rMetaFile.GetAction(nAction);
+
+ switch(pAction->GetType())
+ {
+ case META_NULL_ACTION :
+ {
+ /** SIMPLE, DONE */
+ break;
+ }
+ case META_PIXEL_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ std::vector< basegfx::B2DPoint > aPositions;
+ Color aLastColor(COL_BLACK);
+
+ while(META_PIXEL_ACTION == pAction->GetType() && nAction < nCount)
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction*)pAction;
+
+ if(pA->GetColor() != aLastColor)
+ {
+ if(aPositions.size())
+ {
+ createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), aLastColor.getBColor());
+ aPositions.clear();
+ }
+
+ aLastColor = pA->GetColor();
+ }
+
+ const Point& rPoint = pA->GetPoint();
+ aPositions.push_back(basegfx::B2DPoint(rPoint.X(), rPoint.Y()));
+ nAction++; if(nAction < nCount) pAction = rMetaFile.GetAction(nAction);
+ }
+
+ nAction--;
+
+ if(aPositions.size())
+ {
+ createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), aLastColor.getBColor());
+ }
+
+ break;
+ }
+ case META_POINT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineColorActive())
+ {
+ std::vector< basegfx::B2DPoint > aPositions;
+
+ while(META_POINT_ACTION == pAction->GetType() && nAction < nCount)
+ {
+ const MetaPointAction* pA = (const MetaPointAction*)pAction;
+ const Point& rPoint = pA->GetPoint();
+ aPositions.push_back(basegfx::B2DPoint(rPoint.X(), rPoint.Y()));
+ nAction++; if(nAction < nCount) pAction = rMetaFile.GetAction(nAction);
+ }
+
+ nAction--;
+
+ if(aPositions.size())
+ {
+ createPointArrayPrimitive(aPositions, rTargetHolders.Current(), rPropertyHolders.Current(), rPropertyHolders.Current().getLineColor());
+ }
+ }
+
+ break;
+ }
+ case META_LINE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineColorActive())
+ {
+ basegfx::B2DPolygon aLinePolygon;
+ LineInfo aLineInfo;
+
+ while(META_LINE_ACTION == pAction->GetType() && nAction < nCount)
+ {
+ const MetaLineAction* pA = (const MetaLineAction*)pAction;
+ const Point& rStartPoint = pA->GetStartPoint();
+ const Point& rEndPoint = pA->GetEndPoint();
+ const basegfx::B2DPoint aStart(rStartPoint.X(), rStartPoint.Y());
+ const basegfx::B2DPoint aEnd(rEndPoint.X(), rEndPoint.Y());
+
+ if(aLinePolygon.count())
+ {
+ if(pA->GetLineInfo() == aLineInfo
+ && aStart == aLinePolygon.getB2DPoint(aLinePolygon.count() - 1))
+ {
+ aLinePolygon.append(aEnd);
+ }
+ else
+ {
+ aLineInfo.SetLineJoin(basegfx::B2DLINEJOIN_NONE); // It were lines; force to NONE
+ createLinePrimitive(aLinePolygon, aLineInfo, rTargetHolders.Current(), rPropertyHolders.Current());
+ aLinePolygon.clear();
+ aLineInfo = pA->GetLineInfo();
+ aLinePolygon.append(aStart);
+ aLinePolygon.append(aEnd);
+ }
+ }
+ else
+ {
+ aLineInfo = pA->GetLineInfo();
+ aLinePolygon.append(aStart);
+ aLinePolygon.append(aEnd);
+ }
+
+ nAction++; if(nAction < nCount) pAction = rMetaFile.GetAction(nAction);
+ }
+
+ nAction--;
+
+ if(aLinePolygon.count())
+ {
+ aLineInfo.SetLineJoin(basegfx::B2DLINEJOIN_NONE); // It were lines; force to NONE
+ createLinePrimitive(aLinePolygon, aLineInfo, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+ }
+
+ break;
+ }
+ case META_RECT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaRectAction* pA = (const MetaRectAction*)pAction;
+ const Rectangle& rRectangle = pA->GetRect();
+
+ if(!rRectangle.IsEmpty())
+ {
+ const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ if(!aRange.isEmpty())
+ {
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+ }
+ }
+
+ break;
+ }
+ case META_ROUNDRECT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ /** The original OutputDevice::DrawRect paints nothing when nHor or nVer is zero; but just
+ because the tools::Polygon operator creating the rounding does produce nonsense. I assume
+ this an error and create an unrounded rectangle in that case (implicit in
+ createPolygonFromRect)
+ */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*)pAction;
+ const Rectangle& rRectangle = pA->GetRect();
+
+ if(!rRectangle.IsEmpty())
+ {
+ const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ if(!aRange.isEmpty())
+ {
+ const sal_uInt32 nHor(pA->GetHorzRound());
+ const sal_uInt32 nVer(pA->GetVertRound());
+ basegfx::B2DPolygon aOutline;
+
+ if(nHor || nVer)
+ {
+ double fRadiusX((nHor * 2.0) / (aRange.getWidth() > 0.0 ? aRange.getWidth() : 1.0));
+ double fRadiusY((nVer * 2.0) / (aRange.getHeight() > 0.0 ? aRange.getHeight() : 1.0));
+ fRadiusX = std::max(0.0, std::min(1.0, fRadiusX));
+ fRadiusY = std::max(0.0, std::min(1.0, fRadiusY));
+
+ aOutline = basegfx::tools::createPolygonFromRect(aRange, fRadiusX, fRadiusY);
+ }
+ else
+ {
+ aOutline = basegfx::tools::createPolygonFromRect(aRange);
+ }
+
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+ }
+ }
+
+ break;
+ }
+ case META_ELLIPSE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*)pAction;
+ const Rectangle& rRectangle = pA->GetRect();
+
+ if(!rRectangle.IsEmpty())
+ {
+ const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ if(!aRange.isEmpty())
+ {
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromEllipse(
+ aRange.getCenter(), aRange.getWidth() * 0.5, aRange.getHeight() * 0.5));
+
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+ }
+ }
+
+ break;
+ }
+ case META_ARC_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineColorActive())
+ {
+ const MetaArcAction* pA = (const MetaArcAction*)pAction;
+ const Polygon aToolsPoly(pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_ARC);
+ const basegfx::B2DPolygon aOutline(aToolsPoly.getB2DPolygon());
+
+ createHairlinePrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_PIE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaPieAction* pA = (const MetaPieAction*)pAction;
+ const Polygon aToolsPoly(pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_PIE);
+ const basegfx::B2DPolygon aOutline(aToolsPoly.getB2DPolygon());
+
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_CHORD_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaChordAction* pA = (const MetaChordAction*)pAction;
+ const Polygon aToolsPoly(pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_CHORD);
+ const basegfx::B2DPolygon aOutline(aToolsPoly.getB2DPolygon());
+
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_POLYLINE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineColorActive())
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*)pAction;
+ createLinePrimitive(pA->GetPolygon().getB2DPolygon(), pA->GetLineInfo(), rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_POLYGON_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaPolygonAction* pA = (const MetaPolygonAction*)pAction;
+ basegfx::B2DPolygon aOutline(pA->GetPolygon().getB2DPolygon());
+
+ // the metafile play interprets the polygons from MetaPolygonAction
+ // always as closed and always paints an edge from last to first point,
+ // so force to closed here to emulate that
+ if(aOutline.count() > 1 && !aOutline.isClosed())
+ {
+ aOutline.setClosed(true);
+ }
+
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_POLYPOLYGON_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ if(rPropertyHolders.Current().getLineOrFillActive())
+ {
+ const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*)pAction;
+ basegfx::B2DPolyPolygon aPolyPolygonOutline(pA->GetPolyPolygon().getB2DPolyPolygon());
+
+ // the metafile play interprets the single polygons from MetaPolyPolygonAction
+ // always as closed and always paints an edge from last to first point,
+ // so force to closed here to emulate that
+ for(sal_uInt32 b(0); b < aPolyPolygonOutline.count(); b++)
+ {
+ basegfx::B2DPolygon aPolygonOutline(aPolyPolygonOutline.getB2DPolygon(b));
+
+ if(aPolygonOutline.count() > 1 && !aPolygonOutline.isClosed())
+ {
+ aPolygonOutline.setClosed(true);
+ aPolyPolygonOutline.setB2DPolygon(b, aPolygonOutline);
+ }
+ }
+
+ createHairlineAndFillPrimitive(aPolyPolygonOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_TEXT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaTextAction* pA = (const MetaTextAction*)pAction;
+
+ if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive())
+ {
+ proccessMetaTextAction(
+ pA->GetPoint(),
+ pA->GetText(),
+ pA->GetIndex(),
+ pA->GetLen(),
+ 0,
+ rTargetHolders.Current(),
+ rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_TEXTARRAY_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*)pAction;
+
+ if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive())
+ {
+ proccessMetaTextAction(
+ pA->GetPoint(),
+ pA->GetText(),
+ pA->GetIndex(),
+ pA->GetLen(),
+ pA->GetDXArray(),
+ rTargetHolders.Current(),
+ rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_STRETCHTEXT_ACTION :
+ {
+ /** NEEDS IMPLEMENTATION */
+ OSL_ENSURE(false, "META_STRETCHTEXT_ACTION requested (!)");
+ // use OutputDevice::GetTextArray() to map the...
+ // const MetaStretchTextAction* pA = (const MetaStretchTextAction*)pAction;
+ break;
+ }
+ case META_TEXTRECT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ // OSL_ENSURE(false, "META_TEXTRECT_ACTION requested (!)");
+ const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction;
+ const Rectangle& rRectangle = pA->GetRect();
+
+ if(!rRectangle.IsEmpty() && 0 != pA->GetText().Len())
+ {
+ // The problem with this action is that it describes unlayouted text
+ // and the layout capabilities are in EditEngine/Outliner in SVX. The
+ // same problem is true for VCL which internally has implementations
+ // to layout text in this case. There exists even a call
+ // OutputDevice::AddTextRectActions(...) to create the needed actions
+ // as 'sub-content' of a Metafile. Unfortunately i do not have an
+ // OutputDevice here since this interpreter tries to work without
+ // VCL AFAP.
+ // Since AddTextRectActions is the only way as long as we do not have
+ // a simple text layouter available, i will try to add it to the
+ // TextLayouterDevice isloation.
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont());
+ GDIMetaFile aGDIMetaFile;
+
+ aTextLayouterDevice.addTextRectActions(
+ rRectangle, pA->GetText(), pA->GetStyle(), aGDIMetaFile);
+
+ if(aGDIMetaFile.GetActionCount())
+ {
+ // cerate sub-content
+ drawinglayer::primitive2d::Primitive2DSequence xSubContent;
+ {
+ rTargetHolders.Push();
+ interpretMetafile(aGDIMetaFile, rTargetHolders, rPropertyHolders, rViewInformation);
+ xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ rTargetHolders.Pop();
+ }
+
+ if(xSubContent.hasElements())
+ {
+ // add with transformation
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ rPropertyHolders.Current().getTransformation(),
+ xSubContent));
+ }
+ }
+ }
+
+ break;
+ }
+ case META_BMP_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaBmpAction* pA = (const MetaBmpAction*)pAction;
+ const BitmapEx aBitmapEx(pA->GetBitmap());
+
+ createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current());
+
+ break;
+ }
+ case META_BMPSCALE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*)pAction;
+ const Bitmap aBitmapEx(pA->GetBitmap());
+
+ createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current());
+
+ break;
+ }
+ case META_BMPSCALEPART_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*)pAction;
+ const Bitmap& rBitmap = pA->GetBitmap();
+
+ if(!rBitmap.IsEmpty())
+ {
+ Bitmap aCroppedBitmap(rBitmap);
+ const Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize());
+
+ if(!aCropRectangle.IsEmpty())
+ {
+ aCroppedBitmap.Crop(aCropRectangle);
+ }
+
+ const BitmapEx aCroppedBitmapEx(aCroppedBitmap);
+ createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_BMPEX_ACTION :
+ {
+ /** CHECKED, WORKS WELL: Simply same as META_BMP_ACTION */
+ const MetaBmpExAction* pA = (const MetaBmpExAction*)pAction;
+ const BitmapEx& rBitmapEx = pA->GetBitmapEx();
+
+ createBitmapExPrimitive(rBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current());
+
+ break;
+ }
+ case META_BMPEXSCALE_ACTION :
+ {
+ /** CHECKED, WORKS WELL: Simply same as META_BMPSCALE_ACTION */
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*)pAction;
+ const BitmapEx& rBitmapEx = pA->GetBitmapEx();
+
+ createBitmapExPrimitive(rBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current());
+
+ break;
+ }
+ case META_BMPEXSCALEPART_ACTION :
+ {
+ /** CHECKED, WORKS WELL: Simply same as META_BMPSCALEPART_ACTION */
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*)pAction;
+ const BitmapEx& rBitmapEx = pA->GetBitmapEx();
+
+ if(!rBitmapEx.IsEmpty())
+ {
+ BitmapEx aCroppedBitmapEx(rBitmapEx);
+ const Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize());
+
+ if(!aCropRectangle.IsEmpty())
+ {
+ aCroppedBitmapEx.Crop(aCropRectangle);
+ }
+
+ createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_MASK_ACTION :
+ {
+ /** CHECKED, WORKS WELL: Simply same as META_BMP_ACTION */
+ const MetaMaskAction* pA = (const MetaMaskAction*)pAction;
+ const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor()));
+
+ createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), rTargetHolders.Current(), rPropertyHolders.Current());
+
+ break;
+ }
+ case META_MASKSCALE_ACTION :
+ {
+ /** CHECKED, WORKS WELL: Simply same as META_BMPSCALE_ACTION */
+ const MetaMaskScaleAction* pA = (const MetaMaskScaleAction*)pAction;
+ const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor()));
+
+ createBitmapExPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current());
+
+ break;
+ }
+ case META_MASKSCALEPART_ACTION :
+ {
+ /** CHECKED, WORKS WELL: Simply same as META_BMPSCALEPART_ACTION */
+ const MetaMaskScalePartAction* pA = (const MetaMaskScalePartAction*)pAction;
+ const Bitmap& rBitmap = pA->GetBitmap();
+
+ if(!rBitmap.IsEmpty())
+ {
+ Bitmap aCroppedBitmap(rBitmap);
+ const Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize());
+
+ if(!aCropRectangle.IsEmpty())
+ {
+ aCroppedBitmap.Crop(aCropRectangle);
+ }
+
+ const BitmapEx aCroppedBitmapEx(createMaskBmpEx(aCroppedBitmap, pA->GetColor()));
+ createBitmapExPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+
+ break;
+ }
+ case META_GRADIENT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaGradientAction* pA = (const MetaGradientAction*)pAction;
+ const Rectangle& rRectangle = pA->GetRect();
+
+ if(!rRectangle.IsEmpty())
+ {
+ basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ if(!aRange.isEmpty())
+ {
+ const Gradient& rGradient = pA->GetGradient();
+ const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient));
+
+ if(aAttribute.getStartColor() == aAttribute.getEndColor())
+ {
+ // not really a gradient. Create filled rectangle
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+ createFillPrimitive(basegfx::B2DPolyPolygon(aOutline), rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+ else
+ {
+ // really a gradient
+ aRange.transform(rPropertyHolders.Current().getTransformation());
+
+ if(rPropertyHolders.Current().isRasterOpInvert())
+ {
+ // use a special version of FillGradientPrimitive2D which creates
+ // non-overlapping geometry on decomposition to makethe old XOR
+ // paint 'trick' work.
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::NonOverlappingFillGradientPrimitive2D(
+ aRange,
+ aAttribute));
+ }
+ else
+ {
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::FillGradientPrimitive2D(
+ aRange,
+ aAttribute));
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ case META_HATCH_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaHatchAction* pA = (const MetaHatchAction*)pAction;
+ basegfx::B2DPolyPolygon aOutline(pA->GetPolyPolygon().getB2DPolyPolygon());
+
+ if(aOutline.count())
+ {
+ const Hatch& rHatch = pA->GetHatch();
+ const drawinglayer::attribute::FillHatchAttribute aAttribute(createFillHatchAttribute(rHatch));
+
+ aOutline.transform(rPropertyHolders.Current().getTransformation());
+
+ const basegfx::B2DRange aObjectRange(aOutline.getB2DRange());
+ const drawinglayer::primitive2d::Primitive2DReference aFillHatch(
+ new drawinglayer::primitive2d::FillHatchPrimitive2D(
+ aObjectRange,
+ basegfx::BColor(),
+ aAttribute));
+
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::MaskPrimitive2D(
+ aOutline,
+ drawinglayer::primitive2d::Primitive2DSequence(&aFillHatch, 1)));
+ }
+
+ break;
+ }
+ case META_WALLPAPER_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaWallpaperAction* pA = (const MetaWallpaperAction*)pAction;
+ Rectangle aWallpaperRectangle(pA->GetRect());
+
+ if(!aWallpaperRectangle.IsEmpty())
+ {
+ const Wallpaper& rWallpaper = pA->GetWallpaper();
+ const WallpaperStyle eWallpaperStyle(rWallpaper.GetStyle());
+ basegfx::B2DRange aWallpaperRange(
+ aWallpaperRectangle.Left(), aWallpaperRectangle.Top(),
+ aWallpaperRectangle.Right(), aWallpaperRectangle.Bottom());
+
+ if(WALLPAPER_NULL != eWallpaperStyle)
+ {
+ if(rWallpaper.IsBitmap())
+ {
+ // create bitmap background. Caution: This
+ // also will create gradient/color background(s)
+ // when the bitmap is transparent or not tiled
+ CreateAndAppendBitmapWallpaper(
+ aWallpaperRange,
+ rWallpaper,
+ rTargetHolders.Current(),
+ rPropertyHolders.Current());
+ }
+ else if(rWallpaper.IsGradient())
+ {
+ // create gradient background
+ rTargetHolders.Current().append(
+ CreateGradientWallpaper(
+ aWallpaperRange,
+ rWallpaper.GetGradient(),
+ rPropertyHolders.Current()));
+ }
+ else if(!rWallpaper.GetColor().GetTransparency())
+ {
+ // create color background
+ rTargetHolders.Current().append(
+ CreateColorWallpaper(
+ aWallpaperRange,
+ rWallpaper.GetColor().getBColor(),
+ rPropertyHolders.Current()));
+ }
+ }
+ }
+
+ break;
+ }
+ case META_CLIPREGION_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaClipRegionAction* pA = (const MetaClipRegionAction*)pAction;
+
+ if(pA->IsClipping())
+ {
+ // new clipping
+ HandleNewClipRegion(&pA->GetRegion(), rTargetHolders, rPropertyHolders);
+ }
+ else
+ {
+ // end clipping
+ HandleNewClipRegion(0, rTargetHolders, rPropertyHolders);
+ }
+
+ break;
+ }
+ case META_ISECTRECTCLIPREGION_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*)pAction;
+ const Rectangle& rRectangle = pA->GetRect();
+
+ if(rRectangle.IsEmpty())
+ {
+ // intersect with empty rectangle will always give empty
+ // region; start new clipping with empty region
+ const Region aNewRegion;
+ HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ }
+ else
+ {
+ if(rPropertyHolders.Current().getRegionActive())
+ {
+ if(rPropertyHolders.Current().getRegion().IsEmpty())
+ {
+ // nothing to do, empty active clip region will stay
+ // empty when intersecting
+ }
+ else
+ {
+ // AND existing region and new rectangle
+ const basegfx::B2DPolyPolygon aOriginalPolyPolygon(
+ getB2DPolyPolygonFromRegion(rPropertyHolders.Current().getRegion()));
+ basegfx::B2DPolyPolygon aClippedPolyPolygon;
+
+ if(aOriginalPolyPolygon.count())
+ {
+ const basegfx::B2DRange aIntersectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnRange(
+ aOriginalPolyPolygon, aIntersectRange, true, false);
+ }
+
+ if(aClippedPolyPolygon != aOriginalPolyPolygon)
+ {
+ // start new clipping with intersected region
+ const Region aNewRegion(aClippedPolyPolygon);
+ HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ }
+ }
+ }
+ else
+ {
+ // start new clipping with rectangle
+ const Region aNewRegion(rRectangle);
+ HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ }
+ }
+
+ break;
+ }
+ case META_ISECTREGIONCLIPREGION_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*)pAction;
+ const Region& rNewRegion = pA->GetRegion();
+
+ if(rNewRegion.IsEmpty())
+ {
+ // intersect with empty region will always give empty
+ // region; start new clipping with empty region
+ const Region aNewRegion;
+ HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ }
+ else
+ {
+ if(rPropertyHolders.Current().getRegionActive())
+ {
+ if(rPropertyHolders.Current().getRegion().IsEmpty())
+ {
+ // nothing to do, empty active clip region will stay empty
+ // when intersecting with any region
+ }
+ else
+ {
+ // AND existing and new region
+ const basegfx::B2DPolyPolygon aOriginalPolyPolygon(
+ getB2DPolyPolygonFromRegion(rPropertyHolders.Current().getRegion()));
+ basegfx::B2DPolyPolygon aClippedPolyPolygon;
+
+ if(aOriginalPolyPolygon.count())
+ {
+ const basegfx::B2DPolyPolygon aClipPolyPolygon(
+ getB2DPolyPolygonFromRegion(rNewRegion));
+
+ if(aClipPolyPolygon.count())
+ {
+ aClippedPolyPolygon = basegfx::tools::clipPolyPolygonOnPolyPolygon(
+ aOriginalPolyPolygon, aClipPolyPolygon, true, false);
+ }
+ }
+
+ if(aClippedPolyPolygon != aOriginalPolyPolygon)
+ {
+ // start new clipping with intersected region
+ const Region aNewRegion(aClippedPolyPolygon);
+ HandleNewClipRegion(&aNewRegion, rTargetHolders, rPropertyHolders);
+ }
+ }
+ }
+ else
+ {
+ // start new clipping with new region
+ HandleNewClipRegion(&rNewRegion, rTargetHolders, rPropertyHolders);
+ }
+ }
+
+ break;
+ }
+ case META_MOVECLIPREGION_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*)pAction;
+
+ if(rPropertyHolders.Current().getRegionActive())
+ {
+ if(rPropertyHolders.Current().getRegion().IsEmpty())
+ {
+ // nothing to do
+ }
+ else
+ {
+ // move using old interface
+ Region aRegion(rPropertyHolders.Current().getRegion());
+
+ const sal_Int32 nHor(pA->GetHorzMove());
+ const sal_Int32 nVer(pA->GetVertMove());
+
+ if(0 != nHor || 0 != nVer)
+ {
+ aRegion.Move(nHor, nVer);
+ HandleNewClipRegion(&aRegion, rTargetHolders, rPropertyHolders);
+ }
+ }
+ }
+
+ break;
+ }
+ case META_LINECOLOR_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaLineColorAction* pA = (const MetaLineColorAction*)pAction;
+ const bool bActive(pA->IsSetting());
+
+ rPropertyHolders.Current().setLineColorActive(bActive);
+ if(bActive)
+ rPropertyHolders.Current().setLineColor(pA->GetColor().getBColor());
+
+ break;
+ }
+ case META_FILLCOLOR_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaFillColorAction* pA = (const MetaFillColorAction*)pAction;
+ const bool bActive(pA->IsSetting());
+
+ rPropertyHolders.Current().setFillColorActive(bActive);
+ if(bActive)
+ rPropertyHolders.Current().setFillColor(pA->GetColor().getBColor());
+
+ break;
+ }
+ case META_TEXTCOLOR_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaTextColorAction* pA = (const MetaTextColorAction*)pAction;
+ const bool bActivate(COL_TRANSPARENT != pA->GetColor().GetColor());
+
+ rPropertyHolders.Current().setTextColorActive(bActivate);
+ rPropertyHolders.Current().setTextColor(pA->GetColor().getBColor());
+
+ break;
+ }
+ case META_TEXTFILLCOLOR_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*)pAction;
+ const bool bWithColorArgument(pA->IsSetting());
+
+ if(bWithColorArgument)
+ {
+ // emulate OutputDevice::SetTextFillColor(...) WITH argument
+ const Color& rFontFillColor = pA->GetColor();
+ rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor());
+ rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor());
+ }
+ else
+ {
+ // emulate SetFillColor() <- NO argument (!)
+ rPropertyHolders.Current().setTextFillColorActive(false);
+ }
+
+ break;
+ }
+ case META_TEXTALIGN_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaTextAlignAction* pA = (const MetaTextAlignAction*)pAction;
+ const TextAlign aNewTextAlign = pA->GetTextAlign();
+
+ // TextAlign is applied to the current font (as in
+ // OutputDevice::SetTextAlign which would be used when
+ // playing the Metafile)
+ if(rPropertyHolders.Current().getFont().GetAlign() != aNewTextAlign)
+ {
+ Font aNewFont(rPropertyHolders.Current().getFont());
+ aNewFont.SetAlign(aNewTextAlign);
+ rPropertyHolders.Current().setFont(aNewFont);
+ }
+
+ break;
+ }
+ case META_MAPMODE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ // the most necessary MapMode to be interpreted is MAP_RELATIVE,
+ // but also the others may occur. Even not yet supported ones
+ // may need to be added here later
+ const MetaMapModeAction* pA = (const MetaMapModeAction*)pAction;
+ const MapMode& rMapMode = pA->GetMapMode();
+ basegfx::B2DHomMatrix aMapping;
+
+ if(MAP_RELATIVE == rMapMode.GetMapUnit())
+ {
+ aMapping = getTransformFromMapMode(rMapMode);
+ }
+ else
+ {
+ switch(rMapMode.GetMapUnit())
+ {
+ case MAP_100TH_MM :
+ {
+ if(MAP_TWIP == rPropertyHolders.Current().getMapUnit())
+ {
+ // MAP_TWIP -> MAP_100TH_MM
+ const double fTwipTo100thMm(127.0 / 72.0);
+ aMapping.scale(fTwipTo100thMm, fTwipTo100thMm);
+ }
+ break;
+ }
+ case MAP_TWIP :
+ {
+ if(MAP_100TH_MM == rPropertyHolders.Current().getMapUnit())
+ {
+ // MAP_100TH_MM -> MAP_TWIP
+ const double f100thMmToTwip(72.0 / 127.0);
+ aMapping.scale(f100thMmToTwip, f100thMmToTwip);
+ }
+ break;
+ }
+ default :
+ {
+ OSL_ENSURE(false, "interpretMetafile: META_MAPMODE_ACTION with unsupported MapUnit (!)");
+ break;
+ }
+ }
+
+ aMapping = getTransformFromMapMode(rMapMode) * aMapping;
+ rPropertyHolders.Current().setMapUnit(rMapMode.GetMapUnit());
+ }
+
+ if(!aMapping.isIdentity())
+ {
+ aMapping = aMapping * rPropertyHolders.Current().getTransformation();
+ rPropertyHolders.Current().setTransformation(aMapping);
+ }
+
+ break;
+ }
+ case META_FONT_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaFontAction* pA = (const MetaFontAction*)pAction;
+ rPropertyHolders.Current().setFont(pA->GetFont());
+ Size aFontSize(pA->GetFont().GetSize());
+
+ if(0 == aFontSize.Height())
+ {
+ // this should not happen but i got Metafiles where this was the
+ // case. A height needs to be guessed (similar to OutputDevice::ImplNewFont())
+ Font aCorrectedFont(pA->GetFont());
+
+ // guess 16 pixel (as in VCL)
+ aFontSize = Size(0, 16);
+
+ // convert to target MapUnit if not pixels
+ aFontSize = Application::GetDefaultDevice()->LogicToLogic(
+ aFontSize, MAP_PIXEL, rPropertyHolders.Current().getMapUnit());
+
+ aCorrectedFont.SetSize(aFontSize);
+ rPropertyHolders.Current().setFont(aCorrectedFont);
+ }
+
+ // older Metafiles have no META_TEXTCOLOR_ACTION which defines
+ // the FontColor now, so use the Font's color when not transparent
+ const Color& rFontColor = pA->GetFont().GetColor();
+ const bool bActivate(COL_TRANSPARENT != rFontColor.GetColor());
+
+ if(bActivate)
+ {
+ rPropertyHolders.Current().setTextColor(rFontColor.getBColor());
+ }
+
+ // caution: do NOT decativate here on transparet, see
+ // OutputDevice::SetFont(..) for more info
+ // rPropertyHolders.Current().setTextColorActive(bActivate);
+
+ // for fill color emulate a MetaTextFillColorAction with !transparent as bool,
+ // see OutputDevice::SetFont(..) the if(mpMetaFile) case
+ if(bActivate)
+ {
+ const Color& rFontFillColor = pA->GetFont().GetFillColor();
+ rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor());
+ rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor());
+ }
+ else
+ {
+ rPropertyHolders.Current().setTextFillColorActive(false);
+ }
+
+ break;
+ }
+ case META_PUSH_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaPushAction* pA = (const MetaPushAction*)pAction;
+ rPropertyHolders.Push(pA->GetFlags());
+
+ break;
+ }
+ case META_POP_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const bool bRegionMayChange(rPropertyHolders.Current().getPushFlags() & PUSH_CLIPREGION);
+ const bool bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & PUSH_RASTEROP);
+
+ if(bRegionMayChange && rPropertyHolders.Current().getRegionActive())
+ {
+ // end evtl. clipping
+ HandleNewClipRegion(0, rTargetHolders, rPropertyHolders);
+ }
+
+ if(bRasterOpMayChange && rPropertyHolders.Current().isRasterOpActive())
+ {
+ // end evtl. RasterOp
+ HandleNewRasterOp(ROP_OVERPAINT, rTargetHolders, rPropertyHolders);
+ }
+
+ rPropertyHolders.Pop();
+
+ if(bRasterOpMayChange && rPropertyHolders.Current().isRasterOpActive())
+ {
+ // start evtl. RasterOp
+ HandleNewRasterOp(rPropertyHolders.Current().getRasterOp(), rTargetHolders, rPropertyHolders);
+ }
+
+ if(bRegionMayChange && rPropertyHolders.Current().getRegionActive())
+ {
+ // start evtl. clipping
+ HandleNewClipRegion(&rPropertyHolders.Current().getRegion(), rTargetHolders, rPropertyHolders);
+ }
+
+ break;
+ }
+ case META_RASTEROP_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaRasterOpAction* pA = (const MetaRasterOpAction*)pAction;
+ const RasterOp aRasterOp = pA->GetRasterOp();
+
+ HandleNewRasterOp(aRasterOp, rTargetHolders, rPropertyHolders);
+
+ break;
+ }
+ case META_TRANSPARENT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaTransparentAction* pA = (const MetaTransparentAction*)pAction;
+ const basegfx::B2DPolyPolygon aOutline(pA->GetPolyPolygon().getB2DPolyPolygon());
+
+ if(aOutline.count())
+ {
+ const sal_uInt16 nTransparence(pA->GetTransparence());
+
+ if(0 == nTransparence)
+ {
+ // not transparent
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ }
+ else if(nTransparence >= 100)
+ {
+ // fully or more than transparent
+ }
+ else
+ {
+ // transparent. Create new target
+ rTargetHolders.Push();
+
+ // create primitives there and get them
+ createHairlineAndFillPrimitive(aOutline, rTargetHolders.Current(), rPropertyHolders.Current());
+ const drawinglayer::primitive2d::Primitive2DSequence aSubContent(
+ rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current()));
+
+ // back to old target
+ rTargetHolders.Pop();
+
+ if(aSubContent.hasElements())
+ {
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ aSubContent,
+ nTransparence * 0.01));
+ }
+ }
+ }
+
+ break;
+ }
+ case META_EPS_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ // To support this action, i have added a EpsPrimitive2D which will
+ // by default decompose to the Metafile replacement data. To support
+ // this EPS on screen, the renderer visualizing this has to support
+ // that primitive and visualize the Eps file (e.g. printing)
+ const MetaEPSAction* pA = (const MetaEPSAction*)pAction;
+ const Rectangle aRectangle(pA->GetPoint(), pA->GetSize());
+
+ if(!aRectangle.IsEmpty())
+ {
+ // create object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+
+ aObjectTransform.set(0, 0, aRectangle.GetWidth());
+ aObjectTransform.set(1, 1, aRectangle.GetHeight());
+ aObjectTransform.set(0, 2, aRectangle.Left());
+ aObjectTransform.set(1, 2, aRectangle.Top());
+
+ // add current transformation
+ aObjectTransform = rPropertyHolders.Current().getTransformation() * aObjectTransform;
+
+ // embed using EpsPrimitive
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::EpsPrimitive2D(
+ aObjectTransform,
+ pA->GetLink(),
+ pA->GetSubstitute()));
+ }
+
+ break;
+ }
+ case META_REFPOINT_ACTION :
+ {
+ /** SIMPLE, DONE */
+ // only used for hatch and line pattern offsets, pretty much no longer
+ // supported today
+ // const MetaRefPointAction* pA = (const MetaRefPointAction*)pAction;
+ break;
+ }
+ case META_TEXTLINECOLOR_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*)pAction;
+ const bool bActive(pA->IsSetting());
+
+ rPropertyHolders.Current().setTextLineColorActive(bActive);
+ if(bActive)
+ rPropertyHolders.Current().setTextLineColor(pA->GetColor().getBColor());
+
+ break;
+ }
+ case META_TEXTLINE_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ // actually creates overline, underline and strikeouts, so
+ // these should be isolated from TextDecoratedPortionPrimitive2D
+ // to own primitives. Done, available now.
+ //
+ // This Metaaction seems not to be used (was not used in any
+ // checked files). It's used in combination with the current
+ // Font.
+ const MetaTextLineAction* pA = (const MetaTextLineAction*)pAction;
+
+ proccessMetaTextLineAction(
+ *pA,
+ rTargetHolders.Current(),
+ rPropertyHolders.Current());
+
+ break;
+ }
+ case META_FLOATTRANSPARENT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*)pAction;
+ const Rectangle aTargetRectangle(pA->GetPoint(), pA->GetSize());
+
+ if(!aTargetRectangle.IsEmpty())
+ {
+ const GDIMetaFile& rContent = pA->GetGDIMetaFile();
+
+ if(rContent.GetActionCount())
+ {
+ // create the sub-content with no embedding specific to the
+ // sub-metafile, this seems not to be used.
+ drawinglayer::primitive2d::Primitive2DSequence xSubContent;
+ {
+ rTargetHolders.Push();
+ interpretMetafile(rContent, rTargetHolders, rPropertyHolders, rViewInformation);
+ xSubContent = rTargetHolders.Current().getPrimitive2DSequence(rPropertyHolders.Current());
+ rTargetHolders.Pop();
+ }
+
+ if(xSubContent.hasElements())
+ {
+ // check if gradient is a real gradient
+ const Gradient& rGradient = pA->GetGradient();
+ const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient));
+
+ if(aAttribute.getStartColor() == aAttribute.getEndColor())
+ {
+ // not really a gradient; create UnifiedAlphaPrimitive2D
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ xSubContent,
+ aAttribute.getStartColor().luminance()));
+ }
+ else
+ {
+ // really a gradient. Create gradient sub-content (with correct scaling)
+ basegfx::B2DRange aRange(
+ aTargetRectangle.Left(), aTargetRectangle.Top(),
+ aTargetRectangle.Right(), aTargetRectangle.Bottom());
+ aRange.transform(rPropertyHolders.Current().getTransformation());
+
+ // prepare gradient for alpha content
+ const drawinglayer::primitive2d::Primitive2DReference xAlpha(
+ new drawinglayer::primitive2d::FillGradientPrimitive2D(
+ aRange,
+ aAttribute));
+
+ // create alpha primitive
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::AlphaPrimitive2D(
+ xSubContent,
+ drawinglayer::primitive2d::Primitive2DSequence(&xAlpha, 1)));
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ case META_GRADIENTEX_ACTION :
+ {
+ /** SIMPLE, DONE */
+ // This is only a data holder which is interpreted inside comment actions,
+ // see META_COMMENT_ACTION for more info
+ // const MetaGradientExAction* pA = (const MetaGradientExAction*)pAction;
+ break;
+ }
+ case META_LAYOUTMODE_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*)pAction;
+ rPropertyHolders.Current().setLayoutMode(pA->GetLayoutMode());
+ break;
+ }
+ case META_TEXTLANGUAGE_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*)pAction;
+ rPropertyHolders.Current().setLanguageType(pA->GetTextLanguage());
+ break;
+ }
+ case META_OVERLINECOLOR_ACTION :
+ {
+ /** SIMPLE, DONE */
+ const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*)pAction;
+ const bool bActive(pA->IsSetting());
+
+ rPropertyHolders.Current().setOverlineColorActive(bActive);
+ if(bActive)
+ rPropertyHolders.Current().setOverlineColor(pA->GetColor().getBColor());
+
+ break;
+ }
+ case META_COMMENT_ACTION :
+ {
+ /** CHECKED, WORKS WELL */
+ // I already implemented
+ // XPATHFILL_SEQ_BEGIN, XPATHFILL_SEQ_END
+ // XPATHSTROKE_SEQ_BEGIN, XPATHSTROKE_SEQ_END,
+ // but opted to remove these again; it works well without them
+ // and makes the code less dependent from those Metafile Add-Ons
+ const MetaCommentAction* pA = (const MetaCommentAction*)pAction;
+
+ if(COMPARE_EQUAL == pA->GetComment().CompareIgnoreCaseToAscii("XGRAD_SEQ_BEGIN"))
+ {
+ // XGRAD_SEQ_BEGIN, XGRAD_SEQ_END should be supported since the
+ // pure recorded paint of the gradients uses the XOR paint functionality
+ // ('trick'). This is (and will be) broblematic with AntAliasing, so it's
+ // better to use this info
+ const MetaGradientExAction* pMetaGradientExAction = 0;
+ bool bDone(false);
+ sal_uInt32 b(nAction + 1);
+
+ for(; !bDone && b < nCount; b++)
+ {
+ pAction = rMetaFile.GetAction(b);
+
+ if(META_GRADIENTEX_ACTION == pAction->GetType())
+ {
+ pMetaGradientExAction = (const MetaGradientExAction*)pAction;
+ }
+ else if(META_COMMENT_ACTION == pAction->GetType())
+ {
+ if(COMPARE_EQUAL == ((const MetaCommentAction*)pAction)->GetComment().CompareIgnoreCaseToAscii("XGRAD_SEQ_END"))
+ {
+ bDone = true;
+ }
+ }
+ }
+
+ if(bDone && pMetaGradientExAction)
+ {
+ // consume actions and skip forward
+ nAction = b - 1;
+
+ // get geometry data
+ basegfx::B2DPolyPolygon aPolyPolygon(pMetaGradientExAction->GetPolyPolygon().getB2DPolyPolygon());
+
+ if(aPolyPolygon.count())
+ {
+ // transform geometry
+ aPolyPolygon.transform(rPropertyHolders.Current().getTransformation());
+
+ // get and check if gradient is a real gradient
+ const Gradient& rGradient = pMetaGradientExAction->GetGradient();
+ const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient));
+
+ if(aAttribute.getStartColor() == aAttribute.getEndColor())
+ {
+ // not really a gradient
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ aPolyPolygon,
+ aAttribute.getStartColor()));
+ }
+ else
+ {
+ // really a gradient
+ rTargetHolders.Current().append(
+ new drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D(
+ aPolyPolygon,
+ aAttribute));
+ }
+ }
+ }
+ }
+
+ break;
+ }
+ default:
+ {
+ OSL_ENSURE(false, "Unknown MetaFile Action (!)");
+ break;
+ }
+ }
+ }
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
namespace drawinglayer
{
namespace primitive2d
{
+ Primitive2DSequence MetafilePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // prepare target and porperties; each will have one default entry
+ TargetHolders aTargetHolders;
+ PropertyHolders aPropertyHolders;
+
+ // set target MapUnit at Properties
+ aPropertyHolders.Current().setMapUnit(getMetaFile().GetPrefMapMode().GetMapUnit());
+
+ // interpret the Metafile
+ interpretMetafile(getMetaFile(), aTargetHolders, aPropertyHolders, rViewInformation);
+
+ // get the content. There should be ony one target, as in the start condition,
+ // but iterating will be the right thing to do when some push/pop is not closed
+ Primitive2DSequence xRetval;
+
+ while(aTargetHolders.size() > 1)
+ {
+ appendPrimitive2DSequenceToPrimitive2DSequence(xRetval,
+ aTargetHolders.Current().getPrimitive2DSequence(aPropertyHolders.Current()));
+ aTargetHolders.Pop();
+ }
+
+ appendPrimitive2DSequenceToPrimitive2DSequence(xRetval,
+ aTargetHolders.Current().getPrimitive2DSequence(aPropertyHolders.Current()));
+
+ if(xRetval.hasElements())
+ {
+ // get target size
+ const Rectangle aMtfTarget(getMetaFile().GetPrefMapMode().GetOrigin(), getMetaFile().GetPrefSize());
+
+ // create transformation
+ basegfx::B2DHomMatrix aAdaptedTransform;
+
+ aAdaptedTransform.translate(-aMtfTarget.Left(), -aMtfTarget.Top());
+ aAdaptedTransform.scale(
+ aMtfTarget.getWidth() ? 1.0 / aMtfTarget.getWidth() : 1.0,
+ aMtfTarget.getHeight() ? 1.0 / aMtfTarget.getHeight() : 1.0);
+ aAdaptedTransform = getTransform() * aAdaptedTransform;
+
+ // embed to target transformation
+ const Primitive2DReference aEmbeddedTransform(
+ new TransformPrimitive2D(
+ aAdaptedTransform,
+ xRetval));
+
+ xRetval = Primitive2DSequence(&aEmbeddedTransform, 1);
+ }
+
+ return xRetval;
+ }
+
MetafilePrimitive2D::MetafilePrimitive2D(
const basegfx::B2DHomMatrix& rMetaFileTransform,
const GDIMetaFile& rMetaFile)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maMetaFileTransform(rMetaFileTransform),
maMetaFile(rMetaFile)
{
@@ -61,7 +3060,7 @@ namespace drawinglayer
bool MetafilePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const MetafilePrimitive2D& rCompare = (MetafilePrimitive2D&)rPrimitive;
@@ -74,8 +3073,13 @@ namespace drawinglayer
basegfx::B2DRange MetafilePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
+ // use own implementation to quickly answer the getB2DRange question. The
+ // MetafilePrimitive2D assumes that all geometry is inside of the shape. If
+ // this is not the case (i have already seen some wrong Metafiles) it should
+ // be embedded to a MaskPrimitive2D
basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
aRetval.transform(getTransform());
+
return aRetval;
}
diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
index 01a82299682d..b747c79ee0c7 100644
--- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
@@ -42,6 +42,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -53,10 +54,10 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PagePreviewPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence PagePreviewPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
Primitive2DSequence xRetval;
- Primitive2DSequence aContent(getChildren());
+ Primitive2DSequence aContent(getPageContent());
if(aContent.hasElements()
&& basegfx::fTools::more(getContentWidth(), 0.0)
@@ -112,9 +113,9 @@ namespace drawinglayer
}
// add the missing object transformation aspects
- aPageTrans.shearX(fShearX);
- aPageTrans.rotate(fRotate);
- aPageTrans.translate(aTranslate.getX(), aTranslate.getY());
+ const basegfx::B2DHomMatrix aCombined(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ aPageTrans = aCombined * aPageTrans;
}
else
{
@@ -139,10 +140,11 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform,
double fContentWidth,
double fContentHeight,
- const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rPageContent,
bool bKeepAspectRatio)
- : GroupPrimitive2D(rChildren),
+ : BufferedDecompositionPrimitive2D(),
mxDrawPage(rxDrawPage),
+ maPageContent(rPageContent),
maTransform(rTransform),
mfContentWidth(fContentWidth),
mfContentHeight(fContentHeight),
@@ -152,11 +154,12 @@ namespace drawinglayer
bool PagePreviewPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(GroupPrimitive2D::operator==(rPrimitive))
+ if(BasePrimitive2D::operator==(rPrimitive))
{
const PagePreviewPrimitive2D& rCompare = static_cast< const PagePreviewPrimitive2D& >(rPrimitive);
return (getXDrawPage() == rCompare.getXDrawPage()
+ && getPageContent() == rCompare.getPageContent()
&& getTransform() == rCompare.getTransform()
&& getContentWidth() == rCompare.getContentWidth()
&& getContentHeight() == rCompare.getContentHeight()
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index b5212da54688..69cbd046efd2 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -110,7 +110,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolygonMarkerPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence PolygonMarkerPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
// calculate logic DashLength
const basegfx::B2DVector aDashVector(rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(getDiscreteDashLength(), 0.0));
@@ -147,7 +147,7 @@ namespace drawinglayer
const basegfx::BColor& rRGBColorA,
const basegfx::BColor& rRGBColorB,
double fDiscreteDashLength)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolygon(rPolygon),
maRGBColorA(rRGBColorA),
maRGBColorB(rRGBColorB),
@@ -158,7 +158,7 @@ namespace drawinglayer
bool PolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolygonMarkerPrimitive2D& rCompare = (PolygonMarkerPrimitive2D&)rPrimitive;
@@ -198,7 +198,7 @@ namespace drawinglayer
::osl::MutexGuard aGuard( m_aMutex );
bool bNeedNewDecomposition(false);
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
if(rViewInformation.getInverseObjectToViewTransformation() != maLastInverseObjectToViewTransformation)
{
@@ -209,10 +209,10 @@ namespace drawinglayer
if(bNeedNewDecomposition)
{
// conditions of last local decomposition have changed, delete
- const_cast< PolygonMarkerPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< PolygonMarkerPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember last used InverseObjectToViewTransformation
PolygonMarkerPrimitive2D* pThat = const_cast< PolygonMarkerPrimitive2D* >(this);
@@ -220,7 +220,7 @@ namespace drawinglayer
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
@@ -235,7 +235,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolygonStrokePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolygonStrokePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
if(getB2DPolygon().count())
{
@@ -307,7 +307,7 @@ namespace drawinglayer
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolygon(rPolygon),
maLineAttribute(rLineAttribute),
maStrokeAttribute(rStrokeAttribute)
@@ -317,7 +317,7 @@ namespace drawinglayer
PolygonStrokePrimitive2D::PolygonStrokePrimitive2D(
const basegfx::B2DPolygon& rPolygon,
const attribute::LineAttribute& rLineAttribute)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolygon(rPolygon),
maLineAttribute(rLineAttribute),
maStrokeAttribute()
@@ -326,7 +326,7 @@ namespace drawinglayer
bool PolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolygonStrokePrimitive2D& rCompare = (PolygonStrokePrimitive2D&)rPrimitive;
@@ -348,7 +348,7 @@ namespace drawinglayer
{
// if line is mitered, use parent call since mitered line
// geometry may use more space than the geometry grown by half line width
- aRetval = BasePrimitive2D::getB2DRange(rViewInformation);
+ aRetval = BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
}
else
{
@@ -392,7 +392,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolygonWavePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolygonWavePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence aRetval;
@@ -505,7 +505,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolygonStrokeArrowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolygonStrokeArrowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// copy local polygon, it may be changed
basegfx::B2DPolygon aLocalPolygon(getB2DPolygon());
@@ -614,7 +614,7 @@ namespace drawinglayer
if(getStart().isActive() || getEnd().isActive())
{
// use decomposition when line start/end is used
- return BasePrimitive2D::getB2DRange(rViewInformation);
+ return BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
}
else
{
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
index 9dd14aeb11e3..55c334434c70 100644
--- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -57,7 +57,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonHairlinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonHairlinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon());
const sal_uInt32 nCount(aPolyPolygon.count());
@@ -80,7 +80,7 @@ namespace drawinglayer
}
PolyPolygonHairlinePrimitive2D::PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
maBColor(rBColor)
{
@@ -88,7 +88,7 @@ namespace drawinglayer
bool PolyPolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolyPolygonHairlinePrimitive2D& rCompare = (PolyPolygonHairlinePrimitive2D&)rPrimitive;
@@ -117,7 +117,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonMarkerPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonMarkerPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon());
const sal_uInt32 nCount(aPolyPolygon.count());
@@ -144,7 +144,7 @@ namespace drawinglayer
const basegfx::BColor& rRGBColorA,
const basegfx::BColor& rRGBColorB,
double fDiscreteDashLength)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
maRGBColorA(rRGBColorA),
maRGBColorB(rRGBColorB),
@@ -154,7 +154,7 @@ namespace drawinglayer
bool PolyPolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolyPolygonMarkerPrimitive2D& rCompare = (PolyPolygonMarkerPrimitive2D&)rPrimitive;
@@ -185,7 +185,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonStrokePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonStrokePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon());
const sal_uInt32 nCount(aPolyPolygon.count());
@@ -211,7 +211,7 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
maLineAttribute(rLineAttribute),
maStrokeAttribute(rStrokeAttribute)
@@ -221,7 +221,7 @@ namespace drawinglayer
PolyPolygonStrokePrimitive2D::PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
const attribute::LineAttribute& rLineAttribute)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
maLineAttribute(rLineAttribute),
maStrokeAttribute()
@@ -230,7 +230,7 @@ namespace drawinglayer
bool PolyPolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolyPolygonStrokePrimitive2D& rCompare = (PolyPolygonStrokePrimitive2D&)rPrimitive;
@@ -268,7 +268,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonStrokeArrowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonStrokeArrowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon());
const sal_uInt32 nCount(aPolyPolygon.count());
@@ -343,7 +343,7 @@ namespace drawinglayer
if(getStart().isActive() || getEnd().isActive())
{
// use decomposition when line start/end is used
- return BasePrimitive2D::getB2DRange(rViewInformation);
+ return BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
}
else
{
@@ -404,7 +404,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonGradientPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// create SubSequence with FillGradientPrimitive2D
const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
@@ -420,16 +420,16 @@ namespace drawinglayer
PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillGradientAttribute& rFillGradient)
- : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor),
+ : BufferedDecompositionPrimitive2D(),
+ maPolyPolygon(rPolyPolygon),
maFillGradient(rFillGradient)
{
}
bool PolyPolygonGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(PolyPolygonColorPrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolyPolygonGradientPrimitive2D& rCompare = (PolyPolygonGradientPrimitive2D&)rPrimitive;
@@ -451,11 +451,11 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonHatchPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// create SubSequence with FillHatchPrimitive2D
const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBColor(), getFillHatch());
+ FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch());
const Primitive2DReference xSubRef(pNewHatch);
const Primitive2DSequence aSubSequence(&xSubRef, 1L);
@@ -467,20 +467,23 @@ namespace drawinglayer
PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
+ const basegfx::BColor& rBackgroundColor,
const attribute::FillHatchAttribute& rFillHatch)
- : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor),
+ : BufferedDecompositionPrimitive2D(),
+ maPolyPolygon(rPolyPolygon),
+ maBackgroundColor(rBackgroundColor),
maFillHatch(rFillHatch)
{
}
bool PolyPolygonHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(PolyPolygonColorPrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolyPolygonHatchPrimitive2D& rCompare = (PolyPolygonHatchPrimitive2D&)rPrimitive;
- return (getFillHatch() == rCompare.getFillHatch());
+ return (getBackgroundColor() == rCompare.getBackgroundColor()
+ && getFillHatch() == rCompare.getFillHatch());
}
return false;
@@ -498,7 +501,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence PolyPolygonBitmapPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence PolyPolygonBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// create SubSequence with FillBitmapPrimitive2D
const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
@@ -519,16 +522,16 @@ namespace drawinglayer
PolyPolygonBitmapPrimitive2D::PolyPolygonBitmapPrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::BColor& rBColor,
const attribute::FillBitmapAttribute& rFillBitmap)
- : PolyPolygonColorPrimitive2D(rPolyPolygon, rBColor),
+ : BufferedDecompositionPrimitive2D(),
+ maPolyPolygon(rPolyPolygon),
maFillBitmap(rFillBitmap)
{
}
bool PolyPolygonBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(PolyPolygonColorPrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const PolyPolygonBitmapPrimitive2D& rCompare = (PolyPolygonBitmapPrimitive2D&)rPrimitive;
diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx
index d288a697d729..2b25590bf1f4 100644
--- a/drawinglayer/source/primitive2d/primitivetools2d.cxx
+++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx
@@ -53,20 +53,20 @@ namespace drawinglayer
// get the current DiscreteUnit
const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength());
- if(getLocalDecomposition().hasElements() && !basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit()))
+ if(getBuffered2DDecomposition().hasElements() && !basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit()))
{
// conditions of last local decomposition have changed, delete
- const_cast< DiscreteMetricDependentPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< DiscreteMetricDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember new valid DiscreteUnit
const_cast< DiscreteMetricDependentPrimitive2D* >(this)->mfDiscreteUnit = fDiscreteUnit;
}
// call base implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -84,20 +84,92 @@ namespace drawinglayer
// get the current Viewport
const basegfx::B2DRange& rViewport = rViewInformation.getViewport();
- if(getLocalDecomposition().hasElements() && !rViewport.equal(getViewport()))
+ if(getBuffered2DDecomposition().hasElements() && !rViewport.equal(getViewport()))
{
// conditions of last local decomposition have changed, delete
- const_cast< ViewportDependentPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< ViewportDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember new valid DiscreteUnit
const_cast< ViewportDependentPrimitive2D* >(this)->maViewport = rViewport;
}
// call base implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ViewTransformationDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // get the current ViewTransformation
+ const basegfx::B2DHomMatrix& rViewTransformation = rViewInformation.getViewTransformation();
+
+ if(getBuffered2DDecomposition().hasElements() && rViewTransformation != getViewTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
+ }
+
+ if(!getBuffered2DDecomposition().hasElements())
+ {
+ // remember new valid ViewTransformation
+ const_cast< ViewTransformationDependentPrimitive2D* >(this)->maViewTransformation = rViewTransformation;
+ }
+
+ // call base implementation
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence ObjectAndViewTransformationDependentPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // get the current ViewTransfromation
+ const basegfx::B2DHomMatrix& rViewTransformation = rViewInformation.getViewTransformation();
+
+ if(getBuffered2DDecomposition().hasElements() && rViewTransformation != getViewTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
+ }
+
+ // get the current ObjectTransformation
+ const basegfx::B2DHomMatrix& rObjectTransformation = rViewInformation.getObjectTransformation();
+
+ if(getBuffered2DDecomposition().hasElements() && rObjectTransformation != getObjectTransformation())
+ {
+ // conditions of last local decomposition have changed, delete
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
+ }
+
+ if(!getBuffered2DDecomposition().hasElements())
+ {
+ // remember new valid ViewTransformation, and ObjectTransformation
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->maViewTransformation = rViewTransformation;
+ const_cast< ObjectAndViewTransformationDependentPrimitive2D* >(this)->maObjectTransformation = rObjectTransformation;
+ }
+
+ // call base implementation
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index f52af2da6a6d..6b346d5abdc0 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -100,7 +100,7 @@ namespace drawinglayer
return maShadowPrimitives.hasElements();
}
- void ScenePrimitive2D::calculateDsicreteSizes(
+ void ScenePrimitive2D::calculateDiscreteSizes(
const geometry::ViewInformation2D& rViewInformation,
basegfx::B2DRange& rDiscreteRange,
basegfx::B2DRange& rVisibleDiscreteRange,
@@ -110,23 +110,12 @@ namespace drawinglayer
rDiscreteRange = basegfx::B2DRange(0.0, 0.0, 1.0, 1.0);
rDiscreteRange.transform(rViewInformation.getObjectToViewTransformation() * getObjectTransformation());
- // force to discrete expanded bounds (it grows, so expanding works perfectly well)
- rDiscreteRange.expand(basegfx::B2DTuple(floor(rDiscreteRange.getMinX()), floor(rDiscreteRange.getMinY())));
- rDiscreteRange.expand(basegfx::B2DTuple(ceil(rDiscreteRange.getMaxX()), ceil(rDiscreteRange.getMaxY())));
-
// clip it against discrete Viewport (if set)
rVisibleDiscreteRange = rDiscreteRange;
if(!rViewInformation.getViewport().isEmpty())
{
rVisibleDiscreteRange.intersect(rViewInformation.getDiscreteViewport());
-
- if(!rVisibleDiscreteRange.isEmpty())
- {
- // force to discrete expanded bounds, too
- rVisibleDiscreteRange.expand(basegfx::B2DTuple(floor(rVisibleDiscreteRange.getMinX()), floor(rVisibleDiscreteRange.getMinY())));
- rVisibleDiscreteRange.expand(basegfx::B2DTuple(ceil(rVisibleDiscreteRange.getMaxX()), ceil(rVisibleDiscreteRange.getMaxY())));
- }
}
if(rVisibleDiscreteRange.isEmpty())
@@ -158,7 +147,7 @@ namespace drawinglayer
}
}
- Primitive2DSequence ScenePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence ScenePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
Primitive2DSequence aRetval;
@@ -177,11 +166,11 @@ namespace drawinglayer
}
}
- // get the involved ranges (see helper method calculateDsicreteSizes for details)
+ // get the involved ranges (see helper method calculateDiscreteSizes for details)
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aVisibleDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
- calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
if(!aVisibleDiscreteRange.isEmpty())
{
@@ -200,6 +189,31 @@ namespace drawinglayer
fViewSizeY *= fReduceFactor;
}
+ if(rViewInformation.getReducedDisplayQuality())
+ {
+ // when reducing the visualisation is allowed (e.g. an OverlayObject
+ // only needed for dragging), reduce resolution extra
+ // to speed up dragging interactions
+ const double fArea(fViewSizeX * fViewSizeY);
+ double fReducedVisualisationFactor(1.0 / (sqrt(fArea) * (1.0 / 170.0)));
+
+ if(fReducedVisualisationFactor > 1.0)
+ {
+ fReducedVisualisationFactor = 1.0;
+ }
+ else if(fReducedVisualisationFactor < 0.20)
+ {
+ fReducedVisualisationFactor = 0.20;
+ }
+
+ if(fReducedVisualisationFactor != 1.0)
+ {
+ fReduceFactor *= fReducedVisualisationFactor;
+ fViewSizeX *= fReducedVisualisationFactor;
+ fViewSizeY *= fReducedVisualisationFactor;
+ }
+ }
+
// calculate logic render size in world coordinates for usage in renderer
basegfx::B2DVector aLogicRenderSize(
aDiscreteRange.getWidth() * fReduceFactor,
@@ -207,9 +221,8 @@ namespace drawinglayer
aLogicRenderSize *= rViewInformation.getInverseObjectToViewTransformation();
// determine the oversample value
- static bool bDoOversample(false);
static sal_uInt16 nDefaultOversampleValue(3);
- const sal_uInt16 nOversampleValue((bDoOversample || aDrawinglayerOpt.IsAntiAliasing()) ? nDefaultOversampleValue : 0);
+ const sal_uInt16 nOversampleValue(aDrawinglayerOpt.IsAntiAliasing() ? nDefaultOversampleValue : 0);
// use default 3D primitive processor to create BitmapEx for aUnitVisiblePart and process
processor3d::ZBufferProcessor3D aZBufferProcessor3D(
@@ -224,18 +237,16 @@ namespace drawinglayer
aZBufferProcessor3D.processNonTransparent(getChildren3D());
aZBufferProcessor3D.processTransparent(getChildren3D());
- const BitmapEx aNewBitmap(aZBufferProcessor3D.getBitmapEx());
- const Size aBitmapSizePixel(aNewBitmap.GetSizePixel());
+ const_cast< ScenePrimitive2D* >(this)->maOldRenderedBitmap = aZBufferProcessor3D.getBitmapEx();
+ const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
if(aBitmapSizePixel.getWidth() && aBitmapSizePixel.getHeight())
{
// create transform for the created bitmap in discrete coordinates first.
- // #i97772# Do not forget to apply evtl. render size reduction to scaling
basegfx::B2DHomMatrix aNew2DTransform;
- const double fSizeReductionFactor(1.0 / fReduceFactor);
- aNew2DTransform.set(0, 0, (double)(aBitmapSizePixel.getWidth() - 1) * fSizeReductionFactor);
- aNew2DTransform.set(1, 1, (double)(aBitmapSizePixel.getHeight() - 1) * fSizeReductionFactor);
+ aNew2DTransform.set(0, 0, aVisibleDiscreteRange.getWidth());
+ aNew2DTransform.set(1, 1, aVisibleDiscreteRange.getHeight());
aNew2DTransform.set(0, 2, aVisibleDiscreteRange.getMinX());
aNew2DTransform.set(1, 2, aVisibleDiscreteRange.getMinY());
@@ -243,7 +254,7 @@ namespace drawinglayer
aNew2DTransform *= rViewInformation.getInverseObjectToViewTransformation();
// create bitmap primitive and add
- const Primitive2DReference xRef(new BitmapPrimitive2D(aNewBitmap, aNew2DTransform));
+ const Primitive2DReference xRef(new BitmapPrimitive2D(maOldRenderedBitmap, aNew2DTransform));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xRef);
// test: Allow to add an outline in the debugger when tests are needed
@@ -262,17 +273,10 @@ namespace drawinglayer
return aRetval;
}
- Primitive2DSequence ScenePrimitive2D::getGeometry2D(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence ScenePrimitive2D::getGeometry2D() const
{
Primitive2DSequence aRetval;
- // create 2D shadows from contained 3D primitives
- if(impGetShadow3D(rViewInformation))
- {
- // add extracted 2d shadows (before 3d scene creations itself)
- aRetval = maShadowPrimitives;
- }
-
// create 2D projected geometry from 3D geometry
if(getChildren3D().hasElements())
{
@@ -284,21 +288,75 @@ namespace drawinglayer
// process local primitives
aGeometryProcessor.process(getChildren3D());
- // fetch result and append
- Primitive2DSequence a2DExtractedPrimitives(aGeometryProcessor.getPrimitive2DSequence());
- appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, a2DExtractedPrimitives);
+ // fetch result
+ aRetval = aGeometryProcessor.getPrimitive2DSequence();
}
return aRetval;
}
+ Primitive2DSequence ScenePrimitive2D::getShadow2D(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ Primitive2DSequence aRetval;
+
+ // create 2D shadows from contained 3D primitives
+ if(impGetShadow3D(rViewInformation))
+ {
+ // add extracted 2d shadows (before 3d scene creations itself)
+ aRetval = maShadowPrimitives;
+ }
+
+ return aRetval;
+ }
+
+ bool ScenePrimitive2D::tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const
+ {
+ if(!maOldRenderedBitmap.IsEmpty() && !maOldUnitVisiblePart.isEmpty())
+ {
+ basegfx::B2DHomMatrix aInverseSceneTransform(getObjectTransformation());
+ aInverseSceneTransform.invert();
+ const basegfx::B2DPoint aRelativePoint(aInverseSceneTransform * rLogicHitPoint);
+
+ if(maOldUnitVisiblePart.isInside(aRelativePoint))
+ {
+ // calculate coordinates relative to visualized part
+ double fDivisorX(maOldUnitVisiblePart.getWidth());
+ double fDivisorY(maOldUnitVisiblePart.getHeight());
+
+ if(basegfx::fTools::equalZero(fDivisorX))
+ {
+ fDivisorX = 1.0;
+ }
+
+ if(basegfx::fTools::equalZero(fDivisorY))
+ {
+ fDivisorY = 1.0;
+ }
+
+ const double fRelativeX((aRelativePoint.getX() - maOldUnitVisiblePart.getMinX()) / fDivisorX);
+ const double fRelativeY((aRelativePoint.getY() - maOldUnitVisiblePart.getMinY()) / fDivisorY);
+
+ // combine with real BitmapSizePixel to get bitmap coordinates
+ const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
+ const sal_Int32 nX(basegfx::fround(fRelativeX * aBitmapSizePixel.Width()));
+ const sal_Int32 nY(basegfx::fround(fRelativeY * aBitmapSizePixel.Height()));
+
+ // try to get a statement about transparency in that pixel
+ o_rResult = (0xff != maOldRenderedBitmap.GetTransparency(nX, nY));
+ return true;
+ }
+ }
+
+ return false;
+ }
+
ScenePrimitive2D::ScenePrimitive2D(
const primitive3d::Primitive3DSequence& rxChildren3D,
const attribute::SdrSceneAttribute& rSdrSceneAttribute,
const attribute::SdrLightingAttribute& rSdrLightingAttribute,
const basegfx::B2DHomMatrix& rObjectTransformation,
const geometry::ViewInformation3D& rViewInformation3D)
- : BasePrimitive2D(),
+ : BufferedDecompositionPrimitive2D(),
mxChildren3D(rxChildren3D),
maSdrSceneAttribute(rSdrSceneAttribute),
maSdrLightingAttribute(rSdrLightingAttribute),
@@ -308,13 +366,14 @@ namespace drawinglayer
mbShadow3DChecked(false),
mfOldDiscreteSizeX(0.0),
mfOldDiscreteSizeY(0.0),
- maOldUnitVisiblePart()
+ maOldUnitVisiblePart(),
+ maOldRenderedBitmap()
{
}
bool ScenePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BasePrimitive2D::operator==(rPrimitive))
+ if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
{
const ScenePrimitive2D& rCompare = (ScenePrimitive2D&)rPrimitive;
@@ -359,30 +418,31 @@ namespace drawinglayer
{
::osl::MutexGuard aGuard( m_aMutex );
- // get the involved ranges (see helper method calculateDsicreteSizes for details)
+ // get the involved ranges (see helper method calculateDiscreteSizes for details)
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
bool bNeedNewDecomposition(false);
bool bDiscreteSizesAreCalculated(false);
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
basegfx::B2DRange aVisibleDiscreteRange;
- calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
bDiscreteSizesAreCalculated = true;
- // display has changed and cannot be reused when resolution did change
- if(!basegfx::fTools::equal(aDiscreteRange.getWidth(), mfOldDiscreteSizeX) ||
- !basegfx::fTools::equal(aDiscreteRange.getHeight(), mfOldDiscreteSizeY))
+ // needs to be painted when the new part is not part of the last
+ // decomposition
+ if(!maOldUnitVisiblePart.isInside(aUnitVisibleRange))
{
bNeedNewDecomposition = true;
}
+ // display has changed and cannot be reused when resolution got bigger. It
+ // can be reused when resolution got smaller, though.
if(!bNeedNewDecomposition)
{
- // needs to be painted when the new part is not part of the last
- // decomposition
- if(!maOldUnitVisiblePart.isInside(aUnitVisibleRange))
+ if(basegfx::fTools::more(aDiscreteRange.getWidth(), mfOldDiscreteSizeX) ||
+ basegfx::fTools::more(aDiscreteRange.getHeight(), mfOldDiscreteSizeY))
{
bNeedNewDecomposition = true;
}
@@ -392,15 +452,15 @@ namespace drawinglayer
if(bNeedNewDecomposition)
{
// conditions of last local decomposition have changed, delete
- const_cast< ScenePrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< ScenePrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
if(!bDiscreteSizesAreCalculated)
{
basegfx::B2DRange aVisibleDiscreteRange;
- calculateDsicreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
+ calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
}
// remember last used NewDiscreteSize and NewUnitVisiblePart
@@ -411,7 +471,7 @@ namespace drawinglayer
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index 5681f7f98d7e..b6ce7dc3248d 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -55,25 +55,6 @@ namespace drawinglayer
{
namespace primitive2d
{
- Primitive2DSequence ShadowPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
- {
- Primitive2DSequence aRetval;
-
- if(getChildren().hasElements())
- {
- // create a modifiedColorPrimitive containing the shadow color and the content
- const basegfx::BColorModifier aBColorModifier(getShadowColor());
- const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier));
- const Primitive2DSequence aSequenceB(&xRefA, 1L);
-
- // build transformed primitiveVector with shadow offset and add to target
- const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB));
- aRetval = Primitive2DSequence(&xRefB, 1L);
- }
-
- return aRetval;
- }
-
ShadowPrimitive2D::ShadowPrimitive2D(
const basegfx::B2DHomMatrix& rShadowTransform,
const basegfx::BColor& rShadowColor,
@@ -86,7 +67,7 @@ namespace drawinglayer
bool ShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(GroupPrimitive2D::operator==(rPrimitive))
+ if(BasePrimitive2D::operator==(rPrimitive))
{
const ShadowPrimitive2D& rCompare = static_cast< const ShadowPrimitive2D& >(rPrimitive);
@@ -104,6 +85,25 @@ namespace drawinglayer
return aRetval;
}
+ Primitive2DSequence ShadowPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence aRetval;
+
+ if(getChildren().hasElements())
+ {
+ // create a modifiedColorPrimitive containing the shadow color and the content
+ const basegfx::BColorModifier aBColorModifier(getShadowColor());
+ const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier));
+ const Primitive2DSequence aSequenceB(&xRefA, 1L);
+
+ // build transformed primitiveVector with shadow offset and add to target
+ const Primitive2DReference xRefB(new TransformPrimitive2D(getShadowTransform(), aSequenceB));
+ aRetval = Primitive2DSequence(&xRefB, 1L);
+ }
+
+ return aRetval;
+ }
+
// provide unique ID
ImplPrimitrive2DIDBlock(ShadowPrimitive2D, PRIMITIVE2D_ID_SHADOWPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index d337950c6c6b..f9d245f76a34 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -48,6 +48,8 @@
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,226 +57,14 @@ namespace drawinglayer
{
namespace primitive2d
{
- void TextDecoratedPortionPrimitive2D::impCreateTextLine(
- std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
- const basegfx::B2DHomMatrix &rUnscaledTransform,
- FontUnderline eLineStyle,
- double fLineOffset,
- double fLineHeight,
- double fLineWidth,
- const basegfx::BColor& rLineColor) const
- {
- bool bDoubleLine(false);
- bool bWaveLine(false);
- bool bBoldLine(false);
- const int* pDotDashArray(0);
- basegfx::B2DLineJoin eLineJoin(basegfx::B2DLINEJOIN_NONE);
-
- static const int aDottedArray[] = { 1, 1, 0}; // DOTTED LINE
- static const int aDotDashArray[] = { 1, 1, 4, 1, 0}; // DASHDOT
- static const int aDashDotDotArray[] = { 1, 1, 1, 1, 4, 1, 0}; // DASHDOTDOT
- static const int aDashedArray[] = { 5, 2, 0}; // DASHED LINE
- static const int aLongDashArray[] = { 7, 2, 0}; // LONGDASH
-
- switch(eLineStyle)
- {
- default: // case FONT_UNDERLINE_SINGLE:
- {
- break;
- }
- case FONT_UNDERLINE_DOUBLE:
- {
- bDoubleLine = true;
- break;
- }
- case FONT_UNDERLINE_DOTTED:
- {
- pDotDashArray = aDottedArray;
- break;
- }
- case FONT_UNDERLINE_DASH:
- {
- pDotDashArray = aDashedArray;
- break;
- }
- case FONT_UNDERLINE_LONGDASH:
- {
- pDotDashArray = aLongDashArray;
- break;
- }
- case FONT_UNDERLINE_DASHDOT:
- {
- pDotDashArray = aDotDashArray;
- break;
- }
- case FONT_UNDERLINE_DASHDOTDOT:
- {
- pDotDashArray = aDashDotDotArray;
- break;
- }
- case FONT_UNDERLINE_SMALLWAVE:
- {
- bWaveLine = true;
- break;
- }
- case FONT_UNDERLINE_WAVE:
- {
- bWaveLine = true;
- break;
- }
- case FONT_UNDERLINE_DOUBLEWAVE:
- {
- bDoubleLine = true;
- bWaveLine = true;
- break;
- }
- case FONT_UNDERLINE_BOLD:
- {
- bBoldLine = true;
- break;
- }
- case FONT_UNDERLINE_BOLDDOTTED:
- {
- bBoldLine = true;
- pDotDashArray = aDottedArray;
- break;
- }
- case FONT_UNDERLINE_BOLDDASH:
- {
- bBoldLine = true;
- pDotDashArray = aDashedArray;
- break;
- }
- case FONT_UNDERLINE_BOLDLONGDASH:
- {
- bBoldLine = true;
- pDotDashArray = aLongDashArray;
- break;
- }
- case FONT_UNDERLINE_BOLDDASHDOT:
- {
- bBoldLine = true;
- pDotDashArray = aDotDashArray;
- break;
- }
- case FONT_UNDERLINE_BOLDDASHDOTDOT:
- {
- bBoldLine = true;
- pDotDashArray = aDashDotDotArray;
- break;
- }
- case FONT_UNDERLINE_BOLDWAVE:
- {
- bWaveLine = true;
- bBoldLine = true;
- break;
- }
- }
-
- if(bBoldLine)
- {
- fLineHeight *= 2.0;
- }
-
- if(bDoubleLine)
- {
- fLineOffset -= 0.50 * fLineHeight;
- fLineHeight *= 0.64;
- }
-
- if(bWaveLine)
- {
- eLineJoin = basegfx::B2DLINEJOIN_ROUND;
- fLineHeight *= 0.25;
- }
-
- // prepare Line and Stroke Attributes
- const attribute::LineAttribute aLineAttribute(rLineColor, fLineHeight, eLineJoin);
- attribute::StrokeAttribute aStrokeAttribute;
-
- if(pDotDashArray)
- {
- ::std::vector< double > aDoubleArray;
-
- for(const int* p = pDotDashArray; *p; ++p)
- {
- aDoubleArray.push_back((double)(*p) * fLineHeight);
- }
-
- aStrokeAttribute = attribute::StrokeAttribute(aDoubleArray);
- }
-
- // create base polygon and new primitive
- basegfx::B2DPolygon aLine;
- Primitive2DReference aNewPrimitive;
-
- aLine.append(basegfx::B2DPoint(0.0, fLineOffset));
- aLine.append(basegfx::B2DPoint(fLineWidth, fLineOffset));
- aLine.transform(rUnscaledTransform);
-
- if(bWaveLine)
- {
- double fWaveWidth(10.6 * fLineHeight);
-
- if(FONT_UNDERLINE_SMALLWAVE == eLineStyle)
- {
- fWaveWidth *= 0.7;
- }
- else if(FONT_UNDERLINE_WAVE == eLineStyle)
- {
- // extra multiply to get the same WaveWidth as with the bold version
- fWaveWidth *= 2.0;
- }
-
- aNewPrimitive = Primitive2DReference(new PolygonWavePrimitive2D(aLine, aLineAttribute, aStrokeAttribute, fWaveWidth, fWaveWidth * 0.5));
- }
- else
- {
- aNewPrimitive = Primitive2DReference(new PolygonStrokePrimitive2D(aLine, aLineAttribute, aStrokeAttribute));
- }
-
- // add primitive
- rTarget.push_back(aNewPrimitive);
-
- if(bDoubleLine)
- {
- // double line, create 2nd primitive with offset using TransformPrimitive based on
- // already created NewPrimitive
- double fLineDist(2.3 * fLineHeight);
-
- if(bWaveLine)
- {
- fLineDist = 6.3 * fLineHeight;
- }
-
- basegfx::B2DHomMatrix aTransform;
-
- // move base point of text to 0.0 and de-rotate
- aTransform.translate(-rDecTrans.getTranslate().getX(), -rDecTrans.getTranslate().getY());
- aTransform.rotate(-rDecTrans.getRotate());
-
- // translate in Y by offset
- aTransform.translate(0.0, fLineDist);
-
- // move back and rotate
- aTransform.rotate(rDecTrans.getRotate());
- aTransform.translate(rDecTrans.getTranslate().getX(), rDecTrans.getTranslate().getY());
-
- // add transform primitive
- const Primitive2DSequence aContent(&aNewPrimitive, 1);
- rTarget.push_back(Primitive2DReference(new TransformPrimitive2D(aTransform, aContent)));
- }
- }
-
void TextDecoratedPortionPrimitive2D::impCreateGeometryContent(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans,
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans,
const String& rText,
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes) const
+ const attribute::FontAttribute& rFontAttribute) const
{
// create the SimpleTextPrimitive needed in any case
rTarget.push_back(Primitive2DReference(
@@ -284,30 +74,24 @@ namespace drawinglayer
aTextPosition,
aTextLength,
rDXArray,
- rFontAttributes,
+ rFontAttribute,
getLocale(),
getFontColor())));
// see if something else needs to be done
- const bool bOverlineUsed(FONT_UNDERLINE_NONE != getFontOverline());
- const bool bUnderlineUsed(FONT_UNDERLINE_NONE != getFontUnderline());
- const bool bStrikeoutUsed(FONT_STRIKEOUT_NONE != getFontStrikeout());
+ const bool bOverlineUsed(TEXT_LINE_NONE != getFontOverline());
+ const bool bUnderlineUsed(TEXT_LINE_NONE != getFontUnderline());
+ const bool bStrikeoutUsed(TEXT_STRIKEOUT_NONE != getTextStrikeout());
if(bUnderlineUsed || bStrikeoutUsed || bOverlineUsed)
{
// common preparations
- basegfx::B2DHomMatrix aUnscaledTransform;
TextLayouterDevice aTextLayouter;
- // unscaled is needed since scale contains already the font size
- aUnscaledTransform.shearX(rDecTrans.getShearX());
- aUnscaledTransform.rotate(rDecTrans.getRotate());
- aUnscaledTransform.translate(rDecTrans.getTranslate().getX(), rDecTrans.getTranslate().getY());
-
// TextLayouterDevice is needed to get metrics for text decorations like
// underline/strikeout/emphasis marks from it. For setup, the font size is needed
- aTextLayouter.setFontAttributes(
- getFontAttributes(),
+ aTextLayouter.setFontAttribute(
+ getFontAttribute(),
rDecTrans.getScale().getX(),
rDecTrans.getScale().getY(),
getLocale());
@@ -335,115 +119,57 @@ namespace drawinglayer
if(bOverlineUsed)
{
// create primitive geometry for overline
- impCreateTextLine(rTarget, rDecTrans, aUnscaledTransform, getFontOverline(), aTextLayouter.getOverlineOffset(),
- aTextLayouter.getOverlineHeight(), fTextWidth, getOverlineColor());
+ rTarget.push_back(Primitive2DReference(
+ new TextLinePrimitive2D(
+ rDecTrans.getB2DHomMatrix(),
+ fTextWidth,
+ aTextLayouter.getOverlineOffset(),
+ aTextLayouter.getOverlineHeight(),
+ getFontOverline(),
+ getOverlineColor())));
}
if(bUnderlineUsed)
{
// create primitive geometry for underline
- impCreateTextLine(rTarget, rDecTrans, aUnscaledTransform, getFontUnderline(), aTextLayouter.getUnderlineOffset(),
- aTextLayouter.getUnderlineHeight(), fTextWidth, getTextlineColor());
+ rTarget.push_back(Primitive2DReference(
+ new TextLinePrimitive2D(
+ rDecTrans.getB2DHomMatrix(),
+ fTextWidth,
+ aTextLayouter.getUnderlineOffset(),
+ aTextLayouter.getUnderlineHeight(),
+ getFontUnderline(),
+ getTextlineColor())));
}
if(bStrikeoutUsed)
{
// create primitive geometry for strikeout
- if(FONT_STRIKEOUT_SLASH == getFontStrikeout() || FONT_STRIKEOUT_X == getFontStrikeout())
+ if(TEXT_STRIKEOUT_SLASH == getTextStrikeout() || TEXT_STRIKEOUT_X == getTextStrikeout())
{
// strikeout with character
- const sal_Unicode aStrikeoutChar(FONT_STRIKEOUT_SLASH == getFontStrikeout() ? '/' : 'X');
- const String aSingleCharString(aStrikeoutChar);
- const double fStrikeCharWidth(aTextLayouter.getTextWidth(aSingleCharString, 0, 1));
- const double fStrikeCharCount(fabs(fTextWidth/fStrikeCharWidth));
- const sal_uInt32 nStrikeCharCount(static_cast< sal_uInt32 >(fStrikeCharCount + 0.5));
- std::vector<double> aDXArray(nStrikeCharCount);
- String aStrikeoutString;
-
- for(sal_uInt32 a(0); a < nStrikeCharCount; a++)
- {
- aStrikeoutString += aSingleCharString;
- aDXArray[a] = (a + 1) * fStrikeCharWidth;
- }
+ const sal_Unicode aStrikeoutChar(TEXT_STRIKEOUT_SLASH == getTextStrikeout() ? '/' : 'X');
rTarget.push_back(Primitive2DReference(
- new TextSimplePortionPrimitive2D(
+ new TextCharacterStrikeoutPrimitive2D(
rDecTrans.getB2DHomMatrix(),
- aStrikeoutString,
- 0,
- aStrikeoutString.Len(),
- aDXArray,
- rFontAttributes,
- getLocale(),
- getFontColor())));
+ fTextWidth,
+ getFontColor(),
+ aStrikeoutChar,
+ getFontAttribute(),
+ getLocale())));
}
else
{
// strikeout with geometry
- double fStrikeoutHeight(aTextLayouter.getUnderlineHeight());
- double fStrikeoutOffset(aTextLayouter.getStrikeoutOffset());
- bool bDoubleLine(false);
-
- // set line attribute
- switch(getFontStrikeout())
- {
- default : // case primitive2d::FONT_STRIKEOUT_SINGLE:
- {
- break;
- }
- case primitive2d::FONT_STRIKEOUT_DOUBLE:
- {
- bDoubleLine = true;
- break;
- }
- case primitive2d::FONT_STRIKEOUT_BOLD:
- {
- fStrikeoutHeight *= 2.0;
- break;
- }
- }
-
- if(bDoubleLine)
- {
- fStrikeoutOffset -= 0.50 * fStrikeoutHeight;
- fStrikeoutHeight *= 0.64;
- }
-
- // create base polygon and new primitive
- basegfx::B2DPolygon aStrikeoutLine;
-
- aStrikeoutLine.append(basegfx::B2DPoint(0.0, -fStrikeoutOffset));
- aStrikeoutLine.append(basegfx::B2DPoint(fTextWidth, -fStrikeoutOffset));
- aStrikeoutLine.transform(aUnscaledTransform);
-
- const attribute::LineAttribute aLineAttribute(getFontColor(), fStrikeoutHeight, basegfx::B2DLINEJOIN_NONE);
- Primitive2DReference aNewPrimitive(new PolygonStrokePrimitive2D(aStrikeoutLine, aLineAttribute));
-
- // add primitive
- rTarget.push_back(aNewPrimitive);
-
- if(bDoubleLine)
- {
- // double line, create 2nd primitive with offset using TransformPrimitive based on
- // already created NewPrimitive
- const double fLineDist(2.0 * fStrikeoutHeight);
- basegfx::B2DHomMatrix aTransform;
-
- // move base point of text to 0.0 and de-rotate
- aTransform.translate(-rDecTrans.getTranslate().getX(), -rDecTrans.getTranslate().getY());
- aTransform.rotate(-rDecTrans.getRotate());
-
- // translate in Y by offset
- aTransform.translate(0.0, -fLineDist);
-
- // move back and rotate
- aTransform.rotate(rDecTrans.getRotate());
- aTransform.translate(rDecTrans.getTranslate().getX(), rDecTrans.getTranslate().getY());
-
- // add transform primitive
- const Primitive2DSequence aContent(&aNewPrimitive, 1);
- rTarget.push_back(Primitive2DReference(new TransformPrimitive2D(aTransform, aContent)));
- }
+ rTarget.push_back(Primitive2DReference(
+ new TextGeometryStrikeoutPrimitive2D(
+ rDecTrans.getB2DHomMatrix(),
+ fTextWidth,
+ getFontColor(),
+ aTextLayouter.getUnderlineHeight(),
+ aTextLayouter.getStrikeoutOffset(),
+ getTextStrikeout())));
}
}
}
@@ -480,7 +206,7 @@ namespace drawinglayer
void TextDecoratedPortionPrimitive2D::impSplitSingleWords(
std::vector< Primitive2DReference >& rTarget,
- basegfx::DecomposedB2DHomMatrixContainer& rDecTrans) const
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rDecTrans) const
{
// break iterator support
// made static so it only needs to be fetched once, even with many single
@@ -510,21 +236,21 @@ namespace drawinglayer
impCorrectTextBoundary(aNextWordBoundary);
// prepare new font attributes WITHOUT outline
- const FontAttributes aNewFontAttributes(
- getFontAttributes().getFamilyName(),
- getFontAttributes().getStyleName(),
- getFontAttributes().getWeight(),
- getFontAttributes().getSymbol(),
- getFontAttributes().getVertical(),
- getFontAttributes().getItalic(),
+ const attribute::FontAttribute aNewFontAttribute(
+ getFontAttribute().getFamilyName(),
+ getFontAttribute().getStyleName(),
+ getFontAttribute().getWeight(),
+ getFontAttribute().getSymbol(),
+ getFontAttribute().getVertical(),
+ getFontAttribute().getItalic(),
false, // no outline anymore, handled locally
- getFontAttributes().getRTL(),
- getFontAttributes().getBiDiStrong());
+ getFontAttribute().getRTL(),
+ getFontAttribute().getBiDiStrong());
if(aNextWordBoundary.startPos == getTextPosition() && aNextWordBoundary.endPos == getTextLength())
{
// it IS only a single word, handle as one word
- impCreateGeometryContent(rTarget, rDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttributes);
+ impCreateGeometryContent(rTarget, rDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttribute);
}
else
{
@@ -535,8 +261,8 @@ namespace drawinglayer
if(bNoDXArray)
{
// ..but only completely when no DXArray
- aTextLayouter.setFontAttributes(
- getFontAttributes(),
+ aTextLayouter.setFontAttribute(
+ getFontAttribute(),
rDecTrans.getScale().getX(),
rDecTrans.getScale().getY(),
getLocale());
@@ -612,10 +338,10 @@ namespace drawinglayer
// create geometry content for the single word. Do not forget
// to use the new transformation
- basegfx::DecomposedB2DHomMatrixContainer aDecTrans(aNewTransform);
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose aDecTrans(aNewTransform);
impCreateGeometryContent(rTarget, aDecTrans, getText(), nNewTextStart,
- nNewTextEnd - nNewTextStart, aNewDXArray, aNewFontAttributes);
+ nNewTextEnd - nNewTextStart, aNewDXArray, aNewFontAttribute);
if(aNextWordBoundary.endPos >= getTextPosition() + getTextLength())
{
@@ -646,10 +372,10 @@ namespace drawinglayer
}
}
- Primitive2DSequence TextDecoratedPortionPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence TextDecoratedPortionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
std::vector< Primitive2DReference > aNewPrimitives;
- basegfx::DecomposedB2DHomMatrixContainer aDecTrans(getTextTransform());
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose aDecTrans(getTextTransform());
Primitive2DSequence aRetval;
// create basic geometry such as SimpleTextPrimitive, Overline, Underline,
@@ -662,19 +388,19 @@ namespace drawinglayer
else
{
// prepare new font attributes WITHOUT outline
- const FontAttributes aNewFontAttributes(
- getFontAttributes().getFamilyName(),
- getFontAttributes().getStyleName(),
- getFontAttributes().getWeight(),
- getFontAttributes().getSymbol(),
- getFontAttributes().getVertical(),
- getFontAttributes().getItalic(),
+ const attribute::FontAttribute aNewFontAttribute(
+ getFontAttribute().getFamilyName(),
+ getFontAttribute().getStyleName(),
+ getFontAttribute().getWeight(),
+ getFontAttribute().getSymbol(),
+ getFontAttribute().getVertical(),
+ getFontAttribute().getItalic(),
false, // no outline anymore, handled locally
- getFontAttributes().getRTL(),
- getFontAttributes().getBiDiStrong());
+ getFontAttribute().getRTL(),
+ getFontAttribute().getBiDiStrong());
// handle as one word
- impCreateGeometryContent(aNewPrimitives, aDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttributes);
+ impCreateGeometryContent(aNewPrimitives, aDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttribute);
}
// convert to Primitive2DSequence
@@ -690,15 +416,15 @@ namespace drawinglayer
}
}
- // Handle Shadow, Outline and FontRelief
+ // Handle Shadow, Outline and TextRelief
if(aRetval.hasElements())
{
- // outline AND shadow depend on NO FontRelief (see dialog)
- const bool bHasFontRelief(FONT_RELIEF_NONE != getFontRelief());
- const bool bHasShadow(!bHasFontRelief && getShadow());
- const bool bHasOutline(!bHasFontRelief && getFontAttributes().getOutline());
+ // outline AND shadow depend on NO TextRelief (see dialog)
+ const bool bHasTextRelief(TEXT_RELIEF_NONE != getTextRelief());
+ const bool bHasShadow(!bHasTextRelief && getShadow());
+ const bool bHasOutline(!bHasTextRelief && getFontAttribute().getOutline());
- if(bHasShadow || bHasFontRelief || bHasOutline)
+ if(bHasShadow || bHasTextRelief || bHasOutline)
{
Primitive2DReference aShadow;
@@ -713,8 +439,8 @@ namespace drawinglayer
static basegfx::BColor aShadowColor(0.3, 0.3, 0.3);
// preapare shadow transform matrix
- basegfx::B2DHomMatrix aShadowTransform;
- aShadowTransform.translate(fTextShadowOffset, fTextShadowOffset);
+ const basegfx::B2DHomMatrix aShadowTransform(basegfx::tools::createTranslateB2DHomMatrix(
+ fTextShadowOffset, fTextShadowOffset));
// create shadow primitive
aShadow = Primitive2DReference(new ShadowPrimitive2D(
@@ -723,7 +449,7 @@ namespace drawinglayer
aRetval));
}
- if(bHasFontRelief)
+ if(bHasTextRelief)
{
// create emboss using an own helper primitive since this will
// be view-dependent
@@ -733,7 +459,7 @@ namespace drawinglayer
if(bDefaultTextColor)
{
- if(FONT_RELIEF_ENGRAVED == getFontRelief())
+ if(TEXT_RELIEF_ENGRAVED == getTextRelief())
{
aTextEffectStyle2D = TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED_DEFAULT;
}
@@ -744,7 +470,7 @@ namespace drawinglayer
}
else
{
- if(FONT_RELIEF_ENGRAVED == getFontRelief())
+ if(TEXT_RELIEF_ENGRAVED == getTextRelief())
{
aTextEffectStyle2D = TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED;
}
@@ -795,31 +521,31 @@ namespace drawinglayer
xub_StrLen aTextPosition,
xub_StrLen aTextLength,
const ::std::vector< double >& rDXArray,
- const FontAttributes& rFontAttributes,
+ const attribute::FontAttribute& rFontAttribute,
const ::com::sun::star::lang::Locale& rLocale,
const basegfx::BColor& rFontColor,
// local parameters
const basegfx::BColor& rOverlineColor,
const basegfx::BColor& rTextlineColor,
- FontUnderline eFontOverline,
- FontUnderline eFontUnderline,
+ TextLine eFontOverline,
+ TextLine eFontUnderline,
bool bUnderlineAbove,
- FontStrikeout eFontStrikeout,
+ TextStrikeout eTextStrikeout,
bool bWordLineMode,
- FontEmphasisMark eFontEmphasisMark,
+ TextEmphasisMark eTextEmphasisMark,
bool bEmphasisMarkAbove,
bool bEmphasisMarkBelow,
- FontRelief eFontRelief,
+ TextRelief eTextRelief,
bool bShadow)
- : TextSimplePortionPrimitive2D(rNewTransform, rText, aTextPosition, aTextLength, rDXArray, rFontAttributes, rLocale, rFontColor),
+ : TextSimplePortionPrimitive2D(rNewTransform, rText, aTextPosition, aTextLength, rDXArray, rFontAttribute, rLocale, rFontColor),
maOverlineColor(rOverlineColor),
maTextlineColor(rTextlineColor),
meFontOverline(eFontOverline),
meFontUnderline(eFontUnderline),
- meFontStrikeout(eFontStrikeout),
- meFontEmphasisMark(eFontEmphasisMark),
- meFontRelief(eFontRelief),
+ meTextStrikeout(eTextStrikeout),
+ meTextEmphasisMark(eTextEmphasisMark),
+ meTextRelief(eTextRelief),
mbUnderlineAbove(bUnderlineAbove),
mbWordLineMode(bWordLineMode),
mbEmphasisMarkAbove(bEmphasisMarkAbove),
@@ -838,9 +564,9 @@ namespace drawinglayer
&& getTextlineColor() == rCompare.getTextlineColor()
&& getFontOverline() == rCompare.getFontOverline()
&& getFontUnderline() == rCompare.getFontUnderline()
- && getFontStrikeout() == rCompare.getFontStrikeout()
- && getFontEmphasisMark() == rCompare.getFontEmphasisMark()
- && getFontRelief() == rCompare.getFontRelief()
+ && getTextStrikeout() == rCompare.getTextStrikeout()
+ && getTextEmphasisMark() == rCompare.getTextEmphasisMark()
+ && getTextRelief() == rCompare.getTextRelief()
&& getUnderlineAbove() == rCompare.getUnderlineAbove()
&& getWordLineMode() == rCompare.getWordLineMode()
&& getEmphasisMarkAbove() == rCompare.getEmphasisMarkAbove()
@@ -857,19 +583,19 @@ namespace drawinglayer
basegfx::B2DRange TextDecoratedPortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
const bool bDecoratedIsNeeded(
- FONT_UNDERLINE_NONE != getFontOverline()
- || FONT_UNDERLINE_NONE != getFontUnderline()
- || FONT_STRIKEOUT_NONE != getFontStrikeout()
- || FONT_EMPHASISMARK_NONE != getFontEmphasisMark()
- || FONT_RELIEF_NONE != getFontRelief()
+ TEXT_LINE_NONE != getFontOverline()
+ || TEXT_LINE_NONE != getFontUnderline()
+ || TEXT_STRIKEOUT_NONE != getTextStrikeout()
+ || TEXT_EMPHASISMARK_NONE != getTextEmphasisMark()
+ || TEXT_RELIEF_NONE != getTextRelief()
|| getShadow());
if(bDecoratedIsNeeded)
{
- // decoration is used, fallback to BasePrimitive2D::getB2DRange which uses
+ // decoration is used, fallback to BufferedDecompositionPrimitive2D::getB2DRange which uses
// the own local decomposition for computation and thus creates all necessary
// geometric objects
- return BasePrimitive2D::getB2DRange(rViewInformation);
+ return BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
}
else
{
diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
index c1963f4ba2a4..5e98a9d6d34b 100644
--- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
@@ -41,6 +41,7 @@
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -50,7 +51,7 @@ namespace drawinglayer
{
static double fDiscreteSize(1.1);
- Primitive2DSequence TextEffectPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ Primitive2DSequence TextEffectPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
Primitive2DSequence aRetval;
@@ -68,13 +69,12 @@ namespace drawinglayer
case TEXTEFFECTSTYLE2D_RELIEF_ENGRAVED_DEFAULT:
{
// prepare transform of sub-group back to (0,0) and align to X-Axis
- basegfx::B2DHomMatrix aBackTransform;
- aBackTransform.translate(-getRotationCenter().getX(), -getRotationCenter().getY());
+ basegfx::B2DHomMatrix aBackTransform(basegfx::tools::createTranslateB2DHomMatrix(
+ -getRotationCenter().getX(), -getRotationCenter().getY()));
aBackTransform.rotate(-getDirection());
// prepare transform of sub-group back to it's position and rotation
- basegfx::B2DHomMatrix aForwardTransform;
- aForwardTransform.rotate(getDirection());
+ basegfx::B2DHomMatrix aForwardTransform(basegfx::tools::createRotateB2DHomMatrix(getDirection()));
aForwardTransform.translate(getRotationCenter().getX(), getRotationCenter().getY());
// create transformation for one discrete unit
@@ -104,22 +104,22 @@ namespace drawinglayer
{
// emboss/engrave in black, original forced to white
const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.0));
- const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToGray));
+ const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1)));
// add original, too
const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0));
- aRetval[1] = Primitive2DReference(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToWhite));
+ aRetval[1] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
}
else
{
// emboss/engrave in gray, keep original's color
const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.75)); // 192
- const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToGray));
+ const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1)));
// add original, too
- aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getChildren()));
+ aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getTextContent()));
}
break;
@@ -132,39 +132,39 @@ namespace drawinglayer
aTransform.set(0, 2, aDistance.getX());
aTransform.set(1, 2, 0.0);
- aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, aDiagonalDistance.getX());
aTransform.set(1, 2, aDiagonalDistance.getY());
- aRetval[1] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[1] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, 0.0);
aTransform.set(1, 2, aDistance.getY());
- aRetval[2] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[2] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, -aDiagonalDistance.getX());
aTransform.set(1, 2, aDiagonalDistance.getY());
- aRetval[3] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[3] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, -aDistance.getX());
aTransform.set(1, 2, 0.0);
- aRetval[4] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[4] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, -aDiagonalDistance.getX());
aTransform.set(1, 2, -aDiagonalDistance.getY());
- aRetval[5] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[5] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, 0.0);
aTransform.set(1, 2, -aDistance.getY());
- aRetval[6] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[6] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
aTransform.set(0, 2, aDiagonalDistance.getX());
aTransform.set(1, 2, -aDiagonalDistance.getY());
- aRetval[7] = Primitive2DReference(new TransformPrimitive2D(aTransform, getChildren()));
+ aRetval[7] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
// at last, place original over it, but force to white
const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0, 1.0, 1.0));
- aRetval[8] = Primitive2DReference(new ModifiedColorPrimitive2D(getChildren(), aBColorModifierToWhite));
+ aRetval[8] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
break;
}
@@ -174,11 +174,12 @@ namespace drawinglayer
}
TextEffectPrimitive2D::TextEffectPrimitive2D(
- const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rTextContent,
const basegfx::B2DPoint& rRotationCenter,
double fDirection,
TextEffectStyle2D eTextEffectStyle2D)
- : GroupPrimitive2D(rChildren),
+ : BufferedDecompositionPrimitive2D(),
+ maTextContent(rTextContent),
maRotationCenter(rRotationCenter),
mfDirection(fDirection),
meTextEffectStyle2D(eTextEffectStyle2D)
@@ -187,11 +188,12 @@ namespace drawinglayer
bool TextEffectPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(GroupPrimitive2D::operator==(rPrimitive))
+ if(BasePrimitive2D::operator==(rPrimitive))
{
const TextEffectPrimitive2D& rCompare = (TextEffectPrimitive2D&)rPrimitive;
- return (getRotationCenter() == rCompare.getRotationCenter()
+ return (getTextContent() == rCompare.getTextContent()
+ && getRotationCenter() == rCompare.getRotationCenter()
&& getDirection() == rCompare.getDirection()
&& getTextEffectStyle2D() == rCompare.getTextEffectStyle2D());
}
@@ -206,7 +208,7 @@ namespace drawinglayer
// then will ask 9 times at nearly the same content. This may even be refined here using the
// TextEffectStyle information, e.g. for TEXTEFFECTSTYLE2D_RELIEF the grow needs only to
// be in two directions
- basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
+ basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getTextContent(), rViewInformation));
aRetval.grow(fDiscreteSize);
return aRetval;
@@ -216,23 +218,23 @@ namespace drawinglayer
{
::osl::MutexGuard aGuard( m_aMutex );
- if(getLocalDecomposition().hasElements())
+ if(getBuffered2DDecomposition().hasElements())
{
if(maLastObjectToViewTransformation != rViewInformation.getObjectToViewTransformation())
{
// conditions of last local decomposition have changed, delete
- const_cast< TextEffectPrimitive2D* >(this)->setLocalDecomposition(Primitive2DSequence());
+ const_cast< TextEffectPrimitive2D* >(this)->setBuffered2DDecomposition(Primitive2DSequence());
}
}
- if(!getLocalDecomposition().hasElements())
+ if(!getBuffered2DDecomposition().hasElements())
{
// remember ViewRange and ViewTransformation
const_cast< TextEffectPrimitive2D* >(this)->maLastObjectToViewTransformation = rViewInformation.getObjectToViewTransformation();
}
// use parent implementation
- return BasePrimitive2D::get2DDecomposition(rViewInformation);
+ return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx b/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx
new file mode 100644
index 000000000000..8b24668cb056
--- /dev/null
+++ b/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textprimitive2d.cxx,v $
+ *
+ * $Revision: 1.22 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle)
+ {
+ switch(eLineStyle)
+ {
+ case UNDERLINE_SINGLE: return TEXT_LINE_SINGLE;
+ case UNDERLINE_DOUBLE: return TEXT_LINE_DOUBLE;
+ case UNDERLINE_DOTTED: return TEXT_LINE_DOTTED;
+ case UNDERLINE_DASH: return TEXT_LINE_DASH;
+ case UNDERLINE_LONGDASH: return TEXT_LINE_LONGDASH;
+ case UNDERLINE_DASHDOT: return TEXT_LINE_DASHDOT;
+ case UNDERLINE_DASHDOTDOT: return TEXT_LINE_DASHDOTDOT;
+ case UNDERLINE_SMALLWAVE: return TEXT_LINE_SMALLWAVE;
+ case UNDERLINE_WAVE: return TEXT_LINE_WAVE;
+ case UNDERLINE_DOUBLEWAVE: return TEXT_LINE_DOUBLEWAVE;
+ case UNDERLINE_BOLD: return TEXT_LINE_BOLD;
+ case UNDERLINE_BOLDDOTTED: return TEXT_LINE_BOLDDOTTED;
+ case UNDERLINE_BOLDDASH: return TEXT_LINE_BOLDDASH;
+ case UNDERLINE_BOLDLONGDASH: return TEXT_LINE_BOLDLONGDASH;
+ case UNDERLINE_BOLDDASHDOT: return TEXT_LINE_BOLDDASHDOT;
+ case UNDERLINE_BOLDDASHDOTDOT: return TEXT_LINE_BOLDDASHDOTDOT;
+ case UNDERLINE_BOLDWAVE: return TEXT_LINE_BOLDWAVE;
+ // FontUnderline_FORCE_EQUAL_SIZE, UNDERLINE_DONTKNOW, UNDERLINE_NONE
+ default: return TEXT_LINE_NONE;
+ }
+ }
+
+ FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle)
+ {
+ switch(eLineStyle)
+ {
+ default: /*TEXT_LINE_NONE*/ return UNDERLINE_NONE;
+ case TEXT_LINE_SINGLE: return UNDERLINE_SINGLE;
+ case TEXT_LINE_DOUBLE: return UNDERLINE_DOUBLE;
+ case TEXT_LINE_DOTTED: return UNDERLINE_DOTTED;
+ case TEXT_LINE_DASH: return UNDERLINE_DASH;
+ case TEXT_LINE_LONGDASH: return UNDERLINE_LONGDASH;
+ case TEXT_LINE_DASHDOT: return UNDERLINE_DASHDOT;
+ case TEXT_LINE_DASHDOTDOT: return UNDERLINE_DASHDOTDOT;
+ case TEXT_LINE_SMALLWAVE: return UNDERLINE_SMALLWAVE;
+ case TEXT_LINE_WAVE: return UNDERLINE_WAVE;
+ case TEXT_LINE_DOUBLEWAVE: return UNDERLINE_DOUBLEWAVE;
+ case TEXT_LINE_BOLD: return UNDERLINE_BOLD;
+ case TEXT_LINE_BOLDDOTTED: return UNDERLINE_BOLDDOTTED;
+ case TEXT_LINE_BOLDDASH: return UNDERLINE_BOLDDASH;
+ case TEXT_LINE_BOLDLONGDASH: return UNDERLINE_LONGDASH;
+ case TEXT_LINE_BOLDDASHDOT: return UNDERLINE_BOLDDASHDOT;
+ case TEXT_LINE_BOLDDASHDOTDOT:return UNDERLINE_BOLDDASHDOT;
+ case TEXT_LINE_BOLDWAVE: return UNDERLINE_BOLDWAVE;
+ }
+ }
+
+ TextStrikeout mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout)
+ {
+ switch(eFontStrikeout)
+ {
+ case STRIKEOUT_SINGLE: return TEXT_STRIKEOUT_SINGLE;
+ case STRIKEOUT_DOUBLE: return TEXT_STRIKEOUT_DOUBLE;
+ case STRIKEOUT_BOLD: return TEXT_STRIKEOUT_BOLD;
+ case STRIKEOUT_SLASH: return TEXT_STRIKEOUT_SLASH;
+ case STRIKEOUT_X: return TEXT_STRIKEOUT_X;
+ // FontStrikeout_FORCE_EQUAL_SIZE, STRIKEOUT_NONE, STRIKEOUT_DONTKNOW
+ default: return TEXT_STRIKEOUT_NONE;
+ }
+ }
+
+ FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout)
+ {
+ switch(eTextStrikeout)
+ {
+ default: /*case primitive2d::TEXT_STRIKEOUT_NONE*/ return STRIKEOUT_NONE;
+ case TEXT_STRIKEOUT_SINGLE: return STRIKEOUT_SINGLE;
+ case TEXT_STRIKEOUT_DOUBLE: return STRIKEOUT_DOUBLE;
+ case TEXT_STRIKEOUT_BOLD: return STRIKEOUT_BOLD;
+ case TEXT_STRIKEOUT_SLASH: return STRIKEOUT_SLASH;
+ case TEXT_STRIKEOUT_X: return STRIKEOUT_X;
+ }
+ }
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index e321783c8406..2950427d6b57 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -167,14 +167,14 @@ namespace drawinglayer
mrDevice.SetFont( rFont );
}
- void TextLayouterDevice::setFontAttributes(
- const FontAttributes& rFontAttributes,
+ void TextLayouterDevice::setFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
double fFontScaleX,
double fFontScaleY,
const ::com::sun::star::lang::Locale& rLocale)
{
- setFont(getVclFontFromFontAttributes(
- rFontAttributes,
+ setFont(getVclFontFromFontAttribute(
+ rFontAttribute,
fFontScaleX,
fFontScaleY,
0.0,
@@ -297,6 +297,28 @@ namespace drawinglayer
return basegfx::B2DRange();
}
+
+ double TextLayouterDevice::getFontAscent() const
+ {
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ return rMetric.GetAscent();
+ }
+
+ double TextLayouterDevice::getFontDescent() const
+ {
+ const ::FontMetric& rMetric = mrDevice.GetFontMetric();
+ return rMetric.GetDescent();
+ }
+
+ void TextLayouterDevice::addTextRectActions(
+ const Rectangle& rRectangle,
+ const String& rText,
+ sal_uInt16 nStyle,
+ GDIMetaFile& rGDIMetaFile)
+ {
+ mrDevice.AddTextRectActions(
+ rRectangle, rText, nStyle, rGDIMetaFile);
+ }
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -307,8 +329,8 @@ namespace drawinglayer
{
namespace primitive2d
{
- Font getVclFontFromFontAttributes(
- const FontAttributes& rFontAttributes,
+ Font getVclFontFromFontAttribute(
+ const attribute::FontAttribute& rFontAttribute,
double fFontScaleX,
double fFontScaleY,
double fFontRotation,
@@ -324,8 +346,8 @@ namespace drawinglayer
// is wanted, that width needs to be adapted using FontMetric again to get a
// width of the unscaled font
Font aRetval(
- rFontAttributes.getFamilyName(),
- rFontAttributes.getStyleName(),
+ rFontAttribute.getFamilyName(),
+ rFontAttribute.getStyleName(),
Size(0, nHeight));
#else
// for non-WIN32 systems things are easier since these accept a Font creation
@@ -334,17 +356,17 @@ namespace drawinglayer
// Font would be recorded in a MetaFile (The MetaFile FontAction WILL record a
// set FontWidth; import that in a WIN32 system, and trouble is there)
Font aRetval(
- rFontAttributes.getFamilyName(),
- rFontAttributes.getStyleName(),
+ rFontAttribute.getFamilyName(),
+ rFontAttribute.getStyleName(),
Size(bFontIsScaled ? nWidth : 0, nHeight));
#endif
- // define various other FontAttributes
+ // define various other FontAttribute
aRetval.SetAlign(ALIGN_BASELINE);
- aRetval.SetCharSet(rFontAttributes.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
- aRetval.SetVertical(rFontAttributes.getVertical() ? TRUE : FALSE);
- aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight()));
- aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
- aRetval.SetOutline(rFontAttributes.getOutline());
+ aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
+ aRetval.SetVertical(rFontAttribute.getVertical() ? TRUE : FALSE);
+ aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
+ aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
+ aRetval.SetOutline(rFontAttribute.getOutline());
aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
#ifdef WIN32
@@ -371,13 +393,13 @@ namespace drawinglayer
return aRetval;
}
- FontAttributes getFontAttributesFromVclFont(
+ attribute::FontAttribute getFontAttributeFromVclFont(
basegfx::B2DVector& o_rSize,
const Font& rFont,
bool bRTL,
bool bBiDiStrong)
{
- const FontAttributes aRetval(
+ const attribute::FontAttribute aRetval(
rFont.GetName(),
rFont.GetStyleName(),
static_cast<sal_uInt16>(rFont.GetWeight()),
diff --git a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
new file mode 100644
index 000000000000..45b2809be2ce
--- /dev/null
+++ b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
@@ -0,0 +1,317 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: textdecoratedprimitive2d.cxx,v $
+ *
+ * $Revision: 1.12 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence TextLinePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence xRetval;
+
+ if(TEXT_LINE_NONE != getTextLine())
+ {
+ bool bDoubleLine(false);
+ bool bWaveLine(false);
+ bool bBoldLine(false);
+ const int* pDotDashArray(0);
+ basegfx::B2DLineJoin eLineJoin(basegfx::B2DLINEJOIN_NONE);
+ double fOffset(getOffset());
+ double fHeight(getHeight());
+
+ static const int aDottedArray[] = { 1, 1, 0}; // DOTTED LINE
+ static const int aDotDashArray[] = { 1, 1, 4, 1, 0}; // DASHDOT
+ static const int aDashDotDotArray[] = { 1, 1, 1, 1, 4, 1, 0}; // DASHDOTDOT
+ static const int aDashedArray[] = { 5, 2, 0}; // DASHED LINE
+ static const int aLongDashArray[] = { 7, 2, 0}; // LONGDASH
+
+ // get decomposition
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ switch(getTextLine())
+ {
+ default: // case TEXT_LINE_SINGLE:
+ {
+ break;
+ }
+ case TEXT_LINE_DOUBLE:
+ {
+ bDoubleLine = true;
+ break;
+ }
+ case TEXT_LINE_DOTTED:
+ {
+ pDotDashArray = aDottedArray;
+ break;
+ }
+ case TEXT_LINE_DASH:
+ {
+ pDotDashArray = aDashedArray;
+ break;
+ }
+ case TEXT_LINE_LONGDASH:
+ {
+ pDotDashArray = aLongDashArray;
+ break;
+ }
+ case TEXT_LINE_DASHDOT:
+ {
+ pDotDashArray = aDotDashArray;
+ break;
+ }
+ case TEXT_LINE_DASHDOTDOT:
+ {
+ pDotDashArray = aDashDotDotArray;
+ break;
+ }
+ case TEXT_LINE_SMALLWAVE:
+ {
+ bWaveLine = true;
+ break;
+ }
+ case TEXT_LINE_WAVE:
+ {
+ bWaveLine = true;
+ break;
+ }
+ case TEXT_LINE_DOUBLEWAVE:
+ {
+ bDoubleLine = true;
+ bWaveLine = true;
+ break;
+ }
+ case TEXT_LINE_BOLD:
+ {
+ bBoldLine = true;
+ break;
+ }
+ case TEXT_LINE_BOLDDOTTED:
+ {
+ bBoldLine = true;
+ pDotDashArray = aDottedArray;
+ break;
+ }
+ case TEXT_LINE_BOLDDASH:
+ {
+ bBoldLine = true;
+ pDotDashArray = aDashedArray;
+ break;
+ }
+ case TEXT_LINE_BOLDLONGDASH:
+ {
+ bBoldLine = true;
+ pDotDashArray = aLongDashArray;
+ break;
+ }
+ case TEXT_LINE_BOLDDASHDOT:
+ {
+ bBoldLine = true;
+ pDotDashArray = aDotDashArray;
+ break;
+ }
+ case TEXT_LINE_BOLDDASHDOTDOT:
+ {
+ bBoldLine = true;
+ pDotDashArray = aDashDotDotArray;
+ break;
+ }
+ case TEXT_LINE_BOLDWAVE:
+ {
+ bWaveLine = true;
+ bBoldLine = true;
+ break;
+ }
+ }
+
+ if(bBoldLine)
+ {
+ fHeight *= 2.0;
+ }
+
+ if(bDoubleLine)
+ {
+ fOffset -= 0.50 * fHeight;
+ fHeight *= 0.64;
+ }
+
+ if(bWaveLine)
+ {
+ eLineJoin = basegfx::B2DLINEJOIN_ROUND;
+ fHeight *= 0.25;
+ }
+
+ // prepare Line and Stroke Attributes
+ const attribute::LineAttribute aLineAttribute(getLineColor(), fHeight, eLineJoin);
+ attribute::StrokeAttribute aStrokeAttribute;
+
+ if(pDotDashArray)
+ {
+ ::std::vector< double > aDoubleArray;
+
+ for(const int* p = pDotDashArray; *p; ++p)
+ {
+ aDoubleArray.push_back((double)(*p) * fHeight);
+ }
+
+ aStrokeAttribute = attribute::StrokeAttribute(aDoubleArray);
+ }
+
+ // create base polygon and new primitive
+ basegfx::B2DPolygon aLine;
+ Primitive2DReference aNewPrimitive;
+
+ aLine.append(basegfx::B2DPoint(0.0, fOffset));
+ aLine.append(basegfx::B2DPoint(getWidth(), fOffset));
+
+ const basegfx::B2DHomMatrix aUnscaledTransform(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX, fRotate, aTranslate));
+
+ aLine.transform(aUnscaledTransform);
+
+ if(bWaveLine)
+ {
+ double fWaveWidth(10.6 * fHeight);
+
+ if(TEXT_LINE_SMALLWAVE == getTextLine())
+ {
+ fWaveWidth *= 0.7;
+ }
+ else if(TEXT_LINE_WAVE == getTextLine())
+ {
+ // extra multiply to get the same WaveWidth as with the bold version
+ fWaveWidth *= 2.0;
+ }
+
+ aNewPrimitive = Primitive2DReference(new PolygonWavePrimitive2D(aLine, aLineAttribute, aStrokeAttribute, fWaveWidth, fWaveWidth * 0.5));
+ }
+ else