summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-10-08 10:45:49 +0200
committerThomas Lange [tl] <tl@openoffice.org>2010-10-08 10:45:49 +0200
commit2bc4b89324d51333e7e56461ee2c8c43ab72823a (patch)
treec924e1a8a52901843974b269875e481b08f44902
parentda3edc641430d6d609bf417129a551ff6df88523 (diff)
parent8791a391246e7483c12dc4d1bfc870573d94fc66 (diff)
cws tlmath01: merge with DEV300_m89
-rw-r--r--avmedia/prj/build.lst4
-rw-r--r--avmedia/prj/d.lst5
-rw-r--r--avmedia/source/framework/mediacontrol.cxx4
-rw-r--r--avmedia/source/framework/soundhandler.cxx38
-rw-r--r--avmedia/source/gstreamer/avmediagst.component34
-rw-r--r--avmedia/source/gstreamer/exports.dxp2
-rw-r--r--avmedia/source/gstreamer/gstcommon.hxx68
-rw-r--r--avmedia/source/gstreamer/gstframegrabber.cxx307
-rw-r--r--avmedia/source/gstreamer/gstframegrabber.hxx81
-rw-r--r--avmedia/source/gstreamer/gstmanager.cxx85
-rw-r--r--avmedia/source/gstreamer/gstmanager.hxx74
-rw-r--r--avmedia/source/gstreamer/gstplayer.cxx938
-rw-r--r--avmedia/source/gstreamer/gstplayer.hxx236
-rw-r--r--avmedia/source/gstreamer/gstuno.cxx77
-rw-r--r--avmedia/source/gstreamer/gstwindow.cxx668
-rw-r--r--avmedia/source/gstreamer/gstwindow.hxx197
-rw-r--r--avmedia/source/gstreamer/makefile.mk79
-rw-r--r--avmedia/source/inc/mediamisc.hxx24
-rw-r--r--avmedia/source/java/MediaUno.java9
-rw-r--r--avmedia/source/java/PlayerWindow.java4
-rw-r--r--avmedia/source/java/avmedia.jarbin16420 -> 15776 bytes
-rw-r--r--avmedia/source/java/avmedia.jar.component34
-rw-r--r--avmedia/source/java/makefile.mk8
-rw-r--r--avmedia/source/quicktime/avmediaQuickTime.component34
-rw-r--r--avmedia/source/quicktime/makefile.mk8
-rw-r--r--avmedia/source/quicktime/quicktimeuno.cxx29
-rw-r--r--avmedia/source/viewer/mediawindow.cxx47
-rw-r--r--avmedia/source/viewer/mediawindow_impl.cxx107
-rw-r--r--avmedia/source/viewer/mediawindow_impl.hxx41
-rw-r--r--avmedia/source/viewer/mediawindowbase_impl.cxx65
-rw-r--r--avmedia/source/viewer/mediawindowbase_impl.hxx5
-rw-r--r--avmedia/source/win/avmediawin.component34
-rw-r--r--avmedia/source/win/exports.dxp1
-rw-r--r--avmedia/source/win/makefile.mk8
-rw-r--r--avmedia/source/win/winuno.cxx31
-rw-r--r--avmedia/source/xine/exports.dxp1
-rw-r--r--avmedia/source/xine/xineuno.cxx29
-rw-r--r--avmedia/util/avmedia.component34
-rw-r--r--avmedia/util/makefile.mk8
-rw-r--r--basic/inc/basic/process.hxx6
-rw-r--r--basic/inc/basic/sbmod.hxx11
-rw-r--r--basic/inc/basic/sbobjmod.hxx12
-rw-r--r--basic/inc/basic/sbxvar.hxx12
-rw-r--r--basic/prj/d.lst1
-rw-r--r--basic/source/app/process.cxx38
-rw-r--r--basic/source/basmgr/basmgr.cxx12
-rw-r--r--basic/source/classes/disas.cxx34
-rw-r--r--basic/source/classes/eventatt.cxx2
-rw-r--r--[-rwxr-xr-x]basic/source/classes/sb.cxx178
-rwxr-xr-xbasic/source/classes/sbunoobj.cxx35
-rw-r--r--basic/source/classes/sbxmod.cxx582
-rw-r--r--basic/source/comp/codegen.cxx12
-rw-r--r--basic/source/comp/dim.cxx70
-rw-r--r--basic/source/comp/exprgen.cxx73
-rw-r--r--basic/source/comp/exprtree.cxx19
-rw-r--r--basic/source/comp/makefile.mk33
-rwxr-xr-x[-rw-r--r--]basic/source/comp/sbcomp.cxx312
-rw-r--r--basic/source/inc/expr.hxx3
-rw-r--r--basic/source/inc/namecont.hxx10
-rw-r--r--basic/source/inc/parser.hxx5
-rw-r--r--basic/source/inc/sbintern.hxx6
-rwxr-xr-x[-rw-r--r--]basic/source/inc/sbtrace.hxx (renamed from sfx2/source/appl/sfxdll.cxx)51
-rw-r--r--basic/source/inc/sbunoobj.hxx1
-rw-r--r--basic/source/inc/scriptcont.hxx4
-rw-r--r--basic/source/inc/symtbl.hxx3
-rw-r--r--basic/source/runtime/methods.cxx86
-rw-r--r--basic/source/runtime/methods1.cxx47
-rw-r--r--basic/source/runtime/props.cxx7
-rw-r--r--basic/source/runtime/rtlproto.hxx1
-rw-r--r--[-rwxr-xr-x]basic/source/runtime/runtime.cxx19
-rw-r--r--basic/source/runtime/stdobj.cxx1
-rw-r--r--basic/source/runtime/step0.cxx251
-rwxr-xr-x[-rw-r--r--]basic/source/runtime/step2.cxx48
-rw-r--r--basic/source/sbx/sbxbase.cxx7
-rw-r--r--basic/source/sbx/sbxbool.cxx18
-rw-r--r--basic/source/sbx/sbxbyte.cxx10
-rw-r--r--basic/source/sbx/sbxchar.cxx15
-rw-r--r--basic/source/sbx/sbxconv.hxx16
-rw-r--r--basic/source/sbx/sbxcurr.cxx26
-rw-r--r--basic/source/sbx/sbxdate.cxx20
-rw-r--r--basic/source/sbx/sbxdbl.cxx10
-rw-r--r--basic/source/sbx/sbxdec.cxx20
-rw-r--r--basic/source/sbx/sbxdec.hxx4
-rw-r--r--basic/source/sbx/sbxint.cxx38
-rw-r--r--basic/source/sbx/sbxlng.cxx10
-rw-r--r--basic/source/sbx/sbxres.cxx2
-rw-r--r--basic/source/sbx/sbxres.hxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx37
-rw-r--r--basic/source/sbx/sbxsng.cxx10
-rw-r--r--basic/source/sbx/sbxstr.cxx50
-rw-r--r--basic/source/sbx/sbxuint.cxx10
-rw-r--r--basic/source/sbx/sbxulng.cxx10
-rw-r--r--basic/source/sbx/sbxvalue.cxx105
-rw-r--r--basic/source/sbx/sbxvar.cxx40
-rw-r--r--basic/source/uno/namecont.cxx8
-rw-r--r--basic/source/uno/scriptcont.cxx10
-rw-r--r--basic/util/makefile.mk6
-rw-r--r--basic/util/sb.component (renamed from configmgr/source/span.hxx)55
-rw-r--r--configmgr/prj/build.lst2
-rw-r--r--configmgr/prj/d.lst1
-rw-r--r--configmgr/source/README4
-rw-r--r--configmgr/source/access.cxx23
-rw-r--r--configmgr/source/additions.hxx (renamed from configmgr/source/pad.hxx)28
-rw-r--r--configmgr/source/broadcaster.cxx63
-rw-r--r--configmgr/source/components.cxx177
-rw-r--r--configmgr/source/components.hxx20
-rw-r--r--configmgr/source/configmgr.component45
-rw-r--r--configmgr/source/configurationprovider.cxx10
-rw-r--r--configmgr/source/data.cxx44
-rw-r--r--configmgr/source/data.hxx23
-rw-r--r--configmgr/source/makefile.mk15
-rw-r--r--configmgr/source/modifications.cxx21
-rw-r--r--configmgr/source/modifications.hxx2
-rw-r--r--configmgr/source/pad.cxx91
-rw-r--r--configmgr/source/parsemanager.cxx31
-rw-r--r--configmgr/source/parsemanager.hxx13
-rw-r--r--configmgr/source/parser.hxx14
-rw-r--r--configmgr/source/rootaccess.cxx5
-rw-r--r--configmgr/source/services.cxx48
-rw-r--r--configmgr/source/update.cxx17
-rw-r--r--configmgr/source/valueparser.cxx68
-rw-r--r--configmgr/source/valueparser.hxx14
-rw-r--r--configmgr/source/writemodfile.cxx35
-rw-r--r--configmgr/source/xcdparser.cxx46
-rw-r--r--configmgr/source/xcdparser.hxx13
-rw-r--r--configmgr/source/xcsparser.cxx177
-rw-r--r--configmgr/source/xcsparser.hxx27
-rw-r--r--configmgr/source/xcuparser.cxx235
-rw-r--r--configmgr/source/xcuparser.hxx44
-rw-r--r--configmgr/source/xmldata.cxx112
-rw-r--r--configmgr/source/xmldata.hxx14
-rw-r--r--configmgr/source/xmlreader.cxx1054
-rw-r--r--configmgr/source/xmlreader.hxx186
-rw-r--r--connectivity/prj/d.lst17
-rw-r--r--connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx5
-rw-r--r--connectivity/source/commontools/FValue.cxx107
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx13
-rw-r--r--connectivity/source/cpool/Zregistration.cxx29
-rw-r--r--connectivity/source/cpool/dbpool2.component34
-rw-r--r--connectivity/source/cpool/exports.dxp1
-rw-r--r--connectivity/source/cpool/makefile.mk6
-rw-r--r--connectivity/source/dbtools/dbtools.component37
-rw-r--r--connectivity/source/dbtools/exports.dxp1
-rw-r--r--connectivity/source/dbtools/makefile.mk8
-rw-r--r--connectivity/source/drivers/adabas/BDriver.cxx38
-rw-r--r--connectivity/source/drivers/adabas/BFunctions.cxx2
-rw-r--r--connectivity/source/drivers/adabas/Bservices.cxx52
-rw-r--r--connectivity/source/drivers/adabas/adabas.component35
-rw-r--r--connectivity/source/drivers/adabas/adabas.mxp.map1
-rw-r--r--connectivity/source/drivers/adabas/exports.dxp1
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk8
-rw-r--r--connectivity/source/drivers/ado/AResultSet.cxx6
-rw-r--r--connectivity/source/drivers/ado/Aservices.cxx52
-rw-r--r--connectivity/source/drivers/ado/ado.component35
-rw-r--r--connectivity/source/drivers/ado/exports.dxp1
-rw-r--r--connectivity/source/drivers/ado/makefile.mk8
-rw-r--r--connectivity/source/drivers/calc/Cservices.cxx52
-rw-r--r--connectivity/source/drivers/calc/calc.component35
-rw-r--r--connectivity/source/drivers/calc/exports.dxp1
-rw-r--r--connectivity/source/drivers/calc/makefile.mk8
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx10
-rw-r--r--connectivity/source/drivers/dbase/Dservices.cxx52
-rw-r--r--connectivity/source/drivers/dbase/dbase.component35
-rw-r--r--connectivity/source/drivers/dbase/dbase.mxp.map1
-rw-r--r--connectivity/source/drivers/dbase/exports.dxp1
-rw-r--r--connectivity/source/drivers/dbase/makefile.mk8
-rw-r--r--connectivity/source/drivers/evoab/LServices.cxx52
-rw-r--r--connectivity/source/drivers/evoab/exports.dxp1
-rw-r--r--connectivity/source/drivers/evoab2/NServices.cxx51
-rw-r--r--connectivity/source/drivers/evoab2/evoab.component34
-rw-r--r--connectivity/source/drivers/evoab2/makefile.mk8
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx13
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx5
-rw-r--r--connectivity/source/drivers/flat/Eservices.cxx52
-rw-r--r--connectivity/source/drivers/flat/exports.dxp1
-rw-r--r--connectivity/source/drivers/flat/flat.component35
-rw-r--r--connectivity/source/drivers/flat/flat.mxp.map1
-rw-r--r--connectivity/source/drivers/flat/makefile.mk8
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageAccess.cxx10
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageMap.cxx16
-rw-r--r--connectivity/source/drivers/hsqldb/Hservices.cxx52
-rw-r--r--connectivity/source/drivers/hsqldb/exports.dxp1
-rw-r--r--connectivity/source/drivers/hsqldb/hsqldb.component35
-rw-r--r--connectivity/source/drivers/hsqldb/hsqldb.map1
-rw-r--r--connectivity/source/drivers/hsqldb/makefile.mk8
-rw-r--r--connectivity/source/drivers/jdbc/Boolean.cxx17
-rw-r--r--connectivity/source/drivers/jdbc/Object.cxx8
-rw-r--r--connectivity/source/drivers/jdbc/String.cxx20
-rw-r--r--connectivity/source/drivers/jdbc/exports.dxp1
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.component34
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.mxp.map1
-rw-r--r--connectivity/source/drivers/jdbc/jservices.cxx51
-rw-r--r--connectivity/source/drivers/jdbc/makefile.mk8
-rw-r--r--connectivity/source/drivers/kab/KServices.cxx52
-rw-r--r--connectivity/source/drivers/kab/exports.dxp1
-rw-r--r--connectivity/source/drivers/kab/kab1.component34
-rw-r--r--connectivity/source/drivers/kab/makefile.mk11
-rwxr-xr-xconnectivity/source/drivers/macab/MacabServices.cxx52
-rwxr-xr-xconnectivity/source/drivers/macab/exports.dxp1
-rw-r--r--connectivity/source/drivers/macab/macab1.component34
-rwxr-xr-xconnectivity/source/drivers/macab/makefile.mk8
-rw-r--r--connectivity/source/drivers/mozab/MDriver.cxx2
-rw-r--r--connectivity/source/drivers/mozab/MServices.cxx57
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx45
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk9
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component34
-rw-r--r--connectivity/source/drivers/mozab/exports.dxp1
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk8
-rw-r--r--connectivity/source/drivers/mozab/mozab.component37
-rw-r--r--connectivity/source/drivers/mysql/Yservices.cxx52
-rw-r--r--connectivity/source/drivers/mysql/exports.dxp1
-rw-r--r--connectivity/source/drivers/mysql/makefile.mk8
-rw-r--r--connectivity/source/drivers/mysql/mysql.component35
-rw-r--r--connectivity/source/drivers/odbc/OFunctions.cxx4
-rw-r--r--connectivity/source/drivers/odbc/makefile.mk8
-rw-r--r--connectivity/source/drivers/odbc/odbc.component34
-rw-r--r--connectivity/source/drivers/odbc/oservices.cxx52
-rw-r--r--connectivity/source/drivers/odbcbase/OTools.cxx2
-rw-r--r--connectivity/source/inc/java/lang/Boolean.hxx1
-rw-r--r--connectivity/source/inc/java/lang/Object.hxx2
-rw-r--r--connectivity/source/inc/java/lang/String.hxx1
-rw-r--r--connectivity/source/inc/odbc/OFunctiondefs.hxx2
-rw-r--r--connectivity/source/manager/exports.dxp1
-rw-r--r--connectivity/source/manager/makefile.mk6
-rw-r--r--connectivity/source/manager/mregistration.cxx33
-rw-r--r--connectivity/source/manager/sdbc.mxp.map1
-rw-r--r--connectivity/source/manager/sdbc2.component34
-rw-r--r--desktop/inc/app.hxx3
-rw-r--r--desktop/prj/d.lst8
-rw-r--r--desktop/scripts/soffice.sh17
-rw-r--r--desktop/scripts/unoinfo.sh15
-rw-r--r--desktop/scripts/unopkg.sh17
-rw-r--r--desktop/source/app/app.cxx601
-rw-r--r--desktop/source/app/appfirststart.cxx102
-rw-r--r--desktop/source/app/exports.dxp1
-rw-r--r--desktop/source/app/officeipcthread.cxx2
-rw-r--r--desktop/source/deployment/deployment.component64
-rw-r--r--desktop/source/deployment/dp_services.cxx21
-rw-r--r--desktop/source/deployment/gui/deploymentgui.component40
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/gui/dp_gui_dialog2.cxx32
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/gui/dp_gui_service.cxx8
-rw-r--r--desktop/source/deployment/gui/makefile.mk8
-rw-r--r--desktop/source/deployment/makefile.mk8
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx8
-rw-r--r--desktop/source/deployment/manager/dp_properties.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_properties.hxx5
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx5
-rw-r--r--[-rwxr-xr-x]desktop/source/deployment/misc/dp_update.cxx84
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx88
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx5
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx5
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx7
-rw-r--r--desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx5
-rw-r--r--desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx5
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx404
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.cxx5
-rw-r--r--desktop/source/deployment/registry/help/dp_helpbackenddb.hxx5
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx22
-rw-r--r--desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx5
-rw-r--r--desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx5
-rw-r--r--desktop/source/migration/services/cexports.cxx7
-rw-r--r--[-rwxr-xr-x]desktop/source/migration/services/cexportsoo3.cxx12
-rw-r--r--desktop/source/migration/services/makefile.mk17
-rw-r--r--desktop/source/migration/services/migrationoo2.component37
-rw-r--r--desktop/source/migration/services/migrationoo3.component34
-rwxr-xr-xdesktop/source/migration/services/migrationoo3.map8
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.cxx7
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.hxx7
-rw-r--r--desktop/source/offacc/acceptor.cxx17
-rw-r--r--desktop/source/offacc/makefile.mk8
-rw-r--r--desktop/source/offacc/offacc.component34
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx33
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx105
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h6
-rw-r--r--desktop/source/registration/com/sun/star/registration/Registration.java4
-rw-r--r--desktop/source/registration/com/sun/star/registration/makefile.mk7
-rw-r--r--desktop/source/registration/com/sun/star/registration/productregistration.jar.component34
-rw-r--r--desktop/source/so_comp/makefile.mk7
-rw-r--r--desktop/source/so_comp/services.cxx26
-rw-r--r--desktop/source/so_comp/socomp.component37
-rw-r--r--desktop/source/splash/makefile.mk8
-rwxr-xr-xdesktop/source/splash/services_spl.cxx26
-rw-r--r--desktop/source/splash/spl.component37
-rw-r--r--desktop/test/deployment/boxt/makefile.mk6
-rw-r--r--desktop/util/ooverinfo2.rc22
-rwxr-xr-x[-rw-r--r--]desktop/util/verinfo.rc8
-rwxr-xr-x[-rw-r--r--]desktop/win32/source/applauncher/ooo/verinfo.rc4
-rwxr-xr-x[-rw-r--r--]desktop/win32/source/applauncher/verinfo.rc8
-rw-r--r--desktop/win32/source/officeloader/officeloader.cxx1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx128
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx18
-rw-r--r--drawinglayer/prj/d.lst2
-rw-r--r--drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx339
-rw-r--r--drawinglayer/source/primitive2d/makefile.mk1
-rw-r--r--drawinglayer/source/processor2d/vclhelperbitmaprender.cxx36
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx7
-rw-r--r--editeng/inc/editeng/unoipset.hxx1
-rw-r--r--editeng/source/editeng/editattr.cxx9
-rwxr-xr-xediteng/source/editeng/editview.cxx10
-rw-r--r--editeng/source/editeng/eehtml.cxx12
-rwxr-xr-xediteng/source/editeng/impedit.hxx3
-rwxr-xr-xediteng/source/editeng/impedit2.cxx12
-rwxr-xr-xediteng/source/editeng/impedit4.cxx388
-rw-r--r--editeng/source/misc/svxacorr.cxx24
-rw-r--r--editeng/source/misc/txtrange.cxx8
-rwxr-xr-x[-rw-r--r--]editeng/source/misc/unolingu.cxx3
-rw-r--r--editeng/source/uno/unoipset.cxx21
-rw-r--r--editeng/util/editeng.dxp1
-rw-r--r--embeddedobj/prj/d.lst2
-rw-r--r--embeddedobj/source/commonembedding/register.cxx42
-rw-r--r--embeddedobj/source/msole/emboleobj.component35
-rw-r--r--embeddedobj/source/msole/emboleobj.windows.component39
-rw-r--r--embeddedobj/source/msole/exports.dxp1
-rw-r--r--embeddedobj/source/msole/makefile.mk11
-rw-r--r--embeddedobj/util/embobj.component43
-rw-r--r--embeddedobj/util/exports.dxp1
-rw-r--r--embeddedobj/util/makefile.mk8
-rw-r--r--eventattacher/prj/d.lst1
-rw-r--r--eventattacher/source/eventattacher.cxx28
-rw-r--r--eventattacher/source/evtatt.component34
-rw-r--r--eventattacher/source/makefile.mk8
-rw-r--r--fileaccess/prj/d.lst1
-rw-r--r--fileaccess/source/FileAccess.cxx26
-rw-r--r--fileaccess/source/fileacc.component34
-rw-r--r--fileaccess/source/makefile.mk8
-rw-r--r--formula/inc/formula/errorcodes.hxx8
-rw-r--r--formula/prj/d.lst1
-rw-r--r--formula/source/core/api/services.cxx6
-rw-r--r--formula/util/for.component34
-rw-r--r--formula/util/makefile.mk8
-rw-r--r--fpicker/prj/d.lst10
-rw-r--r--fpicker/source/aqua/FPentry.cxx26
-rw-r--r--fpicker/source/aqua/fps-aqua-ucd.txt13
-rw-r--r--fpicker/source/aqua/fps_aqua.component37
-rw-r--r--fpicker/source/aqua/makefile.mk8
-rw-r--r--fpicker/source/generic/fpicker.component37
-rw-r--r--fpicker/source/generic/fpicker.cxx7
-rw-r--r--fpicker/source/generic/makefile.mk8
-rw-r--r--fpicker/source/office/fps_office.component37
-rw-r--r--fpicker/source/office/fps_office.cxx7
-rw-r--r--fpicker/source/office/makefile.mk8
-rw-r--r--fpicker/source/unx/gnome/FPentry.cxx26
-rw-r--r--fpicker/source/unx/gnome/SalGtkFilePicker.cxx13
-rw-r--r--fpicker/source/unx/gnome/fps-gnome-ucd.txt13
-rw-r--r--fpicker/source/unx/gnome/fps_gnome.component37
-rw-r--r--fpicker/source/unx/gnome/makefile.mk8
-rw-r--r--fpicker/source/unx/kde4/KDE4FPEntry.cxx21
-rw-r--r--fpicker/source/unx/kde4/fps-kde4-ucd.txt6
-rw-r--r--fpicker/source/unx/kde4/fps_kde4.component34
-rw-r--r--fpicker/source/unx/kde4/makefile.mk8
-rw-r--r--fpicker/source/win32/filepicker/FPentry.cxx25
-rw-r--r--fpicker/source/win32/folderpicker/Fopentry.cxx25
-rw-r--r--fpicker/util/exports.dxp1
-rw-r--r--fpicker/util/fop.component34
-rw-r--r--fpicker/util/fps.component34
-rw-r--r--fpicker/util/makefile.mk13
-rw-r--r--framework/inc/classes/framelistanalyzer.hxx25
-rw-r--r--framework/inc/macros/debug/memorymeasure.hxx2
-rw-r--r--framework/inc/macros/debug/registration.hxx21
-rw-r--r--framework/inc/macros/registration.hxx96
-rw-r--r--framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx1
-rw-r--r--framework/prj/d.lst4
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx36
-rw-r--r--framework/source/loadenv/loadenv.cxx3
-rw-r--r--framework/source/register/register3rdcomponents.cxx10
-rw-r--r--framework/source/register/registerlogindialog.cxx7
-rw-r--r--framework/source/register/registerservices.cxx64
-rw-r--r--framework/source/register/registertemp.cxx29
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx78
-rw-r--r--framework/util/fwk.component142
-rw-r--r--framework/util/fwl.component100
-rw-r--r--framework/util/fwm.component43
-rw-r--r--framework/util/makefile.mk22
-rw-r--r--idl/source/cmptools/hash.cxx4
-rw-r--r--idl/source/cmptools/lex.cxx8
-rw-r--r--idl/source/prj/database.cxx6
-rw-r--r--idl/source/prj/globals.cxx10
-rw-r--r--idl/source/prj/makefile.mk1
-rw-r--r--linguistic/prj/d.lst1
-rw-r--r--linguistic/source/convdiclist.cxx25
-rwxr-xr-xlinguistic/source/dicimp.cxx115
-rw-r--r--linguistic/source/dlistimp.cxx25
-rw-r--r--linguistic/source/gciterator.cxx24
-rw-r--r--linguistic/source/grammarchecker.cxx21
-rw-r--r--linguistic/source/lng.component46
-rw-r--r--linguistic/source/lngopt.cxx23
-rw-r--r--linguistic/source/lngreg.cxx58
-rw-r--r--linguistic/source/lngsvcmgr.cxx59
-rw-r--r--linguistic/source/lngsvcmgr.hxx2
-rw-r--r--linguistic/source/makefile.mk13
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/Office/Math.xcu5
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Paths.xcu3
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu10
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu9
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/makefile.mk2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs356
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Math.xcs23
-rwxr-xr-xofficecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs2
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs9
-rw-r--r--oovbaapi/ooo/vba/XApplicationBase.idl17
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl1
-rw-r--r--oovbaapi/ooo/vba/excel/XGlobals.idl7
-rw-r--r--oovbaapi/ooo/vba/excel/XWorksheet.idl7
-rw-r--r--oovbaapi/ooo/vba/excel/makefile.mk2
-rw-r--r--oovbaapi/ooo/vba/makefile.mk5
-rw-r--r--oovbaapi/ooo/vba/word/makefile.mk2
-rw-r--r--oovbaapi/prj/d.lst2
-rwxr-xr-xreadlicense_oo/util/makefile.pmk6
-rw-r--r--scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java5
-rw-r--r--scripting/java/ScriptFramework.component34
-rw-r--r--scripting/java/ScriptProviderForBeanShell.component37
-rw-r--r--scripting/java/ScriptProviderForJava.component37
-rw-r--r--scripting/java/ScriptProviderForJavaScript.component37
-rwxr-xr-xscripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java35
-rwxr-xr-xscripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java35
-rwxr-xr-xscripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java34
-rwxr-xr-xscripting/java/makefile.mk34
-rw-r--r--scripting/prj/d.lst12
-rw-r--r--scripting/source/basprov/basmodnode.cxx14
-rw-r--r--scripting/source/basprov/basprov.component37
-rw-r--r--scripting/source/basprov/basprov.cxx9
-rw-r--r--scripting/source/basprov/makefile.mk8
-rw-r--r--scripting/source/dlgprov/dlgprov.component36
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx32
-rw-r--r--scripting/source/dlgprov/dlgprov.hxx5
-rw-r--r--scripting/source/dlgprov/makefile.mk8
-rw-r--r--scripting/source/protocolhandler/exports.dxp1
-rw-r--r--scripting/source/protocolhandler/makefile.mk8
-rw-r--r--scripting/source/protocolhandler/protocolhandler.component34
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx21
-rwxr-xr-xscripting/source/provider/MasterScriptProvider.cxx36
-rw-r--r--scripting/source/provider/exports.dxp1
-rw-r--r--scripting/source/pyprov/mailmerge.component37
-rw-r--r--scripting/source/pyprov/mailmerge.py4
-rw-r--r--scripting/source/pyprov/makefile.mk14
-rw-r--r--scripting/source/pyprov/pythonscript.component35
-rwxr-xr-xscripting/source/runtimemgr/ScriptRuntimeManager.cxx62
-rw-r--r--scripting/source/runtimemgr/exports.dxp1
-rw-r--r--scripting/source/storage/exports.dxp1
-rw-r--r--scripting/source/stringresource/makefile.mk8
-rw-r--r--scripting/source/stringresource/stringresource.component40
-rw-r--r--scripting/source/stringresource/stringresource.cxx7
-rwxr-xr-x[-rw-r--r--]scripting/source/vbaevents/makefile.mk8
-rwxr-xr-xscripting/source/vbaevents/service.cxx10
-rw-r--r--scripting/source/vbaevents/vbaevents.component37
-rw-r--r--scripting/util/exports.dxp1
-rw-r--r--scripting/util/makefile.mk8
-rw-r--r--scripting/util/scriptframe.component49
-rw-r--r--sfx2/inc/sfx2/docfac.hxx2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx4
-rw-r--r--[-rwxr-xr-x]sfx2/inc/sfx2/objsh.hxx4
-rw-r--r--sfx2/inc/sfx2/sfxuno.hxx47
-rw-r--r--sfx2/inc/sfx2/titledockwin.hxx10
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx1
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx4
-rw-r--r--sfx2/inc/viewfac.hxx17
-rw-r--r--sfx2/prj/d.lst1
-rw-r--r--sfx2/qa/cppunit/makefile.mk7
-rw-r--r--sfx2/qa/cppunit/test_metadatable.cxx2
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/appl/appquit.cxx3
-rw-r--r--[-rwxr-xr-x]sfx2/source/appl/appuno.cxx160
-rw-r--r--sfx2/source/appl/impldde.cxx8
-rw-r--r--sfx2/source/appl/makefile.mk1
-rw-r--r--[-rwxr-xr-x]sfx2/source/dialog/dinfdlg.cxx13
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx4
-rw-r--r--[-rwxr-xr-x]sfx2/source/dialog/securitypage.cxx30
-rw-r--r--sfx2/source/dialog/taskpane.cxx9
-rw-r--r--sfx2/source/dialog/titledockwin.cxx24
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx25
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx7
-rw-r--r--sfx2/source/doc/docfac.cxx19
-rw-r--r--sfx2/source/doc/docfile.cxx47
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rw-r--r--[-rwxr-xr-x]sfx2/source/doc/objmisc.cxx2
-rw-r--r--sfx2/source/doc/objserv.cxx18
-rw-r--r--sfx2/source/doc/objstor.cxx43
-rw-r--r--[-rwxr-xr-x]sfx2/source/doc/objxtor.cxx7
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx13
-rwxr-xr-xsfx2/source/menu/mnumgr.cxx11
-rwxr-xr-xsfx2/source/menu/thessubmenu.cxx33
-rwxr-xr-x[-rw-r--r--]sfx2/source/menu/thessubmenu.hxx4
-rw-r--r--sfx2/source/view/frame2.cxx5
-rw-r--r--sfx2/source/view/frmload.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx51
-rw-r--r--sfx2/source/view/viewfac.cxx19
-rw-r--r--sfx2/source/view/viewfrm.cxx110
-rw-r--r--sfx2/source/view/viewprn.cxx8
-rw-r--r--sfx2/util/makefile.mk8
-rw-r--r--sfx2/util/sfx.component75
-rwxr-xr-xshell/inc/internal/utilities.hxx6
-rw-r--r--shell/prj/d.lst11
-rw-r--r--shell/source/backends/desktopbe/desktopbackend.cxx6
-rw-r--r--shell/source/backends/desktopbe/desktopbe1-ucd.txt6
-rw-r--r--shell/source/backends/desktopbe/desktopbe1.component34
-rw-r--r--shell/source/backends/desktopbe/makefile.mk10
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.cxx6
-rw-r--r--shell/source/backends/gconfbe/gconfbe1-ucd.txt6
-rw-r--r--shell/source/backends/gconfbe/gconfbe1.component34
-rw-r--r--shell/source/backends/gconfbe/makefile.mk11
-rw-r--r--shell/source/backends/kde4be/kde4backend.cxx6
-rw-r--r--shell/source/backends/kde4be/kde4be1-ucd.txt6
-rw-r--r--shell/source/backends/kde4be/kde4be1.component34
-rw-r--r--shell/source/backends/kde4be/makefile.mk10
-rw-r--r--shell/source/backends/kdebe/kdebackend.cxx6
-rw-r--r--shell/source/backends/kdebe/kdebe1-ucd.txt6
-rw-r--r--shell/source/backends/kdebe/kdebe1.component34
-rw-r--r--shell/source/backends/kdebe/makefile.mk10
-rw-r--r--shell/source/backends/localebe/localebe1.component34
-rw-r--r--shell/source/backends/localebe/localebecdef.cxx7
-rw-r--r--shell/source/backends/localebe/makefile.mk8
-rw-r--r--shell/source/backends/macbe/macbe1.component34
-rw-r--r--shell/source/backends/macbe/macbecdef.cxx7
-rw-r--r--shell/source/backends/macbe/makefile.mk8
-rw-r--r--shell/source/backends/wininetbe/makefile.mk8
-rw-r--r--shell/source/backends/wininetbe/wininetbe1.component34
-rw-r--r--shell/source/backends/wininetbe/wininetbecdef.cxx7
-rw-r--r--shell/source/cmdmail/cmdmail.component34
-rwxr-xr-xshell/source/cmdmail/cmdmailentry.cxx24
-rw-r--r--shell/source/cmdmail/exports.dxp1
-rw-r--r--shell/source/cmdmail/makefile.mk7
-rw-r--r--shell/source/unix/exec/makefile.mk8
-rw-r--r--shell/source/unix/exec/shellexecentry.cxx23
-rw-r--r--shell/source/unix/exec/syssh.component34
-rw-r--r--shell/source/win32/SysShentry.cxx26
-rw-r--r--shell/source/win32/exports.dxp1
-rw-r--r--shell/source/win32/makefile.mk8
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/columninfo/columninfo.cxx5
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/infotips/infotips.cxx6
-rwxr-xr-xshell/source/win32/shlxthandler/ooofilt/ooofilt.cxx3
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx4
-rwxr-xr-xshell/source/win32/shlxthandler/propsheets/propsheets.cxx99
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx3
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/util/fileextensions.cxx11
-rwxr-xr-x[-rw-r--r--]shell/source/win32/shlxthandler/util/utilities.cxx22
-rw-r--r--shell/source/win32/simplemail/exports.dxp1
-rw-r--r--shell/source/win32/simplemail/makefile.mk8
-rw-r--r--shell/source/win32/simplemail/smplmail.component34
-rw-r--r--shell/source/win32/simplemail/smplmailentry.cxx26
-rw-r--r--shell/source/win32/syssh.component34
-rw-r--r--svx/inc/svdstr.hrc1
-rw-r--r--svx/inc/svimbase.hxx4
-rwxr-xr-xsvx/inc/svx/dialogs.hrc4
-rw-r--r--svx/inc/svx/sdrmasterpagedescriptor.hxx3
-rw-r--r--svx/inc/svx/svdedtv.hxx12
-rw-r--r--svx/inc/svx/svdmodel.hxx4
-rw-r--r--svx/inc/svx/svdpage.hxx1
-rw-r--r--svx/inc/svx/xpoly.hxx4
-rw-r--r--svx/prj/d.lst3
-rw-r--r--svx/source/core/coreservices.cxx38
-rw-r--r--svx/source/dialog/checklbx.cxx9
-rwxr-xr-x[-rw-r--r--]svx/source/dialog/svxruler.cxx25
-rw-r--r--svx/source/engine3d/scene3d.cxx2
-rw-r--r--svx/source/items/svxitems.src2
-rw-r--r--svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx18
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx83
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx6
-rw-r--r--svx/source/svdraw/sdrmasterpagedescriptor.cxx23
-rw-r--r--svx/source/svdraw/svdedtv.cxx40
-rw-r--r--svx/source/svdraw/svdmrkv.cxx5
-rw-r--r--svx/source/svdraw/svdocirc.cxx2
-rw-r--r--svx/source/svdraw/svdpage.cxx12
-rw-r--r--svx/source/svdraw/svdpagv.cxx4
-rw-r--r--svx/source/svdraw/svdstr.src5
-rw-r--r--svx/source/tbxctrls/makefile.mk1
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx6
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.src (renamed from idl/source/prj/idldll.cxx)54
-rw-r--r--svx/source/unodialogs/textconversiondlgs/makefile.mk8
-rw-r--r--svx/source/unodialogs/textconversiondlgs/services.cxx7
-rw-r--r--svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component34
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx14
-rw-r--r--svx/source/unodraw/unoctabl.cxx54
-rw-r--r--svx/source/unodraw/unoshape.cxx1
-rw-r--r--svx/util/gal.dxp1
-rw-r--r--svx/util/makefile.mk14
-rw-r--r--svx/util/svx.component76
-rw-r--r--svx/util/svx.dxp1
-rw-r--r--svx/util/svxcore.component49
-rw-r--r--svx/util/svxpch.cxx2
-rw-r--r--sysui/desktop/cleanversion/makefile.mk2
-rw-r--r--sysui/util/exports.dxp1
-rw-r--r--ucb/prj/d.lst15
-rw-r--r--ucb/source/cacher/cached1.component43
-rw-r--r--ucb/source/cacher/cacheserv.cxx77
-rw-r--r--ucb/source/cacher/makefile.mk8
-rw-r--r--ucb/source/core/exports2.dxp1
-rw-r--r--ucb/source/core/makefile.mk8
-rw-r--r--ucb/source/core/ucb.cxx153
-rw-r--r--ucb/source/core/ucb.hxx6
-rw-r--r--ucb/source/core/ucb1.component46
-rw-r--r--ucb/source/core/ucbserv.cxx87
-rw-r--r--ucb/source/core/ucbstore.cxx39
-rw-r--r--ucb/source/core/ucbstore.hxx6
-rw-r--r--ucb/source/sorter/makefile.mk8
-rw-r--r--ucb/source/sorter/sortmain.cxx55
-rw-r--r--ucb/source/sorter/srtrs1.component34
-rw-r--r--ucb/source/ucp/expand/makefile.mk8
-rw-r--r--ucb/source/ucp/expand/ucpexpand.cxx8
-rw-r--r--ucb/source/ucp/expand/ucpexpand1.component34
-rw-r--r--ucb/source/ucp/ext/makefile.mk8
-rw-r--r--ucb/source/ucp/ext/ucpext.component34
-rw-r--r--ucb/source/ucp/ext/ucpext_services.cxx6
-rw-r--r--ucb/source/ucp/file/exports2.dxp1
-rw-r--r--ucb/source/ucp/file/makefile.mk8
-rw-r--r--ucb/source/ucp/file/prov.cxx54
-rw-r--r--ucb/source/ucp/file/ucpfile1.component34
-rw-r--r--ucb/source/ucp/ftp/ftpservices.cxx54
-rw-r--r--ucb/source/ucp/ftp/makefile.mk8
-rw-r--r--ucb/source/ucp/ftp/ucpftp1.component34
-rw-r--r--ucb/source/ucp/gio/gio_provider.cxx35
-rw-r--r--ucb/source/ucp/gio/makefile.mk10
-rw-r--r--ucb/source/ucp/gio/ucpgio-ucd.txt6
-rw-r--r--ucb/source/ucp/gio/ucpgio.component34
-rw-r--r--ucb/source/ucp/gvfs/gvfs_provider.cxx45
-rw-r--r--ucb/source/ucp/gvfs/makefile.mk9
-rw-r--r--ucb/source/ucp/gvfs/ucpgvfs-ucd.txt6
-rw-r--r--ucb/source/ucp/gvfs/ucpgvfs.component34
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyservices.cxx63
-rw-r--r--ucb/source/ucp/hierarchy/makefile.mk8
-rw-r--r--ucb/source/ucp/hierarchy/ucphier1.component38
-rw-r--r--ucb/source/ucp/odma/odma_lib.cxx4
-rw-r--r--ucb/source/ucp/odma/odma_services.cxx39
-rw-r--r--ucb/source/ucp/package/makefile.mk9
-rw-r--r--ucb/source/ucp/package/pkgservices.cxx59
-rw-r--r--ucb/source/ucp/package/pkguri.cxx36
-rw-r--r--ucb/source/ucp/package/ucppkg1.component34
-rw-r--r--ucb/source/ucp/tdoc/makefile.mk8
-rw-r--r--ucb/source/ucp/tdoc/tdoc_services.cxx62
-rw-r--r--ucb/source/ucp/tdoc/ucptdoc1.component37
-rw-r--r--ucb/source/ucp/webdav/makefile.mk8
-rw-r--r--ucb/source/ucp/webdav/ucpdav1.component34
-rw-r--r--ucb/source/ucp/webdav/webdavservices.cxx54
-rw-r--r--uui/prj/d.lst1
-rw-r--r--[-rwxr-xr-x]uui/source/iahndl-authentication.cxx49
-rwxr-xr-x[-rw-r--r--]uui/source/iahndl.cxx73
-rwxr-xr-xuui/source/iahndl.hxx3
-rwxr-xr-xuui/source/ids.hrc11
-rwxr-xr-xuui/source/logindlg.src12
-rwxr-xr-x[-rw-r--r--]uui/source/makefile.mk4
-rwxr-xr-x[-rw-r--r--]uui/source/masterpasscrtdlg.cxx2
-rwxr-xr-x[-rw-r--r--]uui/source/masterpasscrtdlg.src2
-rwxr-xr-xuui/source/nameclashdlg.cxx107
-rwxr-xr-x[-rw-r--r--]uui/source/nameclashdlg.hrc (renamed from uui/source/passcrtdlg.hrc)26
-rwxr-xr-x[-rw-r--r--]uui/source/nameclashdlg.hxx (renamed from uui/source/passcrtdlg.hxx)56
-rwxr-xr-xuui/source/nameclashdlg.src113
-rw-r--r--uui/source/passcrtdlg.cxx128
-rw-r--r--uui/source/passcrtdlg.src108
-rwxr-xr-xuui/source/passworddlg.cxx126
-rwxr-xr-x[-rw-r--r--]uui/source/passworddlg.hrc18
-rwxr-xr-xuui/source/passworddlg.hxx10
-rwxr-xr-xuui/source/passworddlg.src76
-rwxr-xr-xuui/source/passworderrs.src7
-rw-r--r--uui/source/services.cxx80
-rw-r--r--uui/util/makefile.mk8
-rw-r--r--uui/util/uui.component44
-rw-r--r--vbahelper/inc/vbahelper/vbaapplicationbase.hxx21
-rw-r--r--vbahelper/inc/vbahelper/vbacollectionimpl.hxx3
-rw-r--r--vbahelper/inc/vbahelper/vbadocumentbase.hxx4
-rwxr-xr-xvbahelper/inc/vbahelper/vbaeventshelperbase.hxx162
-rw-r--r--vbahelper/inc/vbahelper/vbaglobalbase.hxx6
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx8
-rw-r--r--vbahelper/inc/vbahelper/vbahelperinterface.hxx30
-rw-r--r--vbahelper/prj/d.lst2
-rw-r--r--vbahelper/source/msforms/service.cxx10
-rw-r--r--vbahelper/source/msforms/vbacontrols.cxx33
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx51
-rw-r--r--vbahelper/source/vbahelper/makefile.mk2
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx111
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx53
-rwxr-xr-xvbahelper/source/vbahelper/vbaeventshelperbase.cxx218
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx59
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx46
-rw-r--r--vbahelper/util/makefile.mk8
-rw-r--r--vbahelper/util/msforms.component37
-rw-r--r--xmlhelp/prj/d.lst5
-rwxr-xr-xxmlhelp/source/com/sun/star/help/HelpComponent.java25
-rw-r--r--xmlhelp/source/com/sun/star/help/HelpSearch.java19
-rw-r--r--xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component37
-rw-r--r--xmlhelp/source/com/sun/star/help/makefile.mk8
-rw-r--r--xmlhelp/source/cxxhelp/provider/services.cxx55
-rw-r--r--xmlhelp/source/treeview/makefile.mk8
-rw-r--r--xmlhelp/source/treeview/tvfactory.cxx57
-rw-r--r--xmlhelp/source/treeview/tvhlp1.component35
-rw-r--r--xmlhelp/util/delzip0
-rw-r--r--xmlhelp/util/embed.xsl83
-rw-r--r--xmlhelp/util/idxcaption.xsl34
-rw-r--r--xmlhelp/util/idxcontent.xsl104
-rw-r--r--xmlhelp/util/main_transform.xsl972
-rw-r--r--xmlhelp/util/makefile.mk14
-rw-r--r--xmlhelp/util/ucpchelp1.component35
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx6
-rw-r--r--xmloff/prj/d.lst2
-rw-r--r--xmloff/source/chart/PropertyMap.hxx2
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx42
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx70
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx23
-rw-r--r--xmloff/source/chart/SchXMLTools.hxx2
-rw-r--r--xmloff/source/core/facreg.cxx111
-rw-r--r--xmloff/source/core/xmltoken.cxx10
-rw-r--r--xmloff/source/draw/ximpcustomshape.cxx4
-rw-r--r--xmloff/source/transform/XMLFilterRegistration.cxx33
-rw-r--r--xmloff/source/transform/makefile.mk8
-rw-r--r--xmloff/source/transform/xof.component118
-rw-r--r--xmloff/util/makefile.mk8
-rw-r--r--xmloff/util/xo.component178
-rw-r--r--xmlscript/prj/d.lst1
-rw-r--r--xmlscript/source/misc/unoservices.cxx9
-rw-r--r--xmlscript/util/makefile.mk8
-rw-r--r--xmlscript/util/xcr.component46
710 files changed, 16129 insertions, 8962 deletions
diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst
index 1ef04ca0f7..6651d9d74f 100644
--- a/avmedia/prj/build.lst
+++ b/avmedia/prj/build.lst
@@ -6,6 +6,6 @@ av avmedia\source\viewer nmake - all av_viewer NULL
av avmedia\source\framework nmake - all av_framework NULL
av avmedia\source\win nmake - all av_win NULL
av avmedia\source\java nmake - all av_java NULL
-av avmedia\source\xine nmake - all av_xine NULL
av avmedia\source\quicktime nmake - all av_quicktime NULL
-av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_xine NULL
+av avmedia\source\gstreamer nmake - all av_gstreamer NULL
+av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_gstreamer NULL
diff --git a/avmedia/prj/d.lst b/avmedia/prj/d.lst
index c82db252aa..eb140ed457 100644
--- a/avmedia/prj/d.lst
+++ b/avmedia/prj/d.lst
@@ -16,3 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\avmedia
..\inc\avmedia\mediatoolbox.hxx %_DEST%\inc%_EXT%\avmedia\mediatoolbox.hxx
..\%__SRC%\class\avmedia.jar %_DEST%\bin%_EXT%\avmedia.jar
+..\%__SRC%\misc\avmedia.component %_DEST%\xml%_EXT%\avmedia.component
+..\%__SRC%\misc\avmedia.jar.component %_DEST%\xml%_EXT%\avmedia.jar.component
+..\%__SRC%\misc\avmediaQuickTime.component %_DEST%\xml%_EXT%\avmediaQuickTime.component
+..\%__SRC%\misc\avmediagst.component %_DEST%\xml%_EXT%\avmediagst.component
+..\%__SRC%\misc\avmediawin.component %_DEST%\xml%_EXT%\avmediawin.component
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 178ee237ee..a251846e67 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -91,8 +91,6 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) :
if( MEDIACONTROLSTYLE_SINGLELINE != meControlStyle )
{
-
-
maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, implGetImage( AVMEDIA_IMG_OPEN ), String( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) );
maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN );
@@ -103,8 +101,6 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) :
}
else
{
- maTimeSlider.SetBackground();
- maVolumeSlider.SetBackground();
mpZoomListBox->SetBackground();
maZoomToolBox.SetBackground();
diff --git a/avmedia/source/framework/soundhandler.cxx b/avmedia/source/framework/soundhandler.cxx
index 1e2a1f9f16..784e023e19 100644
--- a/avmedia/source/framework/soundhandler.cxx
+++ b/avmedia/source/framework/soundhandler.cxx
@@ -497,44 +497,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// -----------------------
-// - component_writeInfo -
-// -----------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- rtl::OUString sKeyName = DECLARE_ASCII( "/" );
- sKeyName += avmedia::SoundHandler::impl_getStaticImplementationName();
- sKeyName += DECLARE_ASCII( "/UNO/SERVICES" );
- css::uno::Reference< css::registry::XRegistryKey > xNewKey(
- static_cast< css::registry::XRegistryKey* >( pRegistryKey )->createKey(sKeyName));
-
- if ( xNewKey.is() == sal_True )
- {
- css::uno::Sequence< ::rtl::OUString > seqServiceNames = avmedia::SoundHandler::impl_getStaticSupportedServiceNames();
- const ::rtl::OUString* pArray = seqServiceNames.getArray();
- sal_Int32 nLength = seqServiceNames.getLength();
- for ( sal_Int32 nCounter = 0; nCounter < nLength; ++nCounter )
- xNewKey->createKey( pArray[nCounter] );
- }
-
- bRet = sal_True;
- }
- catch( css::registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return bRet;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
diff --git a/avmedia/source/gstreamer/avmediagst.component b/avmedia/source/gstreamer/avmediagst.component
new file mode 100644
index 0000000000..75d39d275f
--- /dev/null
+++ b/avmedia/source/gstreamer/avmediagst.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.avmedia.Manager_GStreamer">
+ <service name="com.sun.star.media.Manager_GStreamer"/>
+ </implementation>
+</component>
diff --git a/avmedia/source/gstreamer/exports.dxp b/avmedia/source/gstreamer/exports.dxp
new file mode 100644
index 0000000000..f0e1c69934
--- /dev/null
+++ b/avmedia/source/gstreamer/exports.dxp
@@ -0,0 +1,2 @@
+component_getImplementationEnvironment
+component_getFactory
diff --git a/avmedia/source/gstreamer/gstcommon.hxx b/avmedia/source/gstreamer/gstcommon.hxx
new file mode 100644
index 0000000000..83bb818aef
--- /dev/null
+++ b/avmedia/source/gstreamer/gstcommon.hxx
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GSTCOMMON_HXX
+#define _GSTCOMMON_HXX
+
+#include <osl/mutex.hxx>
+#include <rtl/ustring.hxx>
+#include <tools/debug.hxx>
+#include <tools/stream.hxx>
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/factory.hxx>
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/awt/MouseButton.hpp>
+#include <com/sun/star/media/XManager.hpp>
+
+#include <memory>
+
+#define AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_GStreamer"
+#define AVMEDIA_GSTREAMER_MANAGER_SERVICENAME "com.sun.star.media.Manager_GStreamer"
+
+#define AVMEDIA_GSTREAMER_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer"
+#define AVMEDIA_GSTREAMER_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer"
+
+#define AVMEDIA_GSTREAMER_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_GStreamer"
+#define AVMEDIA_GSTREAMER_WINDOW_SERVICENAME "com.sun.star.media.Window_GStreamer"
+
+#define AVMEDIA_GSTREAMER_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_GStreamer"
+#define AVMEDIA_GSTREAMER_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_GStreamer"
+
+#endif // _GSTCOMMOM_HXX
diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx
new file mode 100644
index 0000000000..13f0c5c4e7
--- /dev/null
+++ b/avmedia/source/gstreamer/gstframegrabber.cxx
@@ -0,0 +1,307 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "gstframegrabber.hxx"
+#include "gstplayer.hxx"
+
+#include <vcl/graph.hxx>
+#include <vcl/bmpacc.hxx>
+
+using namespace ::com::sun::star;
+
+namespace avmedia { namespace gst {
+
+const gulong GRAB_TIMEOUT = 10000000;
+
+// ----------------
+// - FrameGrabber -
+// ----------------
+
+FrameGrabber::FrameGrabber( GString* pURI ) :
+ Player( pURI ),
+ mpFrameMutex( g_mutex_new() ),
+ mpFrameCond( g_cond_new() ),
+ mpLastPixbuf( NULL ),
+ mbIsInGrabMode( false )
+{
+}
+
+// ------------------------------------------------------------------------------
+
+FrameGrabber::~FrameGrabber()
+{
+ if( g_atomic_pointer_get( &mpPlayer ) )
+ {
+ implQuitThread();
+ }
+
+ // thread has ended, so that no more synchronization is necessary
+ if( mpLastPixbuf )
+ {
+ g_object_unref( mpLastPixbuf );
+ mpLastPixbuf = NULL;
+ }
+
+ g_cond_free( mpFrameCond );
+ g_mutex_free( mpFrameMutex );
+}
+
+// ------------------------------------------------------------------------------
+
+FrameGrabber* FrameGrabber::create( const GString* pURI )
+{
+ FrameGrabber* pFrameGrabber = NULL;
+
+ if( pURI && pURI->len )
+ {
+ // safely initialize GLib threading framework
+ try
+ {
+ if( !g_thread_supported() )
+ {
+ g_thread_init( NULL );
+ }
+ }
+ catch( ... )
+ {}
+
+ if( g_thread_supported() )
+ {
+ pFrameGrabber = new FrameGrabber( g_string_new( pURI->str ) );
+
+ // wait until thread signals that it has finished initialization
+ if( pFrameGrabber->mpThread )
+ {
+ g_mutex_lock( pFrameGrabber->mpMutex );
+
+ while( !pFrameGrabber->implIsInitialized() )
+ {
+ g_cond_wait( pFrameGrabber->mpCond, pFrameGrabber->mpMutex );
+ }
+
+ g_mutex_unlock( pFrameGrabber->mpMutex );
+ }
+
+ GstElement* pPixbufSink = gst_element_factory_make( "gdkpixbufsink", NULL );
+
+ // check if player pipeline and GdkPixbufSink could be initialized
+ if( !pFrameGrabber->mpPlayer || !pPixbufSink )
+ {
+ delete pFrameGrabber;
+ pFrameGrabber = NULL;
+ }
+ else
+ {
+ g_object_set( pFrameGrabber->mpPlayer, "audio-sink", gst_element_factory_make( "fakesink", NULL ), NULL );
+ g_object_set( pFrameGrabber->mpPlayer, "video-sink", pPixbufSink, NULL );
+ }
+ }
+ }
+
+ return( pFrameGrabber );
+}
+
+// ------------------------------------------------------------------------------
+
+gboolean FrameGrabber::busCallback( GstBus* pBus, GstMessage* pMsg )
+{
+ bool bDone = false;
+
+ if( pMsg && pMsg->structure )
+ {
+ GstStructure* pStruct = pMsg->structure;
+ const gchar* pStructName = gst_structure_get_name( pStruct );
+
+ if( ( ::std::string( pStructName ).find( "pixbuf" ) != ::std::string::npos ) &&
+ gst_structure_has_field ( pStruct, "pixbuf") )
+ {
+ bool bFrameGrabbed = false;
+
+ g_mutex_lock( mpFrameMutex );
+
+ if( mbIsInGrabMode && ( getMediaTime() >= mfGrabTime ) )
+ {
+ OSL_TRACE( "Grabbing frame at %fs", getMediaTime() );
+
+ if( mpLastPixbuf )
+ {
+ g_object_unref( mpLastPixbuf );
+ mpLastPixbuf = NULL;
+ }
+
+ mpLastPixbuf = GDK_PIXBUF( g_value_dup_object( gst_structure_get_value( pStruct, "pixbuf" ) ) );
+ bFrameGrabbed = true;
+ }
+
+ g_mutex_unlock( mpFrameMutex );
+
+ if( bFrameGrabbed )
+ {
+ g_cond_signal( mpFrameCond );
+ }
+
+ bDone = true;
+ }
+ }
+
+ return( bDone || Player::busCallback( pBus, pMsg ) );
+}
+
+// ------------------------------------------------------------------------------
+
+uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMediaTime )
+ throw (uno::RuntimeException)
+{
+ uno::Reference< graphic::XGraphic > xRet;
+
+ if( implInitPlayer() )
+ {
+ OSL_TRACE( "Trying to grab frame at %fs", fMediaTime );
+
+ GTimeVal aTimeoutTime;
+
+ g_get_current_time( &aTimeoutTime );
+ g_time_val_add( &aTimeoutTime, GRAB_TIMEOUT );
+ setMediaTime( fMediaTime );
+ start();
+
+ if( isPlaying() )
+ {
+ g_mutex_lock( mpFrameMutex );
+
+ mbIsInGrabMode = true;
+ mfGrabTime = fMediaTime;
+ g_cond_timed_wait( mpFrameCond, mpFrameMutex, &aTimeoutTime );
+ mbIsInGrabMode = false;
+
+ g_mutex_unlock( mpFrameMutex );
+
+ stop();
+ }
+
+ OSL_ENSURE( g_atomic_pointer_get( &mpLastPixbuf ), "FrameGrabber timed out without receiving a Pixbuf" );
+
+ if( g_atomic_pointer_get( &mpLastPixbuf ) )
+ {
+ OSL_TRACE( "FrameGrabber received a GdkPixbuf");
+
+ g_mutex_lock( mpFrameMutex );
+
+ const int nWidth = gdk_pixbuf_get_width( mpLastPixbuf );
+ const int nHeight = gdk_pixbuf_get_height( mpLastPixbuf );
+ const int nChannels = gdk_pixbuf_get_n_channels( mpLastPixbuf );
+ const guchar* pBuffer = gdk_pixbuf_get_pixels( mpLastPixbuf );
+
+ if( pBuffer && ( nWidth > 0 ) && ( nHeight > 0 ) )
+ {
+ Bitmap aFrame( Size( nWidth, nHeight), 24 );
+ bool bInit = false;
+
+ if( ( gdk_pixbuf_get_colorspace( mpLastPixbuf ) == GDK_COLORSPACE_RGB ) &&
+ ( nChannels >= 3 ) && ( nChannels <= 4 ) &&
+ ( gdk_pixbuf_get_bits_per_sample( mpLastPixbuf ) == 8 ) )
+ {
+ BitmapWriteAccess* pAcc = aFrame.AcquireWriteAccess();
+
+ if( pAcc )
+ {
+ BitmapColor aPixel( 0, 0, 0 );
+ const int nRowStride = gdk_pixbuf_get_rowstride( mpLastPixbuf );
+ const bool bAlpha = ( nChannels == 4 );
+
+ for( int nRow = 0; nRow < nHeight; ++nRow )
+ {
+ guchar* pCur = const_cast< guchar* >( pBuffer + nRow * nRowStride );
+
+ for( int nCol = 0; nCol < nWidth; ++nCol )
+ {
+ aPixel.SetRed( *pCur++ );
+ aPixel.SetGreen( *pCur++ );
+ aPixel.SetBlue( *pCur++ );
+
+ // ignore alpha channel
+ if( bAlpha )
+ {
+ ++pCur;
+ }
+
+ pAcc->SetPixel( nRow, nCol, aPixel );
+ }
+ }
+
+ aFrame.ReleaseAccess( pAcc );
+ bInit = true;
+ }
+ }
+
+ if( !bInit )
+ {
+ aFrame.Erase( Color( COL_BLACK ) );
+ }
+
+ xRet = Graphic( aFrame ).GetXGraphic();
+ }
+
+ g_object_unref( mpLastPixbuf );
+ mpLastPixbuf = NULL;
+
+ g_mutex_unlock( mpFrameMutex );
+ }
+ }
+
+ return xRet;
+}
+
+// ------------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL FrameGrabber::getImplementationName( )
+ throw (uno::RuntimeException)
+{
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_FRAMEGRABBER_IMPLEMENTATIONNAME ) );
+}
+
+// ------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL FrameGrabber::supportsService( const ::rtl::OUString& ServiceName )
+ throw (uno::RuntimeException)
+{
+ return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GSTREAMER_FRAMEGRABBER_SERVICENAME ) );
+}
+
+// ------------------------------------------------------------------------------
+
+uno::Sequence< ::rtl::OUString > SAL_CALL FrameGrabber::getSupportedServiceNames( )
+ throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aRet(1);
+ aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GSTREAMER_FRAMEGRABBER_SERVICENAME ) );
+
+ return aRet;
+}
+
+} // namespace win
+} // namespace avmedia
diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx
new file mode 100644
index 0000000000..a074cd8be6
--- /dev/null
+++ b/avmedia/source/gstreamer/gstframegrabber.hxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _FRAMEGRABBER_HXX
+#define _FRAMEGRABBER_HXX
+
+#include "gstplayer.hxx"
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+#ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_
+#include "com/sun/star/media/XFrameGrabber.hdl"
+#endif
+
+namespace avmedia { namespace gst {
+
+// ----------------
+// - FrameGrabber -
+// ----------------
+
+class FrameGrabber : public Player,
+ public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XFrameGrabber,
+ ::com::sun::star::lang::XServiceInfo >
+{
+public:
+
+ // static create method instead of public Ctor
+ static FrameGrabber* create( const GString* pUri );
+
+ ~FrameGrabber();
+
+ // XFrameGrabber
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ 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);
+
+protected: FrameGrabber( GString* pURI = NULL );
+
+ virtual gboolean busCallback( GstBus* pBus,
+ GstMessage* pMsg );
+
+private: FrameGrabber( const FrameGrabber& );
+ FrameGrabber& operator=( const FrameGrabber& );
+
+ GMutex* mpFrameMutex;
+ GCond* mpFrameCond;
+ GdkPixbuf* mpLastPixbuf;
+ double mfGrabTime;
+ bool mbIsInGrabMode;
+};
+
+} // namespace gst
+} // namespace avmedia
+
+#endif // _FRAMEGRABBER_HXX
diff --git a/avmedia/source/gstreamer/gstmanager.cxx b/avmedia/source/gstreamer/gstmanager.cxx
new file mode 100644
index 0000000000..61ee4ce22c
--- /dev/null
+++ b/avmedia/source/gstreamer/gstmanager.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "gstmanager.hxx"
+#include "gstplayer.hxx"
+
+using namespace ::com::sun::star;
+
+namespace avmedia
+{
+namespace gst
+{
+// ----------------
+// - Manager -
+// ----------------
+
+Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
+ mxMgr( rxMgr )
+{}
+
+// ------------------------------------------------------------------------------
+
+Manager::~Manager()
+{}
+
+// ------------------------------------------------------------------------------
+
+uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& rURL )
+ throw( uno::RuntimeException )
+{
+ return( ::avmedia::gst::Player::create( rURL ) );
+}
+
+// ------------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL Manager::getImplementationName()
+ throw( uno::RuntimeException )
+{
+ return( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ) ) );
+}
+
+// ------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName )
+ throw( uno::RuntimeException )
+{
+ return( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ) );
+}
+
+// ------------------------------------------------------------------------------
+
+uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString > aRet( 1 );
+ aRet[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) );
+
+ return( aRet );
+}
+} // namespace gst
+} // namespace avmedia
diff --git a/avmedia/source/gstreamer/gstmanager.hxx b/avmedia/source/gstreamer/gstmanager.hxx
new file mode 100644
index 0000000000..9f80e8c1a9
--- /dev/null
+++ b/avmedia/source/gstreamer/gstmanager.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GSTMANAGER_HXX
+#define _GSTMANAGER_HXX
+
+#include "gstcommon.hxx"
+
+#ifndef _COM_SUN_STAR_MEDIA_XMANAGER_HDL_
+#include "com/sun/star/media/XManager.hdl"
+#endif
+
+// -----------
+// - Manager -
+// -----------
+
+namespace avmedia
+{
+namespace gst
+{
+class Manager : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XManager,
+ ::com::sun::star::lang::XServiceInfo >
+{
+public: Manager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr );
+ ~Manager();
+
+ // XManager
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > SAL_CALL createPlayer(
+ const ::rtl::OUString& aURL )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ 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 );
+
+
+private:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
+};
+} // namespace gst
+} // namespace avmedia
+
+#endif // _GSTMANAGER_HXX
diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx
new file mode 100644
index 0000000000..f082cfc5c5
--- /dev/null
+++ b/avmedia/source/gstreamer/gstplayer.cxx
@@ -0,0 +1,938 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "gstplayer.hxx"
+#include "gstwindow.hxx"
+#include "gstframegrabber.hxx"
+#include <stdio.h>
+#include <unistd.h>
+#include <math.h>
+#include <string>
+#include <gst/gstelement.h>
+#include <gst/interfaces/xoverlay.h>
+
+
+// maximum timeout time in nanoseconds
+#define GST_MAX_TIMEOUT (2500 * GST_MSECOND)
+
+using namespace ::com::sun::star;
+
+namespace avmedia
+{
+namespace gst
+{
+const double NANO_TIME_FACTOR = 1000000000.0;
+
+const long VIDEO_DEFAULT_WIDTH = 256;
+const long VIDEO_DEFAULT_HEIGHT = 192;
+
+// ----------------
+// - GstBusSource -
+// ----------------
+
+struct GstBusSource : public GSource
+{
+ GstBus* mpBus;
+
+ GstBusSource() :
+ mpBus( NULL )
+ {}
+
+ ~GstBusSource()
+ {}
+};
+
+// ---------------
+// - Player -
+// ---------------
+Player::Player( GString* pURI ) :
+ mpMutex( g_mutex_new() ),
+ mpCond( g_cond_new() ),
+ mpThread( NULL ),
+ mpContext( NULL ),
+ mpLoop( NULL ),
+ mpPlayer( NULL ),
+ mpURI( pURI ),
+ mpPlayerWindow( NULL ),
+ mnIsVideoSource( 0 ),
+ mnVideoWidth( 0 ),
+ mnVideoHeight( 0 ),
+ mnInitialized( 0 ),
+ mnVolumeDB( 0 ),
+ mnLooping( 0 ),
+ mnQuit( 0 ),
+ mnVideoWindowSet( 0 ),
+ mnInitFail( 0 )
+{
+ // initialize GStreamer framework only once
+ static bool bGstInitialized = false;
+
+ if( !bGstInitialized )
+ {
+ gst_init( NULL, NULL );
+ bGstInitialized = true;
+ }
+
+ if( pURI )
+ {
+ OSL_TRACE( ">>> --------------------------------" );
+ OSL_TRACE( ">>> Creating Player object with URL: %s", pURI->str );
+
+ mpThread = g_thread_create( Player::implThreadFunc, this, true, NULL );
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+Player::~Player()
+{
+ if( g_atomic_pointer_get( &mpPlayer ) )
+ {
+ implQuitThread();
+ }
+
+ // cleanup
+ g_cond_free( mpCond );
+ g_mutex_free( mpMutex );
+ g_string_free( mpURI, false );
+}
+
+// ------------------------------------------------------------------------------
+Player* Player::create( const ::rtl::OUString& rURL )
+{
+ Player* pPlayer = NULL;
+
+ if( rURL.getLength() )
+ {
+ // safely initialize GLib threading framework
+ try
+ {
+ if( !g_thread_supported() )
+ {
+ g_thread_init( NULL );
+ }
+ }
+ catch( ... )
+ {}
+
+ if( g_thread_supported() )
+ {
+ const INetURLObject aURL( rURL );
+
+ if( aURL.GetProtocol() != INET_PROT_NOT_VALID )
+ {
+ GString* pURI = g_string_new( ::rtl::OUStringToOString(
+ aURL.GetMainURL( INetURLObject::NO_DECODE ),
+ RTL_TEXTENCODING_UTF8 ).getStr() );
+
+ if( pURI->len )
+ {
+ pPlayer = new Player( pURI );
+
+ // wait until thread signals that it has finished initialization
+ if( pPlayer->mpThread )
+ {
+ g_mutex_lock( pPlayer->mpMutex );
+
+ while( !pPlayer->implIsInitialized() )
+ {
+ g_cond_wait( pPlayer->mpCond, pPlayer->mpMutex );
+ }
+
+ g_mutex_unlock( pPlayer->mpMutex );
+ }
+
+ // check if player pipeline could be initialized
+ if( !pPlayer->mpPlayer )
+ {
+ delete pPlayer;
+ pPlayer = NULL;
+ }
+ }
+ else
+ {
+ g_string_free( pURI, false );
+ }
+ }
+ }
+ }
+
+ return( pPlayer );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::start()
+ throw( uno::RuntimeException )
+{
+ if( implInitPlayer() && !isPlaying() )
+ {
+ gst_element_set_state( mpPlayer, GST_STATE_PLAYING );
+ }
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::stop()
+ throw( uno::RuntimeException )
+{
+ if( implInitPlayer() && isPlaying() )
+ {
+ gst_element_set_state( mpPlayer, GST_STATE_PAUSED );
+ }
+}
+
+// ------------------------------------------------------------------------------
+sal_Bool SAL_CALL Player::isPlaying()
+ throw( uno::RuntimeException )
+{
+ GstState aState = GST_STATE_NULL;
+
+ if( mpPlayer )
+ {
+ gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT );
+ }
+
+ return( GST_STATE_PLAYING == aState );
+}
+
+// ------------------------------------------------------------------------------
+double SAL_CALL Player::getDuration()
+ throw( uno::RuntimeException )
+{
+ gint64 nDuration = 0;
+
+ if( implInitPlayer() )
+ {
+ GstFormat aFormat = GST_FORMAT_TIME;
+
+ if( !gst_element_query_duration( mpPlayer, &aFormat, &nDuration ) ||
+ ( GST_FORMAT_TIME != aFormat ) ||
+ ( nDuration < 0 ) )
+ {
+ nDuration = 0;
+ }
+ }
+
+ return( static_cast< double >( nDuration ) / NANO_TIME_FACTOR );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::setMediaTime( double fTime )
+ throw( uno::RuntimeException )
+{
+ if( implInitPlayer() )
+ {
+ fTime = ::std::min( ::std::max( fTime, 0.0 ), getDuration() );
+
+ gst_element_seek_simple( mpPlayer, GST_FORMAT_TIME,
+ (GstSeekFlags) ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT ),
+ static_cast< gint64 >( fTime * NANO_TIME_FACTOR ) );
+ }
+}
+
+// ------------------------------------------------------------------------------
+double SAL_CALL Player::getMediaTime()
+ throw( uno::RuntimeException )
+{
+ double fRet = 0.0;
+
+ if( implInitPlayer() )
+ {
+ GstFormat aFormat = GST_FORMAT_TIME;
+ gint64 nCurTime = 0;
+
+ if( gst_element_query_position( mpPlayer, &aFormat, &nCurTime ) &&
+ ( GST_FORMAT_TIME == aFormat ) &&
+ ( nCurTime >= 0 ) )
+ {
+ fRet = static_cast< double >( nCurTime ) / NANO_TIME_FACTOR;
+ }
+ }
+
+ return( fRet );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::setStopTime( double /* fTime */ )
+ throw( uno::RuntimeException )
+{
+ OSL_TRACE( "GStreamer method avmedia::gst::Player::setStopTime needs to be implemented" );
+
+ /* Currently no need for implementation since higher levels of code don't use this method at all
+ !!! TODO: needs to be implemented if this functionality is needed at a later point of time
+ if( implInitPlayer() )
+ {
+ }
+
+ */
+}
+
+// ------------------------------------------------------------------------------
+double SAL_CALL Player::getStopTime()
+ throw( uno::RuntimeException )
+{
+ /*
+ Currently no need for implementation since higher levels of code don't set a stop time ATM
+ !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time
+ */
+
+ return( getDuration() );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::setRate( double /* fRate */ )
+ throw( uno::RuntimeException )
+{
+ OSL_TRACE( "GStreamer method avmedia::gst::Player::setRate needs to be implemented" );
+
+ /* Currently no need for implementation since higher levels of code don't use this method at all
+ !!! TODO: needs to be implemented if this functionality is needed at a later point of time
+ */
+}
+
+// ------------------------------------------------------------------------------
+double SAL_CALL Player::getRate()
+ throw( uno::RuntimeException )
+{
+ /*
+ Currently no need for implementation since higher levels of code don't set a different rate than 1 ATM
+ !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time
+ */
+
+ return( 1.0 );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet )
+ throw( uno::RuntimeException )
+{
+ if( bSet && !isPlaybackLoop() )
+ g_atomic_int_inc( &mnLooping );
+ else if( !bSet && isPlaybackLoop() )
+ g_atomic_int_dec_and_test( &mnLooping );
+}
+
+// ------------------------------------------------------------------------------
+sal_Bool SAL_CALL Player::isPlaybackLoop()
+ throw( uno::RuntimeException )
+{
+ return( g_atomic_int_get( &mnLooping ) > 0 );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::setMute( sal_Bool bSet )
+ throw( uno::RuntimeException )
+{
+ if( implInitPlayer() && ( bSet != isMute() ) )
+ {
+ if( bSet )
+ {
+ g_object_set( mpPlayer, "volume", 0.0, NULL );
+ }
+ else
+ {
+ setVolumeDB( mnVolumeDB );
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------
+sal_Bool SAL_CALL Player::isMute()
+ throw( uno::RuntimeException )
+{
+ gdouble fGstVolume = 1.0;
+
+ if( implInitPlayer() )
+ {
+ g_object_get( mpPlayer, "volume", &fGstVolume, NULL );
+ }
+
+ return( 0.0 == fGstVolume );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB )
+ throw( uno::RuntimeException )
+{
+ if( implInitPlayer() )
+ {
+ g_mutex_lock( mpMutex );
+ mnVolumeDB = nVolumeDB;
+ g_mutex_unlock( mpMutex );
+
+ // maximum gain for gstreamer volume is 10
+ double fGstVolume = pow( 10.0, static_cast< double >( ::std::min(
+ nVolumeDB, static_cast< sal_Int16 >( 20 ) ) / 20.0 ) );
+
+ g_object_set( mpPlayer, "volume", fGstVolume, NULL );
+ }
+}
+
+// ------------------------------------------------------------------------------
+sal_Int16 SAL_CALL Player::getVolumeDB()
+ throw( uno::RuntimeException )
+{
+ return( static_cast< sal_Int16 >( g_atomic_int_get( &mnVolumeDB ) ) );
+}
+
+// ------------------------------------------------------------------------------
+awt::Size SAL_CALL Player::getPreferredPlayerWindowSize()
+ throw( uno::RuntimeException )
+{
+ awt::Size aSize( 0, 0 );
+
+ if( implInitPlayer() && ( g_atomic_int_get( &mnIsVideoSource ) > 0 ) )
+ {
+ aSize.Width = g_atomic_int_get( &mnVideoWidth );
+ aSize.Height = g_atomic_int_get( &mnVideoHeight );
+
+ // if we have a video source, but no size is given => use default size
+ if( ( aSize.Width <= 0 ) || ( aSize.Height <= 0 ) )
+ {
+ aSize.Width = VIDEO_DEFAULT_WIDTH;
+ aSize.Height = VIDEO_DEFAULT_HEIGHT;
+ }
+ }
+
+ OSL_TRACE( ">>> Requested preferred video size is: %d x %d pixel", aSize.Width, aSize.Height );
+
+ return( aSize );
+}
+
+// ------------------------------------------------------------------------------
+uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow(
+ const uno::Sequence< uno::Any >& rArguments )
+ throw( uno::RuntimeException )
+{
+ uno::Reference< ::media::XPlayerWindow > xRet;
+ awt::Size aSize( getPreferredPlayerWindowSize() );
+
+ OSL_ENSURE( !g_atomic_pointer_get( &mpPlayerWindow ), "::avmedia::gst::Player already has a player window" );
+
+ if( ( aSize.Width > 0 ) && ( aSize.Height > 0 ) )
+ {
+ Window* pPlayerWindow = new Window( *this );
+
+ xRet = pPlayerWindow;
+
+ if( !pPlayerWindow->create( rArguments ) )
+ {
+ xRet.clear();
+ }
+ else
+ {
+ // try to use gconf user configurable video sink first
+ GstElement* pVideoSink = gst_element_factory_make( "gconfvideosink", NULL );
+
+ if( ( NULL != pVideoSink ) ||
+ ( NULL != ( pVideoSink = gst_element_factory_make( "autovideosink", NULL ) ) ) ||
+ ( NULL != ( pVideoSink = gst_element_factory_make( "xvimagesink", NULL ) ) ) ||
+ ( NULL != ( pVideoSink = gst_element_factory_make( "ximagesink", NULL ) ) ) )
+ {
+ GstState aOldState = GST_STATE_NULL;
+
+ mpPlayerWindow = pPlayerWindow;
+ gst_element_get_state( mpPlayer, &aOldState, NULL, GST_MAX_TIMEOUT );
+ gst_element_set_state( mpPlayer, GST_STATE_READY );
+ g_object_set( mpPlayer, "video-sink", pVideoSink, NULL );
+ gst_element_set_state( mpPlayer, aOldState );
+ }
+ }
+ }
+
+ return( xRet );
+}
+
+// ------------------------------------------------------------------------------
+uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber()
+ throw( ::com::sun::star::uno::RuntimeException )
+{
+ FrameGrabber* pFrameGrabber = NULL;
+ const awt::Size aPrefSize( getPreferredPlayerWindowSize() );
+
+ if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) )
+ {
+ pFrameGrabber = FrameGrabber::create( mpURI );
+ }
+
+ return( pFrameGrabber );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::dispose()
+ throw( uno::RuntimeException )
+{
+ if( mpPlayer )
+ {
+ stop();
+ implQuitThread();
+ }
+
+ OSL_ASSERT( NULL == mpPlayer );
+}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::addEventListener( const uno::Reference< lang::XEventListener >& /*rxListener*/ )
+ throw( uno::RuntimeException )
+{}
+
+// ------------------------------------------------------------------------------
+void SAL_CALL Player::removeEventListener( const uno::Reference< lang::XEventListener >& /*rxListener*/ )
+ throw( uno::RuntimeException )
+{}
+
+// ------------------------------------------------------------------------------
+::rtl::OUString SAL_CALL Player::getImplementationName()
+ throw( uno::RuntimeException )
+{
+ return( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_PLAYER_IMPLEMENTATIONNAME ) ) );
+}
+
+// ------------------------------------------------------------------------------
+sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName )
+ throw( uno::RuntimeException )
+{
+ return( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( AVMEDIA_GSTREAMER_PLAYER_SERVICENAME ) ) );
+}
+
+// ------------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString > aRet( 1 );
+ aRet[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_PLAYER_SERVICENAME ) );
+
+ return( aRet );
+}
+
+// ------------------------------------------------------------------------------
+void Player::implQuitThread()
+{
+ if( mpThread )
+ {
+ // set quit flag to 1 so that the main loop will be quit in idle
+ // handler the next time it is called from the thread's main loop
+ g_atomic_int_inc( &mnQuit );
+
+ // wait until loop and as such the thread has quit
+ g_thread_join( mpThread );
+ mpThread = NULL;
+ }
+}
+
+// ------------------------------------------------------------------------------
+bool Player::implInitPlayer()
+{
+ bool bRet = false;
+
+ if( mpPlayer && (mnInitFail < 3) )
+ {
+ GstState aState = GST_STATE_NULL;
+
+ if( gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT ) == GST_STATE_CHANGE_SUCCESS )
+ {
+ bRet = ( GST_STATE_PAUSED == aState ) || ( GST_STATE_PLAYING == aState );
+
+ if( !bRet )
+ {
+ gst_element_set_state( mpPlayer, GST_STATE_PAUSED );
+ bRet = ( gst_element_get_state( mpPlayer, &aState, NULL,
+ GST_MAX_TIMEOUT ) == GST_STATE_CHANGE_SUCCESS ) &&
+ ( GST_STATE_PAUSED == aState );
+ }
+ }
+
+ if( ! bRet )
+ mnInitFail++;
+ }
+
+ return( bRet );
+}
+
+// ------------------------------------------------------------------------------
+gboolean Player::implBusPrepare( GSource* pSource,
+ gint* pTimeout )
+{
+ if( pTimeout )
+ {
+ *pTimeout = 0;
+ }
+
+ return( implBusCheck( pSource ) );
+}
+
+// ------------------------------------------------------------------------------
+gboolean Player::implBusCheck( GSource* pSource )
+{
+ GstBusSource* pBusSource = static_cast< GstBusSource* >( pSource );
+
+ return( pBusSource &&
+ GST_IS_BUS( pBusSource->mpBus ) &&
+ gst_bus_have_pending( GST_BUS_CAST( pBusSource->mpBus ) ) );
+}
+
+// ------------------------------------------------------------------------------
+gboolean Player::implBusDispatch( GSource* pSource,
+ GSourceFunc /*aCallback*/,
+ gpointer pData )
+{
+ GstBusSource* pBusSource = static_cast< GstBusSource* >( pSource );
+ gboolean bRet = false;
+
+ if( pData && pBusSource && GST_IS_BUS( pBusSource->mpBus ) )
+ {
+ GstMessage* pMsg = gst_bus_pop( pBusSource->mpBus );
+
+ if( pMsg )
+ {
+ bRet = static_cast< Player* >( pData )->busCallback( pBusSource->mpBus, pMsg );
+ gst_message_unref( pMsg );
+ }
+ }
+
+ return( bRet );
+}
+
+// ------------------------------------------------------------------------------
+void Player::implBusFinalize( GSource* pSource )
+{
+ GstBusSource* pBusSource = static_cast< GstBusSource* >( pSource );
+
+ if( pBusSource && pBusSource->mpBus )
+ {
+ gst_object_unref( pBusSource->mpBus );
+ pBusSource->mpBus = NULL;
+ }
+}
+
+// ------------------------------------------------------------------------------
+gboolean Player::busCallback( GstBus* /*pBus*/,
+ GstMessage* pMsg )
+{
+ if( pMsg && mpLoop )
+ {
+ switch( GST_MESSAGE_TYPE( pMsg ) )
+ {
+ case ( GST_MESSAGE_EOS ):
+ {
+ if( g_atomic_int_get( &mnLooping ) > 0 )
+ {
+ setMediaTime( 0.0 );
+ start();
+ }
+ else
+ {
+ stop();
+ }
+ }
+ break;
+
+ case ( GST_MESSAGE_ERROR ):
+ {
+ gchar* pDebug;
+ GError* pErr;
+
+ gst_message_parse_error( pMsg, &pErr, &pDebug );
+ fprintf( stderr, "Error: %s\n", pErr->message );
+
+ g_free( pDebug );
+ g_error_free( pErr );
+ }
+ break;
+
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+ return( true );
+}
+
+// ------------------------------------------------------------------------------
+gboolean Player::implIdleFunc( gpointer pData )
+{
+ return( pData ? static_cast< Player* >( pData )->idle() : true );
+}
+
+// ------------------------------------------------------------------------------
+gpointer Player::implThreadFunc( gpointer pData )
+{
+ return( pData ? static_cast< Player* >( pData )->run() : NULL );
+}
+
+// ------------------------------------------------------------------------------
+GstBusSyncReply Player::implHandleCreateWindowFunc( GstBus* pBus,
+ GstMessage* pMsg,
+ gpointer pData )
+{
+ return( pData ? static_cast< Player* >( pData )->handleCreateWindow( pBus, pMsg ) : GST_BUS_PASS );
+}
+
+// ------------------------------------------------------------------------------
+void Player::implHandleNewElementFunc( GstBin* /* pBin */,
+ GstElement* pElement,
+ gpointer pData )
+{
+ if( pElement )
+ {
+#ifdef DEBUG
+ gchar* pElementName = gst_element_get_name( pElement );
+
+ if( pElementName )
+ {
+ OSL_TRACE( ">>> Bin has element: %s", pElementName );
+ g_free( pElementName );
+ }
+#endif
+
+ if( GST_IS_BIN( pElement ) )
+ {
+ // set this handler in case we have a GstBin element
+ g_signal_connect( GST_BIN( pElement ), "element-added",
+ G_CALLBACK( Player::implHandleNewElementFunc ), pData );
+ }
+
+ // watch for all pads that are going to be added to this element;
+ g_signal_connect( pElement, "pad-added",
+ G_CALLBACK( Player::implHandleNewPadFunc ), pData );
+ }
+}
+
+// ------------------------------------------------------------------------------
+void Player::implHandleNewPadFunc( GstElement* pElement,
+ GstPad* pPad,
+ gpointer pData )
+{
+ Player* pPlayer = static_cast< Player* >( pData );
+
+ if( pPlayer && pElement && pPad )
+ {
+#ifdef DEBUG
+ gchar* pElementName = gst_element_get_name( pElement );
+ gchar* pPadName = gst_pad_get_name( pPad );
+
+ OSL_TRACE( ">>> Element %s has pad: %s", pElementName, pPadName );
+
+ g_free( pPadName );
+ g_free( pElementName );
+#endif
+
+ GstCaps* pCaps = gst_pad_get_caps( pPad );
+
+ // we are interested only in getting video properties
+ // width and height or if we have a video source at all
+ if( pCaps )
+ {
+ for( gint i = 0, nSize = gst_caps_get_size( pCaps ); i < nSize; ++i )
+ {
+ const GstStructure* pStruct = gst_caps_get_structure( pCaps, i );
+
+ if( pStruct )
+ {
+ const gchar* pStructName = gst_structure_get_name( pStruct );
+
+#ifdef DEBUG
+ OSL_TRACE( "\t>>> Pad has structure: %s", pStructName );
+
+ for( gint n = 0, nFields = gst_structure_n_fields( pStruct ); n < nFields; ++n )
+ {
+ OSL_TRACE( "\t\t>>> Structure has field: %s", gst_structure_nth_field_name( pStruct, n ) );
+ }
+#endif
+
+ // just look for structures having 'video' in their names
+ if( ::std::string( pStructName ).find( "video" ) != ::std::string::npos )
+ {
+ g_atomic_int_inc( &pPlayer->mnIsVideoSource );
+
+ for( gint n = 0, nFields = gst_structure_n_fields( pStruct ); n < nFields; ++n )
+ {
+ const gchar* pFieldName = gst_structure_nth_field_name( pStruct, n );
+ gint nValue;
+
+ if( ( ::std::string( pFieldName ).find( "width" ) != ::std::string::npos ) &&
+ gst_structure_get_int( pStruct, pFieldName, &nValue ) )
+ {
+ const gint nDiff = nValue - g_atomic_int_get( &pPlayer->mnVideoWidth );
+ g_atomic_int_add( &pPlayer->mnVideoWidth, ::std::max( nDiff, 0 ) );
+ }
+ else if( ( ::std::string( pFieldName ).find( "height" ) != ::std::string::npos ) &&
+ gst_structure_get_int( pStruct, pFieldName, &nValue ) )
+ {
+ const gint nDiff = nValue - g_atomic_int_get( &pPlayer->mnVideoHeight );
+ g_atomic_int_add( &pPlayer->mnVideoHeight, ::std::max( nDiff, 0 ) );
+ }
+ }
+ }
+ }
+ }
+
+ gst_caps_unref( pCaps );
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------
+gboolean Player::idle()
+{
+ // test if main loop should quit and set flag mnQuit to 1
+ bool bQuit = g_atomic_int_compare_and_exchange( &mnQuit, 1, 1 );
+
+ if( bQuit )
+ {
+ // set mnQuit back to 0 to avoid mutiple g_main_loop_quit calls
+ // in case Player::idle() is called again later;
+ // the flag should have been set only once within Ctor called from
+ // the application thread
+ g_atomic_int_dec_and_test( &mnQuit );
+ g_main_loop_quit( mpLoop );
+ }
+
+ // don't eat up all cpu time
+ usleep( 1000 );
+
+ return( true );
+}
+
+// ------------------------------------------------------------------------------
+gpointer Player::run()
+{
+ static GSourceFuncs aSourceFuncs =
+ {
+ Player::implBusPrepare,
+ Player::implBusCheck,
+ Player::implBusDispatch,
+ Player::implBusFinalize,
+ NULL,
+ NULL
+ };
+
+ if( NULL != ( mpPlayer = gst_element_factory_make( "playbin", NULL ) ) )
+ {
+ // initialization
+ // no mutex necessary since initialization
+ // is synchronous until loop is started
+ mpContext = g_main_context_new();
+ mpLoop = g_main_loop_new( mpContext, false );
+
+ // add idle callback
+ GSource* pIdleSource = g_idle_source_new();
+ g_source_set_callback( pIdleSource, Player::implIdleFunc, this, NULL );
+ g_source_attach( pIdleSource, mpContext );
+
+ // add bus callback
+ GSource* pBusSource = g_source_new( &aSourceFuncs, sizeof( GstBusSource ) );
+ static_cast< GstBusSource* >( pBusSource )->mpBus = gst_pipeline_get_bus( GST_PIPELINE( mpPlayer ) );
+ g_source_set_callback( pBusSource, NULL, this, NULL );
+ g_source_attach( pBusSource, mpContext );
+
+ // add bus sync handler to intercept video window creation for setting our own window
+ gst_bus_set_sync_handler( static_cast< GstBusSource* >( pBusSource )->mpBus,
+ Player::implHandleCreateWindowFunc, this );
+
+ // watch for all elements (and pads) that will be added to the playbin,
+ // in order to retrieve properties like video width and height
+ g_signal_connect( GST_BIN( mpPlayer ), "element-added",
+ G_CALLBACK( Player::implHandleNewElementFunc ), this );
+
+ // set source URI for player
+ g_object_set( mpPlayer, "uri", mpURI->str, NULL );
+
+ // set video fake sink first, since we only create a player without window here
+ // and don't want to have the gstreamer default window appearing
+ g_object_set( mpPlayer, "video-sink", gst_element_factory_make( "fakesink", NULL ), NULL );
+
+ // set state of player to READY or destroy object in case of FAILURE
+ if( gst_element_set_state( mpPlayer, GST_STATE_READY ) == GST_STATE_CHANGE_FAILURE )
+ {
+ gst_object_unref( mpPlayer );
+ mpPlayer = NULL;
+ }
+
+ g_atomic_int_add( &mnInitialized, 1 );
+ g_cond_signal( mpCond );
+
+ // run the main loop
+ g_main_loop_run( mpLoop );
+
+ // clenanup
+ // no mutex necessary since other thread joined us (this thread)
+ // after setting the quit flag
+ if( mpPlayer )
+ {
+ gst_element_set_state( mpPlayer, GST_STATE_NULL );
+ gst_object_unref( mpPlayer );
+ mpPlayer = NULL;
+ }
+
+ g_main_loop_unref( mpLoop );
+ mpLoop = NULL;
+
+ g_source_destroy( pBusSource );
+ g_source_unref( pBusSource );
+
+ g_source_destroy( pIdleSource );
+ g_source_unref( pIdleSource );
+
+ g_main_context_unref( mpContext );
+ mpContext = NULL;
+ }
+ else
+ {
+ g_atomic_int_add( &mnInitialized, 1 );
+ g_cond_signal( mpCond );
+ }
+
+ return( NULL );
+}
+
+// ------------------------------------------------------------------------------
+GstBusSyncReply Player::handleCreateWindow( GstBus* /* pBus */,
+ GstMessage* pMsg )
+{
+ GstBusSyncReply eRet = GST_BUS_PASS;
+
+ if( pMsg &&
+ ( GST_MESSAGE_TYPE( pMsg ) == GST_MESSAGE_ELEMENT ) &&
+ gst_structure_has_name( pMsg->structure, "prepare-xwindow-id" ) &&
+ g_atomic_pointer_get( &mpPlayerWindow ) )
+ {
+ OSL_TRACE( ">>> Got Request to create XOverlay" );
+
+ gst_x_overlay_set_xwindow_id( GST_X_OVERLAY( GST_MESSAGE_SRC( pMsg ) ),
+ static_cast< Window* >( g_atomic_pointer_get(
+ &mpPlayerWindow ) )->getXWindowHandle() );
+
+ gst_message_unref( pMsg );
+ eRet = GST_BUS_DROP;
+ }
+
+ return( eRet );
+}
+} // namespace gst
+} // namespace avmedia
diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx
new file mode 100644
index 0000000000..5c80cb4e1d
--- /dev/null
+++ b/avmedia/source/gstreamer/gstplayer.hxx
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GSTPLAYER_HXX
+#define _GSTPLAYER_HXX
+
+#include "gstcommon.hxx"
+#include <glib.h>
+#include <glib/gatomic.h>
+
+// necessary for mixed environments with GStreamer-0.10 and GLib versions < 2.8
+#ifndef G_GNUC_NULL_TERMINATED
+#if __GNUC__ >= 4
+#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
+#else
+#define G_GNUC_NULL_TERMINATED
+#endif
+#endif
+
+struct _GOptionGroup;
+typedef struct _GOptionGroup GOptionGroup;
+
+#include <gst/gst.h>
+#include "com/sun/star/media/XPlayer.hdl"
+
+namespace avmedia
+{
+namespace gst
+{
+class Window;
+
+// ---------------
+// - Player_Impl -
+// ---------------
+
+class Player : public ::cppu::WeakImplHelper3< ::com::sun::star::media::XPlayer,
+ ::com::sun::star::lang::XComponent,
+ ::com::sun::star::lang::XServiceInfo >
+{
+public:
+
+ // static create method instead of public Ctor
+ static Player* create( const ::rtl::OUString& rURL );
+
+ ~Player();
+
+ // XPlayer
+ virtual void SAL_CALL start()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL stop()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isPlaying()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual double SAL_CALL getDuration()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setMediaTime( double fTime )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual double SAL_CALL getMediaTime()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setStopTime( double fTime )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual double SAL_CALL getStopTime()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setRate( double fRate )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual double SAL_CALL getRate()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isPlaybackLoop()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setMute( sal_Bool bSet )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL isMute()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Int16 SAL_CALL getVolumeDB()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::awt::Size SAL_CALL getPreferredPlayerWindowSize()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > SAL_CALL createPlayerWindow(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XComponent
+ virtual void SAL_CALL dispose()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ 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 );
+
+
+protected:
+
+ Player( GString* pURI = NULL );
+
+ virtual gboolean busCallback( GstBus* pBus,
+ GstMessage* pMsg );
+
+ virtual gboolean idle();
+
+ virtual gpointer run();
+
+ virtual GstBusSyncReply handleCreateWindow( GstBus* pBus,
+ GstMessage* pMsg );
+
+ void implQuitThread();
+
+ bool implInitPlayer();
+
+ bool implIsInitialized() const
+ {
+ return( g_atomic_int_get( &mnInitialized ) > 0 );
+ }
+
+
+private:
+
+ Player( const Player& );
+
+ Player& operator=( const Player& );
+
+ static gboolean implBusPrepare( GSource* pSource,
+ gint* pTimeout );
+
+ static gboolean implBusCheck( GSource* pSource );
+
+ static gboolean implBusDispatch( GSource* pSource,
+ GSourceFunc aCallback,
+ gpointer pData );
+
+ static void implBusFinalize( GSource* pSource );
+
+ static gboolean implIdleFunc( gpointer pData );
+
+ static gpointer implThreadFunc( gpointer pData );
+
+ static GstBusSyncReply implHandleCreateWindowFunc( GstBus* pBus,
+ GstMessage* pMsg,
+ gpointer pDData );
+
+ static void implHandleNewElementFunc( GstBin* pBin,
+ GstElement* pElement,
+ gpointer pData );
+
+ static void implHandleNewPadFunc( GstElement* pElem,
+ GstPad* pPad,
+ gpointer pData );
+
+protected:
+
+ GMutex* mpMutex;
+ GCond* mpCond;
+ GThread* mpThread;
+ GMainContext* mpContext;
+ GMainLoop* mpLoop;
+ GstElement* mpPlayer;
+ GString* mpURI;
+
+private:
+
+ ::avmedia::gst::Window* mpPlayerWindow;
+ gint mnIsVideoSource;
+ gint mnVideoWidth;
+ gint mnVideoHeight;
+ gint mnInitialized;
+ gint mnVolumeDB;
+ gint mnLooping;
+ gint mnQuit;
+ gint mnVideoWindowSet;
+ gint mnInitFail;
+};
+} // namespace gst
+} // namespace avmedia
+
+#endif // _GSTPLAYER_HXX
diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx
new file mode 100644
index 0000000000..8470d8cb6c
--- /dev/null
+++ b/avmedia/source/gstreamer/gstuno.cxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "gstcommon.hxx"
+#include "gstmanager.hxx"
+
+using namespace ::com::sun::star;
+
+// -------------------
+// - factory methods -
+// -------------------
+
+static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
+{
+ return uno::Reference< uno::XInterface >( *new ::avmedia::gst::Manager( rxFact ) );
+}
+
+// ------------------------------------------
+// - component_getImplementationEnvironment -
+// ------------------------------------------
+
+extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+// ------------------------
+// - component_getFactory -
+// ------------------------
+
+extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
+{
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
+ void* pRet = 0;
+
+ if( rtl_str_compare( pImplName, AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ) == 0 )
+ {
+ const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) );
+
+ xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+ reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+ ::rtl::OUString::createFromAscii( AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ),
+ create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
+ }
+
+ if( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+
+ return pRet;
+}
diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx
new file mode 100644
index 0000000000..12606ad5e8
--- /dev/null
+++ b/avmedia/source/gstreamer/gstwindow.cxx
@@ -0,0 +1,668 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include <tools/prex.h>
+#include <tools/postx.h>
+
+#include <com/sun/star/awt/SystemPointer.hdl>
+
+#include "gstwindow.hxx"
+#include "gstplayer.hxx"
+#include <vcl/syschild.hxx>
+#include <vcl/sysdata.hxx>
+
+using namespace ::com::sun::star;
+
+namespace avmedia
+{
+namespace gst
+{
+// ---------------------
+// - PlayerChildWindow -
+// ---------------------
+
+class PlayerChildWindow : public SystemChildWindow
+{
+public:
+
+ PlayerChildWindow( Window* pParent );
+ ~PlayerChildWindow();
+
+protected:
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+};
+
+// ---------------------------------------------------------------------
+
+PlayerChildWindow::PlayerChildWindow( Window* pParent ) :
+ SystemChildWindow( pParent, WB_CLIPCHILDREN )
+{
+}
+
+// ---------------------------------------------------------------------
+
+PlayerChildWindow::~PlayerChildWindow()
+{
+}
+
+// ---------------------------------------------------------------------
+
+void PlayerChildWindow::MouseMove( const MouseEvent& rMEvt )
+{
+ const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
+ rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
+
+ SystemChildWindow::MouseMove( rMEvt );
+ GetParent()->MouseMove( aTransformedEvent );
+}
+
+// ---------------------------------------------------------------------
+
+void PlayerChildWindow::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
+ rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
+
+ SystemChildWindow::MouseButtonDown( rMEvt );
+ GetParent()->MouseButtonDown( aTransformedEvent );
+}
+
+// ---------------------------------------------------------------------
+
+void PlayerChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
+ rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
+
+ SystemChildWindow::MouseButtonUp( rMEvt );
+ GetParent()->MouseButtonUp( aTransformedEvent );
+}
+
+// ---------------------------------------------------------------------
+
+void PlayerChildWindow::KeyInput( const KeyEvent& rKEvt )
+{
+ SystemChildWindow::KeyInput( rKEvt );
+ GetParent()->KeyInput( rKEvt );
+}
+
+// ---------------------------------------------------------------------
+
+void PlayerChildWindow::KeyUp( const KeyEvent& rKEvt )
+{
+ SystemChildWindow::KeyUp( rKEvt );
+ GetParent()->KeyUp( rKEvt );
+}
+
+// ---------------------------------------------------------------------
+
+void PlayerChildWindow::Command( const CommandEvent& rCEvt )
+{
+ const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ),
+ rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() );
+
+ SystemChildWindow::Command( rCEvt );
+ GetParent()->Command( aTransformedEvent );
+}
+
+// ---------------
+// - Window -
+// ---------------
+Window::Window( ::avmedia::gst::Player& rPlayer ) :
+ maListeners( maMutex ),
+ maWindowRect( 0, 0, 0, 0 ),
+ mrPlayer( rPlayer ),
+ mpPlayerWindow( NULL ),
+ meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ),
+ mnPointerType( awt::SystemPointer::ARROW )
+{}
+
+// ------------------------------------------------------------------------------
+
+Window::~Window()
+{
+ dispose();
+}
+
+// ------------------------------------------------------------------------------
+
+void Window::implLayoutVideoWindow()
+{
+ if( mpPlayerWindow && ( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel ) )
+ {
+ awt::Size aPrefSize( mrPlayer.getPreferredPlayerWindowSize() );
+ awt::Rectangle aRect = getPosSize();
+ int nW = aRect.Width, nH = aRect.Height;
+ int nVideoW = nW, nVideoH = nH;
+ int nX = 0, nY = 0, nWidth = 0, nHeight = 0;
+ bool bDone = false, bZoom = false;
+
+ if( media::ZoomLevel_ORIGINAL == meZoomLevel )
+ {
+ bZoom = true;
+ }
+ else if( media::ZoomLevel_ZOOM_1_TO_4 == meZoomLevel )
+ {
+ aPrefSize.Width >>= 2;
+ aPrefSize.Height >>= 2;
+ bZoom = true;
+ }
+ else if( media::ZoomLevel_ZOOM_1_TO_2 == meZoomLevel )
+ {
+ aPrefSize.Width >>= 1;
+ aPrefSize.Height >>= 1;
+ bZoom = true;
+ }
+ else if( media::ZoomLevel_ZOOM_2_TO_1 == meZoomLevel )
+ {
+ aPrefSize.Width <<= 1;
+ aPrefSize.Height <<= 1;
+ bZoom = true;
+ }
+ else if( media::ZoomLevel_ZOOM_4_TO_1 == meZoomLevel )
+ {
+ aPrefSize.Width <<= 2;
+ aPrefSize.Height <<= 2;
+ bZoom = true;
+ }
+ else if( media::ZoomLevel_FIT_TO_WINDOW == meZoomLevel )
+ {
+ nWidth = nVideoW;
+ nHeight = nVideoH;
+ bDone = true;
+ }
+
+ if( bZoom )
+ {
+ if( ( aPrefSize.Width <= nVideoW ) && ( aPrefSize.Height <= nVideoH ) )
+ {
+ nX = ( nVideoW - aPrefSize.Width ) >> 1;
+ nY = ( nVideoH - aPrefSize.Height ) >> 1;
+ nWidth = aPrefSize.Width;
+ nHeight = aPrefSize.Height;
+ bDone = true;
+ }
+ }
+
+ if( !bDone )
+ {
+ if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) && ( nVideoW > 0 ) && ( nVideoH > 0 ) )
+ {
+ double fPrefWH = (double) aPrefSize.Width / aPrefSize.Height;
+
+ if( fPrefWH < ( (double) nVideoW / nVideoH ) )
+ {
+ nVideoW = (int) ( nVideoH * fPrefWH );
+ }
+ else
+ {
+ nVideoH = (int) ( nVideoW / fPrefWH );
+ }
+
+ nX = ( nW - nVideoW ) >> 1;
+ nY = ( nH - nVideoH ) >> 1;
+ nWidth = nVideoW;
+ nHeight = nVideoH;
+ }
+ else
+ {
+ nX = nY = nWidth = nHeight = 0;
+ }
+ }
+
+ mpPlayerWindow->SetPosSizePixel( Point( nX, nY ), Size( nWidth, nHeight ) );
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+bool Window::create( const uno::Sequence< uno::Any >& rArguments )
+{
+ OSL_ASSERT( !mpPlayerWindow );
+ OSL_ENSURE( rArguments.getLength() > 2,
+"::avmedia::gst::Windiow::create: GStreamer backend needs \
+valid parent SystemChildWindow pointer (sal_IntPtr) as third Any \
+value in sequence of arguments" );
+
+ bool bRet = false;
+
+ if( !mpPlayerWindow && ( rArguments.getLength() > 2 ) )
+ {
+ SystemChildWindow* pParentWindow = NULL;
+ sal_IntPtr pIntPtr = 0;
+
+ // we are not interested in the first argument, which is a pure X11 window handle;
+ // this backend relies on a SystemChildWindow as parent for the PlayerWindow, given
+ // as third Sal_IntPtr value within the argument Sequence
+ rArguments[ 1 ] >>= maWindowRect;
+
+ rArguments[ 2 ] >>= pIntPtr;
+ pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr );
+
+ if( pParentWindow )
+ {
+ meZoomLevel = media::ZoomLevel_ORIGINAL;
+
+ mpPlayerWindow = new PlayerChildWindow( pParentWindow );
+ mpPlayerWindow->SetBackground( Color( COL_BLACK ) );
+ mpPlayerWindow->SetPosSizePixel( Point( maWindowRect.X, maWindowRect.Y ),
+ Size( maWindowRect.Width, maWindowRect.Height ) );
+ mpPlayerWindow->Show();
+
+ bRet = true;
+ }
+ }
+
+ return( bRet );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::update()
+ throw( uno::RuntimeException )
+{
+ if( mpPlayerWindow )
+ {
+ mpPlayerWindow->Invalidate( INVALIDATE_UPDATE );
+ mpPlayerWindow->Sync();
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel eZoomLevel )
+ throw(uno::RuntimeException)
+{
+ bool bRet = false;
+
+ if( ( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel ) &&
+ ( media::ZoomLevel_NOT_AVAILABLE != eZoomLevel ) )
+ {
+ if( eZoomLevel != meZoomLevel )
+ {
+ meZoomLevel = eZoomLevel;
+ implLayoutVideoWindow();
+ }
+
+ bRet = true;
+ }
+
+ return( bRet );
+}
+
+// ------------------------------------------------------------------------------
+
+media::ZoomLevel SAL_CALL Window::getZoomLevel()
+ throw( uno::RuntimeException )
+{
+ return( meZoomLevel );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::setPointerType( sal_Int32 nPointerType )
+ throw( uno::RuntimeException )
+{
+ if( mpPlayerWindow )
+ {
+ Pointer ePointer = POINTER_ARROW;
+
+ switch( nPointerType )
+ {
+ case (awt::SystemPointer::CROSS) :
+ {
+ ePointer = POINTER_CROSS;
+ }
+ break;
+
+ case (awt::SystemPointer::HAND) :
+ {
+ ePointer = POINTER_HAND;
+ }
+ break;
+
+ case (awt::SystemPointer::MOVE) :
+ {
+ ePointer = POINTER_MOVE;
+ }
+ break;
+
+ case (awt::SystemPointer::WAIT) :
+ {
+ ePointer = POINTER_WAIT;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ mpPlayerWindow->SetPointer( ePointer );
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::setPosSize( sal_Int32 nX,
+ sal_Int32 nY,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 /* Flags */ )
+ throw( uno::RuntimeException )
+{
+ maWindowRect.X = nX;
+ maWindowRect.Y = nY;
+ maWindowRect.Width = nWidth;
+ maWindowRect.Height = nHeight;
+
+ implLayoutVideoWindow();
+}
+
+// ------------------------------------------------------------------------------
+
+awt::Rectangle SAL_CALL Window::getPosSize()
+ throw( uno::RuntimeException )
+{
+ return( maWindowRect );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::setVisible( sal_Bool bVisible )
+ throw( uno::RuntimeException )
+{
+ if( mpPlayerWindow )
+ {
+ bVisible ? mpPlayerWindow->Show() : mpPlayerWindow->Hide();
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::setEnable( sal_Bool bEnable )
+ throw( uno::RuntimeException )
+{
+ if( mpPlayerWindow )
+ {
+ mpPlayerWindow->Enable( bEnable );
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::setFocus()
+ throw( uno::RuntimeException )
+{
+ if( mpPlayerWindow )
+ {
+ mpPlayerWindow->GrabFocus();
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::dispose()
+ throw( uno::RuntimeException )
+{
+ delete mpPlayerWindow;
+ mpPlayerWindow = NULL;
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::addEventListener( const uno::Reference< lang::XEventListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.addInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventListener >&
+ xListener )
+ throw( uno::RuntimeException )
+{
+ maListeners.removeInterface( getCppuType( &xListener ), xListener );
+}
+
+// ------------------------------------------------------------------------------
+
+void Window::fireMousePressedEvent( const ::com::sun::star::awt::MouseEvent& rEvt )
+{
+ ::cppu::OInterfaceContainerHelper* pContainer =
+ maListeners.getContainer( getCppuType( ( uno::Reference< awt::XMouseListener >* ) 0 ) );
+
+ if( pContainer )
+ {
+ ::cppu::OInterfaceIteratorHelper aIter( *pContainer );
+
+ while( aIter.hasMoreElements() )
+ {
+ uno::Reference< awt::XMouseListener >( aIter.next(),
+ uno::UNO_QUERY )->mousePressed( rEvt );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void Window::fireMouseReleasedEvent( const ::com::sun::star::awt::MouseEvent& rEvt )
+{
+ ::cppu::OInterfaceContainerHelper* pContainer =
+ maListeners.getContainer( getCppuType( ( uno::Reference< awt::XMouseListener >* ) 0 ) );
+
+ if( pContainer )
+ {
+ ::cppu::OInterfaceIteratorHelper aIter( *pContainer );
+
+ while( aIter.hasMoreElements() )
+ {
+ uno::Reference< awt::XMouseListener >( aIter.next(),
+ uno::UNO_QUERY )->mouseReleased( rEvt );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void Window::fireMouseMovedEvent( const ::com::sun::star::awt::MouseEvent& rEvt )
+{
+ ::cppu::OInterfaceContainerHelper* pContainer =
+ maListeners.getContainer( getCppuType( ( uno::Reference< awt::XMouseMotionListener >* )
+ 0 ) );
+
+ if( pContainer )
+ {
+ ::cppu::OInterfaceIteratorHelper aIter( *pContainer );
+
+ while( aIter.hasMoreElements() )
+ {
+ uno::Reference< awt::XMouseMotionListener >( aIter.next(),
+ uno::UNO_QUERY )->mouseMoved( rEvt );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void Window::fireSetFocusEvent( const ::com::sun::star::awt::FocusEvent& rEvt )
+{
+ ::cppu::OInterfaceContainerHelper* pContainer =
+ maListeners.getContainer( getCppuType( ( uno::Reference< awt::XFocusListener >* ) 0 ) );
+
+ if( pContainer )
+ {
+ ::cppu::OInterfaceIteratorHelper aIter( *pContainer );
+
+ while( aIter.hasMoreElements() )
+ {
+ uno::Reference< awt::XFocusListener >( aIter.next(),
+ uno::UNO_QUERY )->focusGained( rEvt );
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------
+
+long Window::getXWindowHandle() const
+{
+ return( mpPlayerWindow ? mpPlayerWindow->GetSystemData()->aWindow : 0 );
+}
+
+
+// ------------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL Window::getImplementationName()
+ throw( uno::RuntimeException )
+{
+ return( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ AVMEDIA_GSTREAMER_WINDOW_IMPLEMENTATIONNAME ) ) );
+}
+
+// ------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL Window::supportsService( const ::rtl::OUString& ServiceName )
+ throw( uno::RuntimeException )
+{
+ return( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ AVMEDIA_GSTREAMER_WINDOW_SERVICENAME ) ) );
+}
+
+// ------------------------------------------------------------------------------
+
+uno::Sequence< ::rtl::OUString > SAL_CALL Window::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString > aRet( 1 );
+ aRet[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_WINDOW_SERVICENAME ) );
+
+ return( aRet );
+}
+} // namespace gst
+} // namespace avmedia
diff --git a/avmedia/source/gstreamer/gstwindow.hxx b/avmedia/source/gstreamer/gstwindow.hxx
new file mode 100644
index 0000000000..3a55fca9c8
--- /dev/null
+++ b/avmedia/source/gstreamer/gstwindow.hxx
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef _GSTWINDOW_HXX
+#define _GSTWINDOW_HXX
+
+#include "gstcommon.hxx"
+#include <cppuhelper/interfacecontainer.h>
+
+#ifndef _COM_SUN_STAR_MEDIA_XPLAYERWINDOW_HDL_
+#include "com/sun/star/media/XPlayerWindow.hdl"
+#endif
+
+namespace avmedia
+{
+namespace gst
+{
+
+class PlayerChildWindow;
+
+// ---------------
+// - Window -
+// ---------------
+
+class Player;
+
+class Window : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayerWindow,
+ ::com::sun::star::lang::XServiceInfo >
+{
+ friend class Player;
+
+public: Window( ::avmedia::gst::Player& rPlayer );
+ ~Window();
+
+ bool create( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
+
+ // XPlayerWindow
+ virtual void SAL_CALL update()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL setZoomLevel( ::com::sun::star::media::ZoomLevel ZoomLevel )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::media::ZoomLevel SAL_CALL getZoomLevel()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setPointerType( sal_Int32 nPointerType )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XWindow
+ virtual void SAL_CALL setPosSize( sal_Int32 X,
+ sal_Int32 Y,
+ sal_Int32 Width,
+ sal_Int32 Height,
+ sal_Int16 Flags )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setVisible( sal_Bool Visible )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setEnable( sal_Bool Enable )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL setFocus()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addWindowListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeWindowListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addFocusListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeFocusListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addKeyListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeKeyListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addMouseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeMouseListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addMouseMotionListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeMouseMotionListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addPaintListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removePaintListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XComponent
+ virtual void SAL_CALL dispose()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL addEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL removeEventListener(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ 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 );
+
+
+public:
+
+ void fireMousePressedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
+
+ void fireMouseReleasedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
+
+ void fireMouseMovedEvent( const ::com::sun::star::awt::MouseEvent& rEvt );
+
+ void fireKeyPressedEvent( const ::com::sun::star::awt::KeyEvent& rEvt );
+
+ void fireKeyReleasedEvent( const ::com::sun::star::awt::KeyEvent& rEvt );
+
+ void fireSetFocusEvent( const ::com::sun::star::awt::FocusEvent& rEvt );
+
+protected:
+
+ long getXWindowHandle() const;
+
+private:
+
+ ::osl::Mutex maMutex;
+ ::cppu::OMultiTypeInterfaceContainerHelper maListeners;
+ ::com::sun::star::awt::Rectangle maWindowRect;
+ Player& mrPlayer;
+ PlayerChildWindow* mpPlayerWindow;
+ ::com::sun::star::media::ZoomLevel meZoomLevel;
+ sal_Int32 mnPointerType;
+
+ void implLayoutVideoWindow();
+};
+} // namespace gst
+} // namespace avmedia
+
+#endif // _GSTWINDOW_HXX
diff --git a/avmedia/source/gstreamer/makefile.mk b/avmedia/source/gstreamer/makefile.mk
new file mode 100644
index 0000000000..c648fcc77f
--- /dev/null
+++ b/avmedia/source/gstreamer/makefile.mk
@@ -0,0 +1,79 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJNAME=avmediagst
+TARGET=avmediagst
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+.IF "$(verbose)"!="" || "$(VERBOSE)"!=""
+CDEFS+= -DVERBOSE
+.ENDIF
+
+# --- Files ----------------------------------
+
+.IF "$(GUI)" == "UNX" && "$(GUIBASE)"!="aqua" && "$(ENABLE_GSTREAMER)" != ""
+
+PKGCONFIG_MODULES=gtk+-2.0 gstreamer-0.10 gstreamer-interfaces-0.10
+.INCLUDE : pkg_config.mk
+
+SLOFILES= \
+ $(SLO)$/gstuno.obj \
+ $(SLO)$/gstmanager.obj \
+ $(SLO)$/gstwindow.obj \
+ $(SLO)$/gstplayer.obj \
+ $(SLO)$/gstframegrabber.obj
+
+EXCEPTIONSFILES= \
+ $(SLO)$/gstuno.obj \
+ $(SLO)$/gstplayer.obj \
+ $(SLO)$/gstframegrabber.obj
+
+SHL1TARGET=$(TARGET)
+SHL1STDLIBS= $(CPPULIB) $(SALLIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(TOOLSLIB) $(VCLLIB)
+SHL1STDLIBS+=$(PKGCONFIG_LIBS)
+SHL1IMPLIB=i$(TARGET)
+SHL1LIBS=$(SLB)$/$(TARGET).lib
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEF1EXPORTFILE=exports.dxp
+
+.ENDIF
+
+.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/avmediagst.component
+
+$(MISC)/avmediagst.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ avmediagst.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt avmediagst.component
diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx
index db5a72d925..32066bf489 100644
--- a/avmedia/source/inc/mediamisc.hxx
+++ b/avmedia/source/inc/mediamisc.hxx
@@ -30,12 +30,30 @@ class ResMgr;
#define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() )
#ifdef WNT
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_DirectX"
+
+#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX"
+#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False
+
+#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 ""
+#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 sal_False
+
#else
#ifdef QUARTZ
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime"
+
+#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime"
+#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False
+
+#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 ""
+#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 sal_False
+
#else
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_Java"
+
+#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer"
+#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False
+
+#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 "com.sun.star.comp.avmedia.Manager_Java"
+#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 sal_True
+
#endif
#endif
diff --git a/avmedia/source/java/MediaUno.java b/avmedia/source/java/MediaUno.java
index 004ae7cf68..b77fd97eae 100644
--- a/avmedia/source/java/MediaUno.java
+++ b/avmedia/source/java/MediaUno.java
@@ -64,13 +64,4 @@ public class MediaUno
return null;
}
-
- // -------------------------------------------------------------------------
-
- public static boolean __writeRegistryServiceInfo(
- com.sun.star.registry.XRegistryKey regKey )
- {
- return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
- s_implName, s_serviceName, regKey );
- }
}
diff --git a/avmedia/source/java/PlayerWindow.java b/avmedia/source/java/PlayerWindow.java
index 4bc9db4ac7..58df751b39 100644
--- a/avmedia/source/java/PlayerWindow.java
+++ b/avmedia/source/java/PlayerWindow.java
@@ -67,9 +67,7 @@ public class PlayerWindow implements java.awt.event.KeyListener,
maFrame = new WindowAdapter( AnyConverter.toInt( aArgs[ 0 ] ) );
maFrame.setPosSize( aBoundRect.X, aBoundRect.Y, aBoundRect.Width, aBoundRect.Height, (short) 0 );
-
- if( aArgs.length > 2 )
- mbShowControls = AnyConverter.toBoolean( aArgs[ 2 ] );
+ mbShowControls = false;
java.awt.Panel aPanel = new java.awt.Panel( new java.awt.BorderLayout() );
diff --git a/avmedia/source/java/avmedia.jar b/avmedia/source/java/avmedia.jar
index 55576baa5b..85a98bbcf3 100644
--- a/avmedia/source/java/avmedia.jar
+++ b/avmedia/source/java/avmedia.jar
Binary files differ
diff --git a/avmedia/source/java/avmedia.jar.component b/avmedia/source/java/avmedia.jar.component
new file mode 100644
index 0000000000..d7cc160bd7
--- /dev/null
+++ b/avmedia/source/java/avmedia.jar.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.media.Manager_Java">
+ <service name="com.sun.star.media.Manager_Java"/>
+ </implementation>
+</component>
diff --git a/avmedia/source/java/makefile.mk b/avmedia/source/java/makefile.mk
index 37c53a7211..1fe771c117 100644
--- a/avmedia/source/java/makefile.mk
+++ b/avmedia/source/java/makefile.mk
@@ -59,3 +59,11 @@ CUSTOMMANIFESTFILE = manifest
# --- Targets ------------------------------------------------------
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/avmedia.jar.component
+
+$(MISC)/avmedia.jar.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)avmedia.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component
diff --git a/avmedia/source/quicktime/avmediaQuickTime.component b/avmedia/source/quicktime/avmediaQuickTime.component
new file mode 100644
index 0000000000..aa0251d74c
--- /dev/null
+++ b/avmedia/source/quicktime/avmediaQuickTime.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.avmedia.Manager_QuickTime">
+ <service name="com.sun.star.media.Manager_QuickTime"/>
+ </implementation>
+</component>
diff --git a/avmedia/source/quicktime/makefile.mk b/avmedia/source/quicktime/makefile.mk
index f3c9f244f3..358fce4918 100644
--- a/avmedia/source/quicktime/makefile.mk
+++ b/avmedia/source/quicktime/makefile.mk
@@ -83,3 +83,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
dummy:
@echo " Nothing to build for GUIBASE=$(GUIBASE)"
.ENDIF
+
+ALLTAR : $(MISC)/avmediaQuickTime.component
+
+$(MISC)/avmediaQuickTime.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt avmediaQuickTime.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt avmediaQuickTime.component
diff --git a/avmedia/source/quicktime/quicktimeuno.cxx b/avmedia/source/quicktime/quicktimeuno.cxx
index 641b7df67b..d43dc02685 100644
--- a/avmedia/source/quicktime/quicktimeuno.cxx
+++ b/avmedia/source/quicktime/quicktimeuno.cxx
@@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// -----------------------
-// - component_writeInfo -
-// -----------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xNewKey1(
- static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
- ::rtl::OUString::createFromAscii(
- "/" AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/"
- AVMEDIA_QUICKTIME_MANAGER_SERVICENAME ) ) );
-
- bRet = sal_True;
- }
- catch( registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return bRet;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index edc9ee5154..b5667dfaa3 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -162,7 +162,9 @@ Size MediaWindow::getPreferredSize() const
void MediaWindow::setPosSize( const Rectangle& rNewRect )
{
if( mpImpl )
+ {
mpImpl->setPosSize( rNewRect );
+ }
}
// -------------------------------------------------------------------------
@@ -368,6 +370,7 @@ void MediaWindow::getMediaFilters( FilterNameVector& rFilterNameVector )
"AU Audio", "au",
"AVI", "avi",
"CD Audio", "cda",
+ "Matroska Media", "mkv",
"MIDI Audio", "mid;midi",
"MPEG Audio", "mp2;mp3;mpa",
"MPEG Video", "mpg;mpeg;mpv;mp4",
@@ -464,39 +467,28 @@ bool MediaWindow::isMediaURL( const ::rtl::OUString& rURL, bool bDeep, Size* pPr
{
if( bDeep || pPreferredSizePixel )
{
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-
- if( xFactory.is() )
+ try
{
- try
- {
- fprintf(stderr, "-->%s uno reference \n\n",AVMEDIA_MANAGER_SERVICE_NAME);
+ sal_Bool bIsJavaBasedMediaWindow;
+ uno::Reference< media::XPlayer > xPlayer( priv::MediaWindowImpl::createPlayer(
+ aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ),
+ bIsJavaBasedMediaWindow ) );
- uno::Reference< ::com::sun::star::media::XManager > xManager(
- xFactory->createInstance( ::rtl::OUString::createFromAscii( AVMEDIA_MANAGER_SERVICE_NAME ) ),
- uno::UNO_QUERY );
+ if( xPlayer.is() )
+ {
+ bRet = true;
- if( xManager.is() )
+ if( pPreferredSizePixel )
{
- uno::Reference< media::XPlayer > xPlayer( xManager->createPlayer( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) );
-
- if( xPlayer.is() )
- {
- bRet = true;
+ const awt::Size aAwtSize( xPlayer->getPreferredPlayerWindowSize() );
- if( pPreferredSizePixel )
- {
- const awt::Size aAwtSize( xPlayer->getPreferredPlayerWindowSize() );
-
- pPreferredSizePixel->Width() = aAwtSize.Width;
- pPreferredSizePixel->Height() = aAwtSize.Height;
- }
- }
+ pPreferredSizePixel->Width() = aAwtSize.Width;
+ pPreferredSizePixel->Height() = aAwtSize.Height;
}
}
- catch( ... )
- {
- }
+ }
+ catch( ... )
+ {
}
}
else
@@ -525,7 +517,8 @@ bool MediaWindow::isMediaURL( const ::rtl::OUString& rURL, bool bDeep, Size* pPr
uno::Reference< media::XPlayer > MediaWindow::createPlayer( const ::rtl::OUString& rURL )
{
- return priv::MediaWindowImpl::createPlayer( rURL );
+ sal_Bool bJavaBased = sal_False;
+ return priv::MediaWindowImpl::createPlayer( rURL, bJavaBased );
}
// -------------------------------------------------------------------------
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index 24d17abe4d..cb5d9675a1 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -1,4 +1,4 @@
-/*************************************************************************
+/************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -77,7 +77,7 @@ MediaWindowControl::~MediaWindowControl()
void MediaWindowControl::update()
{
MediaItem aItem;
-
+
static_cast< MediaWindowImpl* >( GetParent() )->updateMediaItem( aItem );
setState( aItem );
}
@@ -94,7 +94,7 @@ void MediaWindowControl::execute( const MediaItem& rItem )
// --------------------
MediaChildWindow::MediaChildWindow( Window* pParent ) :
- JavaChildWindow( pParent, WB_CLIPCHILDREN )
+ SystemChildWindow( pParent, WB_CLIPCHILDREN )
{
}
@@ -110,8 +110,8 @@ void MediaChildWindow::MouseMove( const MouseEvent& rMEvt )
{
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
-
- JavaChildWindow::MouseMove( rMEvt );
+
+ SystemChildWindow::MouseMove( rMEvt );
GetParent()->MouseMove( aTransformedEvent );
}
@@ -121,8 +121,8 @@ void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
-
- JavaChildWindow::MouseButtonDown( rMEvt );
+
+ SystemChildWindow::MouseButtonDown( rMEvt );
GetParent()->MouseButtonDown( aTransformedEvent );
}
@@ -132,8 +132,8 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() );
-
- JavaChildWindow::MouseButtonUp( rMEvt );
+
+ SystemChildWindow::MouseButtonUp( rMEvt );
GetParent()->MouseButtonUp( aTransformedEvent );
}
@@ -141,7 +141,7 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt )
void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
{
- JavaChildWindow::KeyInput( rKEvt );
+ SystemChildWindow::KeyInput( rKEvt );
GetParent()->KeyInput( rKEvt );
}
@@ -149,7 +149,7 @@ void MediaChildWindow::KeyInput( const KeyEvent& rKEvt )
void MediaChildWindow::KeyUp( const KeyEvent& rKEvt )
{
- JavaChildWindow::KeyUp( rKEvt );
+ SystemChildWindow::KeyUp( rKEvt );
GetParent()->KeyUp( rKEvt );
}
@@ -159,8 +159,8 @@ void MediaChildWindow::Command( const CommandEvent& rCEvt )
{
const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ),
rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() );
-
- JavaChildWindow::Command( rCEvt );
+
+ SystemChildWindow::Command( rCEvt );
GetParent()->Command( aTransformedEvent );
}
@@ -179,9 +179,10 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo
mpEmptyBmpEx( NULL ),
mpAudioBmpEx( NULL )
{
+ maChildWindow.SetBackground( Color( COL_BLACK ) );
maChildWindow.SetHelpId( HID_AVMEDIA_PLAYERWINDOW );
maChildWindow.Hide();
-
+
if( mpMediaWindowControl )
{
mpMediaWindowControl->SetSizePixel( mpMediaWindowControl->getMinSizePixel() );
@@ -211,12 +212,12 @@ void MediaWindowImpl::cleanUp()
xPlayerWindow->removeKeyListener( uno::Reference< awt::XKeyListener >( mxEventsIf, uno::UNO_QUERY ) );
xPlayerWindow->removeMouseListener( uno::Reference< awt::XMouseListener >( mxEventsIf, uno::UNO_QUERY ) );
xPlayerWindow->removeMouseMotionListener( uno::Reference< awt::XMouseMotionListener >( mxEventsIf, uno::UNO_QUERY ) );
-
+
uno::Reference< lang::XComponent > xComponent( xPlayerWindow, uno::UNO_QUERY );
-
+
if( xComponent.is() )
xComponent->dispose();
-
+
setPlayerWindow( NULL );
}
@@ -229,25 +230,30 @@ void MediaWindowImpl::onURLChanged()
{
if( getPlayer().is() )
{
- uno::Sequence< uno::Any > aArgs( 2 );
uno::Reference< media::XPlayerWindow > xPlayerWindow;
- const Point aPoint;
- const Size aSize( maChildWindow.GetSizePixel() );
- const sal_IntPtr nWndHandle = static_cast< sal_IntPtr >( maChildWindow.getParentWindowHandleForJava() );
-
- aArgs[ 0 ] = uno::makeAny( nWndHandle );
- aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) );
+ const Point aPoint;
+ const Size aSize( maChildWindow.GetSizePixel() );
+ const sal_IntPtr nWndHandle = (sal_IntPtr) maChildWindow.GetParentWindowHandle( isMediaWindowJavaBased() );
+
try
{
if( nWndHandle != 0 )
+ {
+ uno::Sequence< uno::Any > aArgs( 3 );
+
+ aArgs[ 0 ] = uno::makeAny( nWndHandle );
+ aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) );
+ aArgs[ 2 ] = uno::makeAny( reinterpret_cast< sal_IntPtr >( &maChildWindow ) );
+
xPlayerWindow = getPlayer()->createPlayerWindow( aArgs );
+ }
}
catch( uno::RuntimeException )
{
// happens eg, on MacOSX where Java frames cannot be created from X11 window handles
}
-
+
setPlayerWindow( xPlayerWindow );
if( xPlayerWindow.is() )
@@ -260,21 +266,19 @@ void MediaWindowImpl::onURLChanged()
}
else
setPlayerWindow( NULL );
-
+
if( getPlayerWindow().is() )
maChildWindow.Show();
else
maChildWindow.Hide();
-
+
if( mpMediaWindowControl )
{
MediaItem aItem;
-
+
updateMediaItem( aItem );
mpMediaWindowControl->setState( aItem );
}
-
- Invalidate();
}
// ---------------------------------------------------------------------
@@ -282,7 +286,7 @@ void MediaWindowImpl::onURLChanged()
void MediaWindowImpl::update()
{
uno::Reference< media::XPlayerWindow > xPlayerWindow( getPlayerWindow() );
-
+
if( xPlayerWindow.is() )
xPlayerWindow->update();
}
@@ -291,7 +295,7 @@ void MediaWindowImpl::update()
void MediaWindowImpl::setPosSize( const Rectangle& rRect )
{
- SetPosSizePixel( rRect.Left(), rRect.Top(), rRect.GetWidth(), rRect.GetHeight() );
+ SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() );
}
// ---------------------------------------------------------------------
@@ -299,25 +303,24 @@ void MediaWindowImpl::setPosSize( const Rectangle& rRect )
void MediaWindowImpl::setPointer( const Pointer& rPointer )
{
uno::Reference< media::XPlayerWindow > xPlayerWindow( getPlayerWindow() );
-
+
SetPointer( rPointer );
maChildWindow.SetPointer( rPointer );
-
+
if( xPlayerWindow.is() )
{
-
long nPointer;
-
+
switch( rPointer.GetStyle() )
{
case( POINTER_CROSS ): nPointer = awt::SystemPointer::CROSS; break;
case( POINTER_HAND ): nPointer = awt::SystemPointer::HAND; break;
case( POINTER_MOVE ): nPointer = awt::SystemPointer::MOVE; break;
case( POINTER_WAIT ): nPointer = awt::SystemPointer::WAIT; break;
-
+
default: nPointer = awt::SystemPointer::ARROW; break;
}
-
+
xPlayerWindow->setPointerType( nPointer );
}
}
@@ -345,20 +348,20 @@ void MediaWindowImpl::Resize()
const sal_Int32 nOffset( mpMediaWindowControl ? AVMEDIA_CONTROLOFFSET : 0 );
Size aPlayerWindowSize( aCurSize.Width() - ( nOffset << 1 ),
aCurSize.Height() - ( nOffset << 1 ) );
-
+
if( mpMediaWindowControl )
{
const sal_Int32 nControlHeight = mpMediaWindowControl->GetSizePixel().Height();
const sal_Int32 nControlY = ::std::max( aCurSize.Height() - nControlHeight - nOffset, 0L );
-
+
aPlayerWindowSize.Height() = ( nControlY - ( nOffset << 1 ) );
mpMediaWindowControl->SetPosSizePixel( Point( nOffset, nControlY ), Size( aCurSize.Width() - ( nOffset << 1 ), nControlHeight ) );
}
-
- maChildWindow.SetPosSizePixel( Point( nOffset, nOffset ), aPlayerWindowSize );
-
+
if( xPlayerWindow.is() )
xPlayerWindow->setPosSize( 0, 0, aPlayerWindowSize.Width(), aPlayerWindowSize.Height(), 0 );
+
+ maChildWindow.SetPosSizePixel( Point( nOffset, nOffset ), aPlayerWindowSize );
}
// ---------------------------------------------------------------------
@@ -397,25 +400,25 @@ void MediaWindowImpl::StateChanged( StateChangedType eType )
void MediaWindowImpl::Paint( const Rectangle& )
{
BitmapEx* pLogo = NULL;
-
+
if( !getPlayer().is() )
{
if( !mpEmptyBmpEx )
mpEmptyBmpEx = new BitmapEx( AVMEDIA_RESID( AVMEDIA_BMP_EMPTYLOGO ) );
-
+
pLogo = mpEmptyBmpEx;
}
- else if ( !getPlayerWindow().is() )
+ else if( !getPlayerWindow().is() )
{
if( !mpAudioBmpEx )
mpAudioBmpEx = new BitmapEx( AVMEDIA_RESID( AVMEDIA_BMP_AUDIOLOGO ) );
-
+
pLogo = mpAudioBmpEx;
}
const Point aBasePos( maChildWindow.GetPosPixel() );
- const Rectangle aVideoRect( aBasePos, maChildWindow.GetSizePixel() );
-
+ const Rectangle aVideoRect( aBasePos, maChildWindow.GetSizePixel() );
+
if( pLogo && !pLogo->IsEmpty() && ( aVideoRect.GetWidth() > 0 ) && ( aVideoRect.GetHeight() > 0 ) )
{
Size aLogoSize( pLogo->GetSizePixel() );
@@ -424,7 +427,7 @@ void MediaWindowImpl::Paint( const Rectangle& )
SetLineColor( aBackgroundColor );
SetFillColor( aBackgroundColor );
DrawRect( aVideoRect );
-
+
if( ( aLogoSize.Width() > aVideoRect.GetWidth() || aLogoSize.Height() > aVideoRect.GetHeight() ) &&
( aLogoSize.Height() > 0 ) )
{
@@ -442,12 +445,10 @@ void MediaWindowImpl::Paint( const Rectangle& )
}
}
- DrawBitmapEx( Point( aBasePos.X() + ( ( aVideoRect.GetWidth() - aLogoSize.Width() ) >> 1 ),
+ DrawBitmapEx( Point( aBasePos.X() + ( ( aVideoRect.GetWidth() - aLogoSize.Width() ) >> 1 ),
aBasePos.Y() + ( ( aVideoRect.GetHeight() - aLogoSize.Height() ) >> 1 ) ),
aLogoSize, *pLogo );
}
-
- update();
}
// ---------------------------------------------------------------------
diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx
index 1b6f8c60b7..d82c50bcec 100644
--- a/avmedia/source/viewer/mediawindow_impl.hxx
+++ b/avmedia/source/viewer/mediawindow_impl.hxx
@@ -1,11 +1,14 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: mediawindow_impl.hxx,v $
+ * $Revision: 1.3 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -29,7 +32,7 @@
#define _AVMEDIA_MEDIAWINDOW_IMPL_HXX
#include <svtools/transfer.hxx>
-#include <vcl/javachild.hxx>
+#include <vcl/syschild.hxx>
#include "mediawindowbase_impl.hxx"
#include "mediacontrol.hxx"
@@ -43,16 +46,16 @@ namespace avmedia
// ----------------------
// - MediaWindowControl -
// ----------------------
-
+
class MediaWindowControl : public MediaControl
{
public:
-
+
MediaWindowControl( Window* pParent );
~MediaWindowControl();
-
+
protected:
-
+
void update();
void execute( const MediaItem& rItem );
};
@@ -60,16 +63,16 @@ namespace avmedia
// --------------------
// - MediaChildWindow -
// --------------------
-
- class MediaChildWindow : public JavaChildWindow
+
+ class MediaChildWindow : public SystemChildWindow
{
public:
-
+
MediaChildWindow( Window* pParent );
~MediaChildWindow();
-
+
protected:
-
+
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseButtonUp( const MouseEvent& rMEvt );
@@ -77,7 +80,7 @@ namespace avmedia
virtual void KeyUp( const KeyEvent& rKEvt );
virtual void Command( const CommandEvent& rCEvt );
};
-
+
// ------------------.
// - MediaWindowImpl -
// -------------------
@@ -88,7 +91,7 @@ namespace avmedia
public MediaWindowBaseImpl,
public DropTargetHelper,
public DragSourceHelper
-
+
{
public:
@@ -97,18 +100,18 @@ namespace avmedia
virtual void cleanUp();
virtual void onURLChanged();
-
+
public:
-
+
void update();
void setPosSize( const Rectangle& rRect );
-
+
void setPointer( const Pointer& rPointer );
const Pointer& getPointer() const;
-
+
bool hasInternalMediaControl() const;
-
+
protected:
// Window
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index fdfa0b5ae5..db6d1f174e 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -47,8 +47,18 @@ namespace avmedia { namespace priv {
// - MediaWindowBaseImpl -
// -----------------------
+struct ServiceManager
+{
+ const char* pServiceName;
+ sal_Bool bIsJavaBased;
+};
+
+// ---------------------------------------------------------------------
+
+
MediaWindowBaseImpl::MediaWindowBaseImpl( MediaWindow* pMediaWindow ) :
- mpMediaWindow( pMediaWindow )
+ mpMediaWindow( pMediaWindow ),
+ mbIsMediaWindowJavaBased( sal_False )
{
}
@@ -61,35 +71,53 @@ MediaWindowBaseImpl::~MediaWindowBaseImpl()
// -------------------------------------------------------------------------
-uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl::OUString& rURL )
+uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl::OUString& rURL, sal_Bool& rbJavaBased )
{
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
uno::Reference< media::XPlayer > xPlayer;
+ rbJavaBased = sal_False;
+
if( xFactory.is() )
{
- try
+ static const ServiceManager aServiceManagers[] =
{
-
- uno::Reference< ::com::sun::star::media::XManager > xManager(
- xFactory->createInstance( ::rtl::OUString::createFromAscii( AVMEDIA_MANAGER_SERVICE_NAME ) ),
- uno::UNO_QUERY );
-
- if( xManager.is() )
+ { AVMEDIA_MANAGER_SERVICE_NAME, AVMEDIA_MANAGER_SERVICE_IS_JAVABASED },
+ { AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1, AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 }
+ };
+
+ for( sal_uInt32 i = 0; !xPlayer.is() && ( i < ( sizeof( aServiceManagers ) / sizeof( ServiceManager ) ) ); ++i )
+ {
+ const String aServiceName( aServiceManagers[ i ].pServiceName, RTL_TEXTENCODING_ASCII_US );
+
+ if( aServiceName.Len() )
+ {
+ OSL_TRACE( "Trying to create media manager service %s", aServiceManagers[ i ].pServiceName );
+
+ try
+ {
+ uno::Reference< media::XManager > xManager( xFactory->createInstance( aServiceName ), uno::UNO_QUERY );
+
+ if( xManager.is() )
+ {
+ xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ), uno::UNO_QUERY );
+ }
+ }
+ catch( ... )
+ {
+ }
+ }
+
+ if( xPlayer.is() )
{
- xPlayer = uno::Reference< ::com::sun::star::media::XPlayer >(
- xManager->createPlayer( rURL ), uno::UNO_QUERY );
+ rbJavaBased = aServiceManagers[ i ].bIsJavaBased;
}
}
- catch( ... )
- {
- }
}
return xPlayer;
}
-
// ---------------------------------------------------------------------
void MediaWindowBaseImpl::setURL( const ::rtl::OUString& rURL )
@@ -112,7 +140,7 @@ void MediaWindowBaseImpl::setURL( const ::rtl::OUString& rURL )
if( aURL.GetProtocol() != INET_PROT_NOT_VALID )
maFileURL = aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
- mxPlayer = createPlayer( maFileURL );
+ mxPlayer = createPlayer( maFileURL, mbIsMediaWindowJavaBased );
onURLChanged();
}
}
@@ -143,10 +171,7 @@ void MediaWindowBaseImpl::stopPlayingInternal( bool bStop )
{
if( isPlaying() )
{
- if( bStop )
- mxPlayer->stop();
- else
- mxPlayer->start();
+ bStop ? mxPlayer->stop() : mxPlayer->start();
}
}
diff --git a/avmedia/source/viewer/mediawindowbase_impl.hxx b/avmedia/source/viewer/mediawindowbase_impl.hxx
index 0cef83a473..c406ae3664 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.hxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.hxx
@@ -61,7 +61,8 @@ namespace avmedia
virtual void cleanUp();
virtual void onURLChanged();
- static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const ::rtl::OUString& rURL );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const ::rtl::OUString& rURL,
+ sal_Bool& rbJavaBased );
public:
@@ -112,6 +113,7 @@ namespace avmedia
void stopPlayingInternal( bool );
MediaWindow* getMediaWindow() const;
+ inline sal_Bool isMediaWindowJavaBased() const { return( mbIsMediaWindowJavaBased ); }
::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > getPlayer() const;
@@ -124,6 +126,7 @@ namespace avmedia
::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > mxPlayerWindow;
MediaWindow* mpMediaWindow;
+ sal_Bool mbIsMediaWindowJavaBased;
};
}
}
diff --git a/avmedia/source/win/avmediawin.component b/avmedia/source/win/avmediawin.component
new file mode 100644
index 0000000000..c80c19bff0
--- /dev/null
+++ b/avmedia/source/win/avmediawin.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.avmedia.Manager_DirectX">
+ <service name="com.sun.star.media.Manager_DirectX"/>
+ </implementation>
+</component>
diff --git a/avmedia/source/win/exports.dxp b/avmedia/source/win/exports.dxp
index db9c0a52f2..926e49f5f1 100644
--- a/avmedia/source/win/exports.dxp
+++ b/avmedia/source/win/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/avmedia/source/win/makefile.mk b/avmedia/source/win/makefile.mk
index b70841e8bd..37db25b6a8 100644
--- a/avmedia/source/win/makefile.mk
+++ b/avmedia/source/win/makefile.mk
@@ -80,3 +80,11 @@ SHL1STDLIBS += dxguid.lib
.ENDIF
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/avmediawin.component
+
+$(MISC)/avmediawin.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ avmediawin.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt avmediawin.component
diff --git a/avmedia/source/win/winuno.cxx b/avmedia/source/win/winuno.cxx
index 288950f6d0..8a56e3dd77 100644
--- a/avmedia/source/win/winuno.cxx
+++ b/avmedia/source/win/winuno.cxx
@@ -48,33 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// -----------------------
-// - component_writeInfo -
-// -----------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xNewKey1(
- static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
- ::rtl::OUString::createFromAscii( "/com.sun.star.comp.media.Manager_DirectX/UNO/SERVICES/com.sun.star.media.Manager_DirectX" ) ) );
-
- bRet = sal_True;
- }
- catch( registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return bRet;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
@@ -84,13 +57,13 @@ extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void*
uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0;
- if( rtl_str_compare( pImplName, "com.sun.star.comp.media.Manager_DirectX" ) == 0 )
+ if( rtl_str_compare( pImplName, "com.sun.star.comp.avmedia.Manager_DirectX" ) == 0 )
{
const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( "com.sun.star.media.Manager_DirectX" ) );
xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
- ::rtl::OUString::createFromAscii( "com.sun.star.comp.media.Manager_DirectX" ),
+ ::rtl::OUString::createFromAscii( "com.sun.star.comp.avmedia.Manager_DirectX" ),
create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) );
}
diff --git a/avmedia/source/xine/exports.dxp b/avmedia/source/xine/exports.dxp
index db9c0a52f2..926e49f5f1 100644
--- a/avmedia/source/xine/exports.dxp
+++ b/avmedia/source/xine/exports.dxp
@@ -1,4 +1,3 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/avmedia/source/xine/xineuno.cxx b/avmedia/source/xine/xineuno.cxx
index 87c0b53298..52d8bac62c 100644
--- a/avmedia/source/xine/xineuno.cxx
+++ b/avmedia/source/xine/xineuno.cxx
@@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// -----------------------
-// - component_writeInfo -
-// -----------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xNewKey1(
- static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
- ::rtl::OUString::createFromAscii(
- "/" AVMEDIA_XINE_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/"
- AVMEDIA_XINE_MANAGER_SERVICENAME ) ) );
-
- bRet = sal_True;
- }
- catch( registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return bRet;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
diff --git a/avmedia/util/avmedia.component b/avmedia/util/avmedia.component
new file mode 100644
index 0000000000..fa01dc03eb
--- /dev/null
+++ b/avmedia/util/avmedia.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.framework.SoundHandler">
+ <service name="com.sun.star.frame.ContentHandler"/>
+ </implementation>
+</component>
diff --git a/avmedia/util/makefile.mk b/avmedia/util/makefile.mk
index b0d0a6816c..a0712204be 100644
--- a/avmedia/util/makefile.mk
+++ b/avmedia/util/makefile.mk
@@ -77,3 +77,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo LibMain>>$@
@echo CT>>$@
.ENDIF
+
+ALLTAR : $(MISC)/avmedia.component
+
+$(MISC)/avmedia.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ avmedia.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt avmedia.component
diff --git a/basic/inc/basic/process.hxx b/basic/inc/basic/process.hxx
index 066e87aefc..2890d9a910 100644
--- a/basic/inc/basic/process.hxx
+++ b/basic/inc/basic/process.hxx
@@ -39,9 +39,9 @@ typedef Environment::value_type EnvironmentVariable;
class Process
{
// Internal members and methods
- NAMESPACE_VOS(OArgumentList) *pArgumentList;
- NAMESPACE_VOS(OEnvironment) *pEnvList;
- NAMESPACE_VOS(OProcess) *pProcess;
+ vos::OArgumentList *pArgumentList;
+ vos::OEnvironment *pEnvList;
+ vos::OProcess *pProcess;
BOOL ImplIsRunning();
long ImplGetExitCode();
BOOL bWasGPF;
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index 7f401ef69f..ae52ca4046 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -28,10 +28,12 @@
#ifndef _SB_SBMOD_HXX
#define _SB_SBMOD_HXX
+#include <com/sun/star/script/XInvocation.hpp>
#include <basic/sbdef.hxx>
#include <basic/sbxobj.hxx>
#include <basic/sbxdef.hxx>
#include <rtl/ustring.hxx>
+#include <vector>
class SbMethod;
class SbProperty;
@@ -42,6 +44,7 @@ class SbProcedureProperty;
class SbIfaceMapperMethod;
class SbClassModuleObject;
+struct ClassModuleRunInitItem;
struct SbClassData;
class SbModuleImpl;
@@ -55,8 +58,10 @@ class SbModule : public SbxObject
friend class SbClassModuleObject;
SbModuleImpl* mpSbModuleImpl; // Impl data
+ std::vector< String > mModuleVariableNames;
protected:
+ com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper;
::rtl::OUString aOUSource;
String aComment;
SbiImage* pImage; // the Image
@@ -67,6 +72,7 @@ protected:
SbxObjectRef pDocObject; // an impl object ( used by Document Modules )
bool bIsProxyModule;
+ static void implProcessModuleRunInit( ClassModuleRunInitItem& rItem );
void StartDefinitions();
SbMethod* GetMethod( const String&, SbxDataType );
SbProperty* GetProperty( const String&, SbxDataType );
@@ -130,7 +136,10 @@ public:
void SetVBACompat( BOOL bCompat );
INT32 GetModuleType() { return mnType; }
void SetModuleType( INT32 nType ) { mnType = nType; }
- bool GetIsProxyModule() { return bIsProxyModule; }
+ bool isProxyModule() { return bIsProxyModule; }
+ void AddVarName( const String& aName );
+ void RemoveVars();
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule();
bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject );
};
diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx
index 3d638a475f..9ff46d1931 100644
--- a/basic/inc/basic/sbobjmod.hxx
+++ b/basic/inc/basic/sbobjmod.hxx
@@ -36,6 +36,7 @@
#ifndef _SB_OBJMOD_HXX
#define _SB_OBJMOD_HXX
+#include <rtl/ref.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
#include <com/sun/star/script/ModuleInfo.hpp>
@@ -60,10 +61,12 @@ public:
void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ;
};
+class FormObjEventListenerImpl;
+
class SbUserFormModule : public SbObjModule
{
com::sun::star::script::ModuleInfo m_mInfo;
- css::uno::Reference<css::lang::XEventListener> m_DialogListener;
+ ::rtl::Reference< FormObjEventListenerImpl > m_DialogListener;
css::uno::Reference<css::awt::XDialog> m_xDialog;
css::uno::Reference<css::frame::XModel> m_xModel;
String sFormName;
@@ -76,16 +79,19 @@ class SbUserFormModule : public SbObjModule
public:
TYPEINFO();
SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
+ virtual ~SbUserFormModule();
virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
void ResetApiObj();
void Unload();
- void load();
+ void Load();
void triggerMethod( const String& );
void triggerMethod( const String&, css::uno::Sequence< css::uno::Any >& );
void triggerActivateEvent();
- void triggerDeActivateEvent();
+ void triggerDeactivateEvent();
void triggerInitializeEvent();
void triggerTerminateEvent();
+ void triggerLayoutEvent();
+ void triggerResizeEvent();
class SbUserFormModuleInstance* CreateInstance();
};
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
index 0e44b07079..7988c95399 100644
--- a/basic/inc/basic/sbxvar.hxx
+++ b/basic/inc/basic/sbxvar.hxx
@@ -178,7 +178,7 @@ struct SbxValues
sal_uInt64 uInt64;
int nInt;
unsigned int nUInt;
- String* pString;
+ ::rtl::OUString* pOUString;
SbxDecimal* pDecimal;
SbxBase* pObj;
@@ -212,7 +212,7 @@ struct SbxValues
SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {}
SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {}
SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {}
- SbxValues( const String* _pString ): pString( (String*) _pString ), eType(SbxSTRING) {}
+ SbxValues( const ::rtl::OUString* _pString ): pOUString( (::rtl::OUString*)_pString ), eType(SbxSTRING) {}
SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {}
SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {}
SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {}
@@ -237,7 +237,8 @@ class SbxValue : public SbxBase
SbxValue* TheRealValue() const;
protected:
SbxValues aData; // Data
- String aPic; // Picture-String
+ ::rtl::OUString aPic; // Picture-String
+ String aToolString; // tool string copy
virtual void Broadcast( ULONG ); // Broadcast-Call
virtual ~SbxValue();
@@ -303,6 +304,7 @@ public:
UINT16 GetErr() const;
const String& GetString() const;
const String& GetCoreString() const;
+ ::rtl::OUString GetOUString() const;
SbxDecimal* GetDecimal() const;
SbxBase* GetObject() const;
BOOL HasObject() const;
@@ -325,8 +327,8 @@ public:
BOOL PutDate( double );
BOOL PutBool( BOOL );
BOOL PutErr( USHORT );
- BOOL PutStringExt( const String& ); // with extended analysis (International, "TRUE"/"FALSE")
- BOOL PutString( const String& );
+ BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE")
+ BOOL PutString( const ::rtl::OUString& );
BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING
BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR
BOOL PutDecimal( SbxDecimal* pDecimal );
diff --git a/basic/prj/d.lst b/basic/prj/d.lst
index d2a083ebcb..d8d0fce419 100644
--- a/basic/prj/d.lst
+++ b/basic/prj/d.lst
@@ -57,3 +57,4 @@ mkdir: %_DEST%\inc%_EXT%\basic
..\inc\basic\basicmanagerrepository.hxx %_DEST%\inc%_EXT%\basic\basicmanagerrepository.hxx
..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx
+..\%__SRC%\misc\sb.component %_DEST%\xml%_EXT%\sb.component
diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx
index 1ed7f7b3aa..6ade66ef49 100644
--- a/basic/source/app/process.cxx
+++ b/basic/source/app/process.cxx
@@ -72,9 +72,9 @@ BOOL Process::ImplIsRunning()
{
if ( pProcess && bHasBeenStarted )
{
- NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo;
- pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo );
- if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) )
+ vos::OProcess::TProcessInfo aProcessInfo;
+ pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo );
+ if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) )
return TRUE;
else
return FALSE;
@@ -87,9 +87,9 @@ long Process::ImplGetExitCode()
{
if ( pProcess )
{
- NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo;
- pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo );
- if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) )
+ vos::OProcess::TProcessInfo aProcessInfo;
+ pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo );
+ if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) )
SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT );
return aProcessInfo.Code;
}
@@ -124,7 +124,7 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const
nParamCount++;
}
}
- pArgumentList = new NAMESPACE_VOS(OArgumentList)( pParamList, nCount );
+ pArgumentList = new vos::OArgumentList( pParamList, nCount );
::rtl::OUString *pEnvArray = NULL;
@@ -143,12 +143,12 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const
nEnvCount++;
aIter++;
}
- pEnvList = new NAMESPACE_VOS(OEnvironment)( pEnvArray, nEnvCount );
+ pEnvList = new vos::OEnvironment( pEnvArray, nEnvCount );
}
::rtl::OUString aNormalizedAppPath;
osl::FileBase::getFileURLFromSystemPath( ::rtl::OUString(aAppPath), aNormalizedAppPath );
- pProcess = new NAMESPACE_VOS(OProcess)( aNormalizedAppPath );
+ pProcess = new vos::OProcess( aNormalizedAppPath );
bHasBeenStarted = FALSE;
delete [] pParamList;
@@ -170,20 +170,20 @@ BOOL Process::Start()
#endif
if ( pEnvList )
{
- bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption)
- ( NAMESPACE_VOS(OProcess)::TOption_SearchPath
- /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/
- /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ),
+ bSuccess = pProcess->execute( (vos::OProcess::TProcessOption)
+ ( vos::OProcess::TOption_SearchPath
+ /*| vos::OProcess::TOption_Detached*/
+ /*| vos::OProcess::TOption_Wait*/ ),
*pArgumentList,
- *pEnvList ) == NAMESPACE_VOS(OProcess)::E_None;
+ *pEnvList ) == vos::OProcess::E_None;
}
else
{
- bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption)
- ( NAMESPACE_VOS(OProcess)::TOption_SearchPath
- /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/
- /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ),
- *pArgumentList ) == NAMESPACE_VOS(OProcess)::E_None;
+ bSuccess = pProcess->execute( (vos::OProcess::TProcessOption)
+ ( vos::OProcess::TOption_SearchPath
+ /*| vos::OProcess::TOption_Detached*/
+ /*| vos::OProcess::TOption_Wait*/ ),
+ *pArgumentList ) == vos::OProcess::E_None;
}
#ifdef WNT
}
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 247a833b3e..b2e0f58c05 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -67,8 +67,8 @@
#include <com/sun/star/script/XStarBasicLibraryInfo.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
-#include <com/sun/star/script/XVBAModuleInfo.hpp>
-#include <com/sun/star/script/XVBACompat.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
+#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
#include <cppuhelper/implbase1.hxx>
@@ -240,7 +240,7 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
Any aElement = xLibNameAccess->getByName( aModuleName );
::rtl::OUString aMod;
aElement >>= aMod;
- Reference< XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY );
+ Reference< vba::XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY );
if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) )
{
ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aModuleName );
@@ -285,9 +285,9 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
StarBASIC* pLib = mpMgr->GetLib( aName );
if ( pLib )
{
- Reference<XVBACompat> xVBACompat( xScriptCont, UNO_QUERY );
+ Reference< vba::XVBACompatibility > xVBACompat( xScriptCont, UNO_QUERY );
if ( xVBACompat.is() )
- pLib->SetVBAEnabled( xVBACompat->getVBACompatModeOn() );
+ pLib->SetVBAEnabled( xVBACompat->getVBACompatibilityMode() );
}
}
else
@@ -302,7 +302,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
{
::rtl::OUString aMod;
Event.Element >>= aMod;
- Reference< XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY );
+ Reference< vba::XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY );
if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) )
{
ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aName );
diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx
index 82f3c08d61..f6402a8f45 100644
--- a/basic/source/classes/disas.cxx
+++ b/basic/source/classes/disas.cxx
@@ -35,6 +35,7 @@
#include "sb.hxx"
#include "iosys.hxx"
#include "disas.hxx"
+#include "sbtrace.hxx"
static const char* pOp1[] = {
@@ -153,6 +154,7 @@ static const char* pOp3[] = {
"DCREATE_REDIMP", // Change dimensions of a user defined Object-Array (+StringId+StringId)
"FIND_CM", // Search inside a class module (CM) to enable global search in time
"PUBLIC_P", // Module global Variable (persisted between calls)(+StringID+Typ)
+ "FIND_STATIC", // local static var lookup (+StringID+Typ)
};
static const char** pOps[3] = { pOp1, pOp2, pOp3 };
@@ -220,6 +222,7 @@ static const Func pOperand3[] = {
&SbiDisas::Str2Op, // Redimensionate User defined Object-Array (+StringId+StringId)
&SbiDisas::VarOp, // FIND_CM
&SbiDisas::VarDefOp, // PUBLIC_P
+ &SbiDisas::VarOp, // FIND_STATIC
};
// TODO: Why as method? Isn't a simple define sufficient?
@@ -359,6 +362,11 @@ BOOL SbiDisas::DisasLine( String& rText )
rText.Erase();
if( !Fetch() )
return FALSE;
+
+#ifdef DBG_TRACE_BASIC
+ String aTraceStr_STMNT;
+#endif
+
// New line?
if( eOp == _STMNT && nOp1 != nLine )
{
@@ -391,8 +399,13 @@ BOOL SbiDisas::DisasLine( String& rText )
rText.AppendAscii( "; " );
rText += s;
rText.AppendAscii( _crlf() );
+
+#ifdef DBG_TRACE_BASIC
+ aTraceStr_STMNT = s;
+#endif
}
}
+
// Label?
const char* p = "";
if( cLabels[ nPC >> 3 ] & ( 1 << ( nPC & 7 ) ) )
@@ -430,20 +443,29 @@ BOOL SbiDisas::DisasLine( String& rText )
rText.AppendAscii( _crlf() );
}
snprintf( cBuf, sizeof(cBuf), pMask[ nParts ], nPC, (USHORT) eOp, nOp1, nOp2 );
- rText.AppendAscii( cBuf );
+
+ String aPCodeStr;
+ aPCodeStr.AppendAscii( cBuf );
int n = eOp;
if( eOp >= SbOP2_START )
n -= SbOP2_START;
else if( eOp >= SbOP1_START )
n -= SbOP1_START;
- rText += '\t';
- rText.AppendAscii( pOps[ nParts-1 ][ n ] );
- rText += '\t';
+ aPCodeStr += '\t';
+ aPCodeStr.AppendAscii( pOps[ nParts-1 ][ n ] );
+ aPCodeStr += '\t';
switch( nParts )
{
- case 2: (this->*( pOperand2[ n ] ) )( rText ); break;
- case 3: (this->*( pOperand3[ n ] ) )( rText ); break;
+ case 2: (this->*( pOperand2[ n ] ) )( aPCodeStr ); break;
+ case 3: (this->*( pOperand3[ n ] ) )( aPCodeStr ); break;
}
+
+ rText += aPCodeStr;
+
+#ifdef DBG_TRACE_BASIC
+ dbg_RegisterTraceTextForPC( pMod, nPC, aTraceStr_STMNT, aPCodeStr );
+#endif
+
return TRUE;
}
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 4b1efefbdf..16d05a6661 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -255,7 +255,7 @@ Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent )
void BasicScriptListener_Impl::disposing(const EventObject& ) throw ( RuntimeException )
{
// TODO: ???
- //NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+ //vos::OGuard guard( Application::GetSolarMutex() );
//xSbxObj.Clear();
}
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 9be441e011..f8aef3d6d2 100755..100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -57,6 +57,7 @@
#include <vos/mutex.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "errobject.hxx"
+#include <hash_map>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
@@ -339,27 +340,18 @@ SbxBase* SbFormFactory::Create( UINT16, UINT32 )
SbxObject* SbFormFactory::CreateObject( const String& rClassName )
{
- static String aLoadMethodName( RTL_CONSTASCII_USTRINGPARAM("load") );
-
- SbxObject* pRet = NULL;
- SbModule* pMod = pMOD;
- if( pMod )
+ if( SbModule* pMod = pMOD )
{
- SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT );
- if( pVar )
+ if( SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT ) )
{
- SbxBase* pObj = pVar->GetObject();
- SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pObj );
-
- if( pFormModule != NULL )
+ if( SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pVar->GetObject() ) )
{
- pFormModule->load();
- SbUserFormModuleInstance* pFormInstance = pFormModule->CreateInstance();
- pRet = pFormInstance;
+ pFormModule->Load();
+ return pFormModule->CreateInstance();
}
}
}
- return pRet;
+ return 0;
}
@@ -561,6 +553,39 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
USHORT nFlags_ = pProp->GetFlags();
pProp->SetFlag( SBX_NO_BROADCAST );
SbxProperty* pNewProp = new SbxProperty( *pProp );
+
+ // Special handling for modules instances and collections, they need
+ // to be instantiated, otherwise all refer to the same base object
+ SbxDataType eVarType = pProp->GetType();
+ if( eVarType == SbxOBJECT )
+ {
+ SbxBase* pObjBase = pProp->GetObject();
+ SbxObject* pObj = PTR_CAST(SbxObject,pObjBase);
+ if( pObj != NULL )
+ {
+ String aObjClass = pObj->GetClassName();
+ (void)aObjClass;
+
+ SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase);
+ if( pClassModuleObj != NULL )
+ {
+ SbModule* pLclClassModule = pClassModuleObj->getClassModule();
+ SbClassModuleObject* pNewObj = new SbClassModuleObject( pLclClassModule );
+ pNewObj->SetName( pProp->GetName() );
+ pNewObj->SetParent( pLclClassModule->pParent );
+ pNewProp->PutObject( pNewObj );
+ }
+ else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) )
+ {
+ String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") );
+ BasicCollection* pNewCollection = new BasicCollection( aCollectionName );
+ pNewCollection->SetName( pProp->GetName() );
+ pNewCollection->SetParent( pClassModule->pParent );
+ pNewProp->PutObject( pNewCollection );
+ }
+ }
+ }
+
pNewProp->ResetFlag( SBX_NO_BROADCAST );
pNewProp->SetParent( this );
pProps->PutDirect( pNewProp, i );
@@ -569,11 +594,13 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
}
}
SetModuleType( ModuleType::CLASS );
+ mbVBACompat = pClassModule->mbVBACompat;
}
SbClassModuleObject::~SbClassModuleObject()
{
- triggerTerminateEvent();
+ if( StarBASIC::IsRunning() )
+ triggerTerminateEvent();
// Must be deleted by base class dtor because this data
// is not owned by the SbClassModuleObject object
@@ -606,7 +633,28 @@ void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType
{
SbxValues aVals;
aVals.eType = SbxVARIANT;
- pMeth->Get( aVals );
+
+ SbxArray* pArg = pVar->GetParameters();
+ USHORT nVarParCount = (pArg != NULL) ? pArg->Count() : 0;
+ if( nVarParCount > 1 )
+ {
+ SbxArrayRef xMethParameters = new SbxArray;
+ xMethParameters->Put( pMeth, 0 ); // Method as parameter 0
+ for( USHORT i = 1 ; i < nVarParCount ; ++i )
+ {
+ SbxVariable* pPar = pArg->Get( i );
+ xMethParameters->Put( pPar, i );
+ }
+
+ pMeth->SetParameters( xMethParameters );
+ pMeth->Get( aVals );
+ pMeth->SetParameters( NULL );
+ }
+ else
+ {
+ pMeth->Get( aVals );
+ }
+
pVar->Put( aVals );
}
}
@@ -712,6 +760,7 @@ SbClassData::SbClassData( void )
void SbClassData::clear( void )
{
mxIfaces->Clear();
+ maRequiredTypes.clear();
}
SbClassFactory::SbClassFactory( void )
@@ -967,6 +1016,72 @@ SbModule* StarBASIC::FindModule( const String& rName )
return NULL;
}
+
+struct ClassModuleRunInitItem
+{
+ SbModule* m_pModule;
+ bool m_bProcessing;
+ bool m_bRunInitDone;
+ //ModuleVector m_vModulesDependingOnThisModule;
+
+ ClassModuleRunInitItem( void )
+ : m_pModule( NULL )
+ , m_bProcessing( false )
+ , m_bRunInitDone( false )
+ {}
+ ClassModuleRunInitItem( SbModule* pModule )
+ : m_pModule( pModule )
+ , m_bProcessing( false )
+ , m_bRunInitDone( false )
+ {}
+};
+
+typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem,
+ ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap;
+
+static ModuleInitDependencyMap* GpMIDMap = NULL;
+
+void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem )
+{
+ ModuleInitDependencyMap& rMIDMap = *GpMIDMap;
+
+ rItem.m_bProcessing = true;
+
+ //bool bAnyDependencies = true;
+ SbModule* pModule = rItem.m_pModule;
+ if( pModule->pClassData != NULL )
+ {
+ StringVector& rReqTypes = pModule->pClassData->maRequiredTypes;
+ if( rReqTypes.size() > 0 )
+ {
+ for( StringVector::iterator it = rReqTypes.begin() ; it != rReqTypes.end() ; ++it )
+ {
+ String& rStr = *it;
+
+ // Is required type a class module?
+ ModuleInitDependencyMap::iterator itFind = rMIDMap.find( rStr );
+ if( itFind != rMIDMap.end() )
+ {
+ ClassModuleRunInitItem& rParentItem = itFind->second;
+ if( rParentItem.m_bProcessing )
+ {
+ // TODO: raise error?
+ DBG_ERROR( "Cyclic module dependency detected" );
+ continue;
+ }
+
+ if( !rParentItem.m_bRunInitDone )
+ implProcessModuleRunInit( rParentItem );
+ }
+ }
+ }
+ }
+
+ pModule->RunInit();
+ rItem.m_bRunInitDone = true;
+ rItem.m_bProcessing = false;
+}
+
// Run Init-Code of all modules (including inserted libraries)
void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
{
@@ -980,10 +1095,33 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
// compile modules first then RunInit ( otherwise there is
// can be order dependency, e.g. classmodule A has a member
// of of type classmodule B and classmodule B hasn't been compiled yet )
+
+ // Consider required types to init in right order. Class modules
+ // that are required by other modules have to be initialized first.
+ ModuleInitDependencyMap aMIDMap;
+ GpMIDMap = &aMIDMap;
+ for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ )
+ {
+ SbModule* pModule = (SbModule*)pModules->Get( nMod );
+ String aModuleName = pModule->GetName();
+ if( pModule->isProxyModule() )
+ aMIDMap[aModuleName] = ClassModuleRunInitItem( pModule );
+ }
+
+ ModuleInitDependencyMap::iterator it;
+ for( it = aMIDMap.begin() ; it != aMIDMap.end(); ++it )
+ {
+ ClassModuleRunInitItem& rItem = it->second;
+ SbModule::implProcessModuleRunInit( rItem );
+ }
+ GpMIDMap = NULL;
+
+ // Call RunInit on standard modules
for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ )
{
SbModule* pModule = (SbModule*)pModules->Get( nMod );
- pModule->RunInit();
+ if( !pModule->isProxyModule() )
+ pModule->RunInit();
}
// Check all objects if they are BASIC,
@@ -1948,7 +2086,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ )
if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() )
pRes = xItemArray->Get32( nIndex );
if( !pRes )
- SetError( SbxERR_BAD_INDEX );
+ SetError( SbERR_BAD_ARGUMENT );
else
*(pPar_->Get(0)) = *pRes;
}
@@ -1966,6 +2104,6 @@ void BasicCollection::CollRemove( SbxArray* pPar_ )
if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() )
xItemArray->Remove32( nIndex );
else
- SetError( SbxERR_BAD_INDEX );
+ SetError( SbERR_BAD_ARGUMENT );
}
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 291aaa4f7d..c0735bb1b3 100755
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/bridge/oleautomation/Date.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
#include <com/sun/star/bridge/oleautomation/Currency.hpp>
+#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
using com::sun::star::uno::Reference;
@@ -300,7 +301,12 @@ SbUnoObject* createOLEObject_Impl( const String& aType )
SbUnoObject* pUnoObj = NULL;
if( xOLEFactory.is() )
{
- Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aType );
+ // some type names available in VBA can not be directly used in COM
+ ::rtl::OUString aOLEType = aType;
+ if ( aOLEType.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SAXXMLReader30" ) ) ) )
+ aOLEType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Msxml2.SAXXMLReader.3.0" ) );
+
+ Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType );
if( xOLEObject.is() )
{
Any aAny;
@@ -911,7 +917,7 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType )
case SbxVARIANT: aRetType = ::getCppuType( (Any*)0 ); break;
//case SbxDATAOBJECT: break;
case SbxCHAR: aRetType = ::getCppuType( (sal_Unicode*)0 ); break;
- case SbxBYTE: aRetType = ::getCppuType( (sal_Int16*)0 ); break;
+ case SbxBYTE: aRetType = ::getCppuType( (sal_Int8*)0 ); break;
case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break;
case SbxULONG: aRetType = ::getCppuType( (sal_uInt32*)0 ); break;
//case SbxLONG64: break;
@@ -1460,7 +1466,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
aRetVal.setValue( &c , getCharCppuType() );
break;
}
- case TypeClass_STRING: aRetVal <<= ::rtl::OUString( pVar->GetString() ); break;
+ case TypeClass_STRING: aRetVal <<= pVar->GetOUString(); break;
case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break;
case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break;
//case TypeClass_OCTET: break;
@@ -2265,6 +2271,7 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny );
SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
: SbxObject( aName_ )
, bNeedIntrospection( TRUE )
+ , bIgnoreNativeCOMObjectMembers( FALSE )
{
static Reference< XIntrospection > xIntrospection;
@@ -2310,6 +2317,12 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
bNeedIntrospection = FALSE;
return;
}
+
+ // Ignore introspection based members for COM objects to avoid
+ // hiding of equally named COM symbols, e.g. XInvocation::getValue
+ Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY );
+ if( xAutomationObject.is() )
+ bIgnoreNativeCOMObjectMembers = TRUE;
}
maTmpUnoObj = aUnoObj_;
@@ -2553,7 +2566,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
if( !pRes )
{
::rtl::OUString aUName( rName );
- if( mxUnoAccess.is() )
+ if( mxUnoAccess.is() && !bIgnoreNativeCOMObjectMembers )
{
if( mxExactName.is() )
{
@@ -2713,10 +2726,12 @@ void SbUnoObject::implCreateAll( void )
// Instrospection besorgen
Reference< XIntrospectionAccess > xAccess = mxUnoAccess;
- if( !xAccess.is() )
+ if( !xAccess.is() || bIgnoreNativeCOMObjectMembers )
{
if( mxInvocation.is() )
xAccess = mxInvocation->getIntrospection();
+ else if( bIgnoreNativeCOMObjectMembers )
+ return;
}
if( !xAccess.is() )
return;
@@ -3762,7 +3777,7 @@ BasicAllListener_Impl::~BasicAllListener_Impl()
void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet )
{
- NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+ vos::OGuard guard( Application::GetSolarMutex() );
if( xSbxObj.Is() )
{
@@ -3827,7 +3842,7 @@ Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw (
// Methoden von XEventListener
void BasicAllListener_Impl ::disposing(const EventObject& ) throw ( RuntimeException )
{
- NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+ vos::OGuard guard( Application::GetSolarMutex() );
xSbxObj.Clear();
}
@@ -4201,7 +4216,7 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty,
if( !m_bProxyIsClassModuleObject )
throw UnknownPropertyException();
- NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+ vos::OGuard guard( Application::GetSolarMutex() );
::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Set ") );
aPropertyFunctionName += m_aPrefix;
@@ -4242,7 +4257,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty )
if( !m_bProxyIsClassModuleObject )
throw UnknownPropertyException();
- NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+ vos::OGuard guard( Application::GetSolarMutex() );
::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Get ") );
aPropertyFunctionName += m_aPrefix;
@@ -4280,7 +4295,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction,
Sequence< Any >& )
throw( CannotConvertException, InvocationTargetException )
{
- NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() );
+ vos::OGuard guard( Application::GetSolarMutex() );
Any aRet;
if( !m_xScopeObj.Is() )
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 79ab2071c3..834d7316a2 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -45,6 +45,7 @@
#include "runtime.hxx"
#include "token.hxx"
#include "sbunoobj.hxx"
+#include "sbtrace.hxx"
//#include <basic/hilight.hxx>
@@ -53,9 +54,10 @@
#include <basic/basrdll.hxx>
#include <vos/mutex.hxx>
#include <basic/sbobjmod.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/script/ModuleType.hpp>
-#include <com/sun/star/script/XVBACompat.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
using namespace com::sun::star;
@@ -76,15 +78,362 @@ using namespace com::sun::star;
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
#include <vcl/svapp.hxx>
+#include <map>
+#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <basic/sbobjmod.hxx>
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <map>
+#include <com/sun/star/script/XInvocation.hpp>
+
using namespace ::com::sun::star;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::reflection;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::script;
+
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/awt/XDialogProvider.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/anytostring.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+typedef ::cppu::WeakImplHelper1< XInvocation > DocObjectWrapper_BASE;
+typedef ::std::map< sal_Int16, Any, ::std::less< sal_Int16 > > OutParamMap;
+::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar );
+void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& aValue );
+
+class DocObjectWrapper : public DocObjectWrapper_BASE
+{
+ Reference< XAggregation > m_xAggProxy;
+ Reference< XInvocation > m_xAggInv;
+ Reference< XTypeProvider > m_xAggregateTypeProv;
+ Sequence< Type > m_Types;
+ SbModule* m_pMod;
+ SbMethodRef getMethod( const rtl::OUString& aName ) throw (RuntimeException);
+ SbPropertyRef getProperty( const rtl::OUString& aName ) throw (RuntimeException);
+ String mName; // for debugging
+
+public:
+ DocObjectWrapper( SbModule* pMod );
+ virtual ~DocObjectWrapper();
+
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (RuntimeException)
+ {
+ if( !m_xAggregateTypeProv.is() )
+ throw RuntimeException();
+ return m_xAggregateTypeProv->getImplementationId();
+ }
+
+ virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (RuntimeException);
+
+ virtual Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException);
+ virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException);
+ virtual Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (RuntimeException);
+ virtual Any SAL_CALL queryInterface( const Type& aType ) throw ( RuntimeException );
+
+ virtual Sequence< Type > SAL_CALL getTypes() throw ( RuntimeException );
+};
+
+DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pVar->GetName() )
+{
+ SbObjModule* pMod = PTR_CAST(SbObjModule,pVar);
+ if ( pMod )
+ {
+ if ( pMod->GetModuleType() == ModuleType::DOCUMENT )
+ {
+ Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ // Use proxy factory service to create aggregatable proxy.
+ SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pMod->GetObject() );
+ Reference< XInterface > xIf;
+ if ( pUnoObj )
+ {
+ Any aObj = pUnoObj->getUnoAny();
+ aObj >>= xIf;
+ if ( xIf.is() )
+ {
+ m_xAggregateTypeProv.set( xIf, UNO_QUERY );
+ m_xAggInv.set( xIf, UNO_QUERY );
+ }
+ }
+ if ( xIf.is() )
+ {
+ try
+ {
+ Reference< XMultiComponentFactory > xMFac( xFactory, UNO_QUERY_THROW );
+ Reference< XPropertySet> xPSMPropertySet( xMFac, UNO_QUERY_THROW );
+ Reference< XComponentContext > xCtx;
+ xPSMPropertySet->getPropertyValue(
+ String( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xCtx;
+ Reference< XProxyFactory > xProxyFac( xMFac->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.ProxyFactory" ) ), xCtx ), UNO_QUERY_THROW );
+ m_xAggProxy = xProxyFac->createProxy( xIf );
+ }
+ catch( Exception& )
+ {
+ OSL_ENSURE( false, "DocObjectWrapper::DocObjectWrapper: Caught exception!" );
+ }
+ }
+
+ if ( m_xAggProxy.is() )
+ {
+ osl_incrementInterlockedCount( &m_refCount );
+
+ /* i35609 - Fix crash on Solaris. The setDelegator call needs
+ to be in its own block to ensure that all temporary Reference
+ instances that are acquired during the call are released
+ before m_refCount is decremented again */
+ {
+ m_xAggProxy->setDelegator( static_cast< cppu::OWeakObject * >( this ) );
+ }
+
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+ }
+ }
+}
+
+void SAL_CALL
+DocObjectWrapper::acquire() throw ()
+{
+ osl_incrementInterlockedCount( &m_refCount );
+ OSL_TRACE("DocObjectWrapper::acquire(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+}
+void SAL_CALL
+DocObjectWrapper::release() throw ()
+{
+ if ( osl_decrementInterlockedCount( &m_refCount ) == 0 )
+ {
+ OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+ delete this;
+ }
+ else
+ OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount );
+}
+
+DocObjectWrapper::~DocObjectWrapper()
+{
+}
+
+Sequence< Type > SAL_CALL DocObjectWrapper::getTypes()
+ throw ( RuntimeException )
+{
+ if ( m_Types.getLength() == 0 )
+ {
+ Sequence< Type > sTypes;
+ if ( m_xAggregateTypeProv.is() )
+ sTypes = m_xAggregateTypeProv->getTypes();
+ m_Types.realloc( sTypes.getLength() + 1 );
+ Type* pPtr = m_Types.getArray();
+ for ( int i=0; i<m_Types.getLength(); ++i, ++pPtr )
+ {
+ if ( i == 0 )
+ *pPtr = XInvocation::static_type( NULL );
+ else
+ *pPtr = sTypes[ i - 1 ];
+ }
+ }
+ return m_Types;
+}
+
+Reference< XIntrospectionAccess > SAL_CALL
+DocObjectWrapper::getIntrospection( ) throw (RuntimeException)
+{
+ return NULL;
+}
+
+Any SAL_CALL
+DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException)
+{
+ if ( m_xAggInv.is() && m_xAggInv->hasMethod( aFunctionName ) )
+ return m_xAggInv->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
+ SbMethodRef pMethod = getMethod( aFunctionName );
+ if ( !pMethod )
+ throw RuntimeException();
+ // check number of parameters
+ sal_Int32 nParamsCount = aParams.getLength();
+ SbxInfo* pInfo = pMethod->GetInfo();
+ if ( pInfo )
+ {
+ sal_Int32 nSbxOptional = 0;
+ USHORT n = 1;
+ for ( const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) )
+ {
+ if ( ( pParamInfo->nFlags & SBX_OPTIONAL ) != 0 )
+ ++nSbxOptional;
+ else
+ nSbxOptional = 0;
+ }
+ sal_Int32 nSbxCount = n - 1;
+ if ( nParamsCount < nSbxCount - nSbxOptional )
+ {
+ throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "wrong number of parameters!" ) ), Reference< XInterface >() );
+ }
+ }
+ // set parameters
+ SbxArrayRef xSbxParams;
+ if ( nParamsCount > 0 )
+ {
+ xSbxParams = new SbxArray;
+ const Any* pParams = aParams.getConstArray();
+ for ( sal_Int32 i = 0; i < nParamsCount; ++i )
+ {
+ SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
+ unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), pParams[i] );
+ xSbxParams->Put( xSbxVar, static_cast< USHORT >( i ) + 1 );
+
+ // Enable passing by ref
+ if ( xSbxVar->GetType() != SbxVARIANT )
+ xSbxVar->SetFlag( SBX_FIXED );
+ }
+ }
+ if ( xSbxParams.Is() )
+ pMethod->SetParameters( xSbxParams );
+
+ // call method
+ SbxVariableRef xReturn = new SbxVariable;
+ ErrCode nErr = SbxERR_OK;
+
+ nErr = pMethod->Call( xReturn );
+ Any aReturn;
+ // get output parameters
+ if ( xSbxParams.Is() )
+ {
+ SbxInfo* pInfo_ = pMethod->GetInfo();
+ if ( pInfo_ )
+ {
+ OutParamMap aOutParamMap;
+ for ( USHORT n = 1, nCount = xSbxParams->Count(); n < nCount; ++n )
+ {
+ const SbxParamInfo* pParamInfo = pInfo_->GetParam( n );
+ if ( pParamInfo && ( pParamInfo->eType & SbxBYREF ) != 0 )
+ {
+ SbxVariable* pVar = xSbxParams->Get( n );
+ if ( pVar )
+ {
+ SbxVariableRef xVar = pVar;
+ aOutParamMap.insert( OutParamMap::value_type( n - 1, sbxToUnoValue( xVar ) ) );
+ }
+ }
+ }
+ sal_Int32 nOutParamCount = aOutParamMap.size();
+ aOutParamIndex.realloc( nOutParamCount );
+ aOutParam.realloc( nOutParamCount );
+ sal_Int16* pOutParamIndex = aOutParamIndex.getArray();
+ Any* pOutParam = aOutParam.getArray();
+ for ( OutParamMap::iterator aIt = aOutParamMap.begin(); aIt != aOutParamMap.end(); ++aIt, ++pOutParamIndex, ++pOutParam )
+ {
+ *pOutParamIndex = aIt->first;
+ *pOutParam = aIt->second;
+ }
+ }
+ }
+
+ // get return value
+ aReturn = sbxToUnoValue( xReturn );
+
+ pMethod->SetParameters( NULL );
+
+ return aReturn;
+}
+
+void SAL_CALL
+DocObjectWrapper::setValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException)
+{
+ if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) )
+ return m_xAggInv->setValue( aPropertyName, aValue );
+
+ SbPropertyRef pProperty = getProperty( aPropertyName );
+ if ( !pProperty.Is() )
+ throw UnknownPropertyException();
+ unoToSbxValue( (SbxVariable*) pProperty, aValue );
+}
+
+Any SAL_CALL
+DocObjectWrapper::getValue( const ::rtl::OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException)
+{
+ if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) )
+ return m_xAggInv->getValue( aPropertyName );
+
+ SbPropertyRef pProperty = getProperty( aPropertyName );
+ if ( !pProperty.Is() )
+ throw UnknownPropertyException();
+
+ SbxVariable* pProp = ( SbxVariable* ) pProperty;
+ if ( pProp->GetType() == SbxEMPTY )
+ pProperty->Broadcast( SBX_HINT_DATAWANTED );
+
+ Any aRet = sbxToUnoValue( pProp );
+ return aRet;
+}
+
+::sal_Bool SAL_CALL
+DocObjectWrapper::hasMethod( const ::rtl::OUString& aName ) throw (RuntimeException)
+{
+ if ( m_xAggInv.is() && m_xAggInv->hasMethod( aName ) )
+ return sal_True;
+ return getMethod( aName ).Is();
+}
+
+::sal_Bool SAL_CALL
+DocObjectWrapper::hasProperty( const ::rtl::OUString& aName ) throw (RuntimeException)
+{
+ sal_Bool bRes = sal_False;
+ if ( m_xAggInv.is() && m_xAggInv->hasProperty( aName ) )
+ bRes = sal_True;
+ else bRes = getProperty( aName ).Is();
+ return bRes;
+}
+
+Any SAL_CALL DocObjectWrapper::queryInterface( const Type& aType )
+ throw ( RuntimeException )
+{
+ Any aRet = DocObjectWrapper_BASE::queryInterface( aType );
+ if ( aRet.hasValue() )
+ return aRet;
+ else if ( m_xAggProxy.is() )
+ aRet = m_xAggProxy->queryAggregation( aType );
+ return aRet;
+}
+
+SbMethodRef DocObjectWrapper::getMethod( const rtl::OUString& aName ) throw (RuntimeException)
+{
+ SbMethodRef pMethod = NULL;
+ if ( m_pMod )
+ {
+ USHORT nSaveFlgs = m_pMod->GetFlags();
+ // Limit search to this module
+ m_pMod->ResetFlag( SBX_GBLSEARCH );
+ pMethod = (SbMethod*) m_pMod->SbModule::Find( aName, SbxCLASS_METHOD );
+ m_pMod->SetFlags( nSaveFlgs );
+ }
+
+ return pMethod;
+}
+
+SbPropertyRef DocObjectWrapper::getProperty( const rtl::OUString& aName ) throw (RuntimeException)
+{
+ SbPropertyRef pProperty = NULL;
+ if ( m_pMod )
+ {
+ USHORT nSaveFlgs = m_pMod->GetFlags();
+ // Limit search to this module.
+ m_pMod->ResetFlag( SBX_GBLSEARCH );
+ pProperty = (SbProperty*)m_pMod->SbModule::Find( aName, SbxCLASS_PROPERTY );
+ m_pMod->SetFlag( nSaveFlgs );
+ }
+
+ return pProperty;
+}
TYPEINIT1(SbModule,SbxObject)
TYPEINIT1(SbMethod,SbxMethod)
@@ -112,9 +461,9 @@ bool getDefaultVBAMode( StarBASIC* pb )
uno::Reference< beans::XPropertySet > xProp( aDoc, uno::UNO_QUERY );
if ( xProp.is() )
{
- uno::Reference< script::XVBACompat > xVBAMode( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY );
+ uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY );
if ( xVBAMode.is() )
- bResult = ( xVBAMode->getVBACompatModeOn() == sal_True );
+ bResult = xVBAMode->getVBACompatibilityMode() == sal_True;
}
}
}
@@ -199,12 +548,24 @@ SbModule::SbModule( const String& rName, BOOL bVBACompat )
SbModule::~SbModule()
{
+ OSL_TRACE("Module named %s is destructing", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr() );
if( pImage )
delete pImage;
if( pBreaks )
delete pBreaks;
if( pClassData )
delete pClassData;
+ mxWrapper = NULL;
+}
+
+uno::Reference< script::XInvocation >
+SbModule::GetUnoModule()
+{
+ if ( !mxWrapper.is() )
+ mxWrapper = new DocObjectWrapper( this );
+
+ OSL_TRACE("Module named %s returning wrapper mxWrapper (0x%x)", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), mxWrapper.get() );
+ return mxWrapper;
}
BOOL SbModule::IsCompiled() const
@@ -684,6 +1045,9 @@ USHORT SbModule::Run( SbMethod* pMeth )
StarBASICRef xBasic;
if( bDelInst )
{
+#ifdef DBG_TRACE_BASIC
+ dbg_InitTrace();
+#endif
// #32779: Basic waehrend der Ausfuehrung festhalten
xBasic = (StarBASIC*) GetParent();
@@ -762,18 +1126,28 @@ USHORT SbModule::Run( SbMethod* pMeth )
SbModule* pOldMod = pMOD;
pMOD = this;
SbiRuntime* pRt = new SbiRuntime( this, pMeth, pMeth->nStart );
+
+#ifdef DBG_TRACE_BASIC
+ dbg_traceNotifyCall( this, pMeth, pINST->nCallLvl );
+#endif
+
pRt->pNext = pINST->pRun;
if( pRt->pNext )
pRt->pNext->block();
pINST->pRun = pRt;
if ( mbVBACompat )
- {
+ {
pINST->EnableCompatibility( TRUE );
- }
+ }
while( pRt->Step() ) {}
if( pRt->pNext )
pRt->pNext->unblock();
+#ifdef DBG_TRACE_BASIC
+ bool bLeave = true;
+ dbg_traceNotifyCall( this, pMeth, pINST->nCallLvl, bLeave );
+#endif
+
// #63710 Durch ein anderes Thread-Handling bei Events kann es passieren,
// dass show-Aufruf an einem Dialog zurueckkehrt (durch schliessen des
// Dialogs per UI), BEVOR ein per Event ausgeloester weitergehender Call,
@@ -867,9 +1241,20 @@ void SbModule::RunInit()
pMOD = this;
// Der Init-Code beginnt immer hier
SbiRuntime* pRt = new SbiRuntime( this, NULL, 0 );
+
+#ifdef DBG_TRACE_BASIC
+ dbg_traceNotifyCall( this, NULL, 0 );
+#endif
+
pRt->pNext = pINST->pRun;
pINST->pRun = pRt;
while( pRt->Step() ) {}
+
+#ifdef DBG_TRACE_BASIC
+ bool bLeave = true;
+ dbg_traceNotifyCall( this, NULL, 0, bLeave );
+#endif
+
pINST->pRun = pRt->pNext;
delete pRt;
pMOD = pOldMod;
@@ -884,6 +1269,33 @@ void SbModule::RunInit()
}
// Mit private/dim deklarierte Variablen loeschen
+
+void SbModule::AddVarName( const String& aName )
+{
+ // see if the name is added allready
+ std::vector< String >::iterator it_end = mModuleVariableNames.end();
+ for ( std::vector< String >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it )
+ {
+ if ( aName == *it )
+ return;
+ }
+ mModuleVariableNames.push_back( aName );
+}
+
+void SbModule::RemoveVars()
+{
+ std::vector< String >::iterator it_end = mModuleVariableNames.end();
+ for ( std::vector< String >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it )
+ {
+ // We don't want a Find being called in a derived class ( e.g.
+ // SbUserform because it could trigger say an initialise event
+ // which would cause basic to be re-run in the middle of the init ( and remember RemoveVars is called from compile and we don't want code to run as part of the compile )
+ SbxVariableRef p = SbModule::Find( *it, SbxCLASS_PROPERTY );
+ if( p.Is() )
+ Remove (p);
+ }
+}
+
void SbModule::ClearPrivateVars()
{
for( USHORT i = 0 ; i < pProps->Count() ; i++ )
@@ -1600,9 +2012,9 @@ SbObjModule::Find( const XubString& rName, SbxClassType t )
return pVar;
}
-typedef ::cppu::WeakImplHelper1< awt::XTopWindowListener > EventListener_BASE;
+typedef ::cppu::WeakImplHelper2< awt::XTopWindowListener, awt::XWindowListener > FormObjEventListener_BASE;
-class FormObjEventListenerImpl : public EventListener_BASE
+class FormObjEventListenerImpl : public FormObjEventListener_BASE
{
SbUserFormModule* mpUserForm;
uno::Reference< lang::XComponent > mxComponent;
@@ -1612,39 +2024,57 @@ class FormObjEventListenerImpl : public EventListener_BASE
sal_Bool mbShowing;
FormObjEventListenerImpl(); // not defined
FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
+
public:
- FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False )
+ FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) :
+ mpUserForm( pUserForm ), mxComponent( xComponent) ,
+ mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False )
{
if ( mxComponent.is() )
{
- uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
- OSL_TRACE("*********** Registering the listener");
- xList->addTopWindowListener( this );
+ OSL_TRACE("*********** Registering the listeners");
+ try
+ {
+ uno::Reference< awt::XTopWindow >( mxComponent, uno::UNO_QUERY_THROW )->addTopWindowListener( this );
+ }
+ catch( uno::Exception& ) {}
+ try
+ {
+ uno::Reference< awt::XWindow >( mxComponent, uno::UNO_QUERY_THROW )->addWindowListener( this );
+ }
+ catch( uno::Exception& ) {}
}
}
- ~FormObjEventListenerImpl()
+ virtual ~FormObjEventListenerImpl()
{
removeListener();
}
- sal_Bool isShowing() { return mbShowing; }
+
+ sal_Bool isShowing() const { return mbShowing; }
+
void removeListener()
{
- try
+ if ( mxComponent.is() && !mbDisposed )
{
- if ( mxComponent.is() && !mbDisposed )
+ OSL_TRACE("*********** Removing the listeners");
+ try
{
- uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
- OSL_TRACE("*********** Removing the listener");
- xList->removeTopWindowListener( this );
- mxComponent = NULL;
+ uno::Reference< awt::XTopWindow >( mxComponent, uno::UNO_QUERY_THROW )->removeTopWindowListener( this );
}
+ catch( uno::Exception& ) {}
+ try
+ {
+ uno::Reference< awt::XWindow >( mxComponent, uno::UNO_QUERY_THROW )->removeWindowListener( this );
+ }
+ catch( uno::Exception& ) {}
}
- catch( uno::Exception& ) {}
- }
+ mxComponent.clear();
+ }
+
virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
{
- if ( mpUserForm )
+ if ( mpUserForm )
{
mbOpened = sal_True;
mbShowing = sal_True;
@@ -1691,12 +2121,23 @@ public:
}
//liuchen 2009-7-21
- virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) { mbOpened = sal_False; mbShowing = sal_False; }
- virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
- virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException){}
+ virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ mbOpened = sal_False;
+ mbShowing = sal_False;
+ }
+
+ virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ }
+
+ virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ }
+
virtual void SAL_CALL windowActivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
{
- if ( mpUserForm )
+ if ( mpUserForm )
{
mbActivated = sal_True;
if ( mbOpened )
@@ -1709,18 +2150,38 @@ public:
virtual void SAL_CALL windowDeactivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
{
- if ( mpUserForm )
- mpUserForm->triggerDeActivateEvent();
+ if ( mpUserForm )
+ mpUserForm->triggerDeactivateEvent();
}
+ virtual void SAL_CALL windowResized( const awt::WindowEvent& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ {
+ mpUserForm->triggerResizeEvent();
+ mpUserForm->triggerLayoutEvent();
+ }
+ }
- virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException)
+ virtual void SAL_CALL windowMoved( const awt::WindowEvent& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ mpUserForm->triggerLayoutEvent();
+ }
+
+ virtual void SAL_CALL windowShown( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ }
+
+ virtual void SAL_CALL windowHidden( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ }
+
+ virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException)
{
OSL_TRACE("** Userform/Dialog disposing");
mbDisposed = true;
- uno::Any aSource;
- aSource <<= Source;
- mxComponent = NULL;
+ mxComponent.clear();
if ( mpUserForm )
mpUserForm->ResetApiObj();
}
@@ -1734,6 +2195,10 @@ SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::s
m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW );
}
+SbUserFormModule::~SbUserFormModule()
+{
+}
+
void SbUserFormModule::ResetApiObj()
{
if ( m_xDialog.is() ) // probably someone close the dialog window
@@ -1796,23 +2261,22 @@ void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any
void SbUserFormModule::triggerActivateEvent( void )
{
- OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
- triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") ) );
- OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
+ OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
+ triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_Activate") ) );
+ OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
}
-void SbUserFormModule::triggerDeActivateEvent( void )
+void SbUserFormModule::triggerDeactivateEvent( void )
{
- OSL_TRACE("**** SbUserFormModule::triggerDeActivate");
- triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") ) );
+ OSL_TRACE("**** SbUserFormModule::triggerDeactivate");
+ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_Deactivate") ) );
}
void SbUserFormModule::triggerInitializeEvent( void )
-
{
if ( mbInit )
return;
- OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
+ OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
triggerMethod( aInitMethodName );
mbInit = true;
@@ -1820,12 +2284,24 @@ void SbUserFormModule::triggerInitializeEvent( void )
void SbUserFormModule::triggerTerminateEvent( void )
{
- OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
+ OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
triggerMethod( aTermMethodName );
mbInit=false;
}
+void SbUserFormModule::triggerLayoutEvent( void )
+{
+ static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Layout") );
+ triggerMethod( aMethodName );
+}
+
+void SbUserFormModule::triggerResizeEvent( void )
+{
+ static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Resize") );
+ triggerMethod( aMethodName );
+}
+
SbUserFormModuleInstance* SbUserFormModule::CreateInstance()
{
SbUserFormModuleInstance* pInstance = new SbUserFormModuleInstance( this, GetName(), m_mInfo, IsVBACompat() );
@@ -1853,7 +2329,7 @@ SbxVariable* SbUserFormModuleInstance::Find( const XubString& rName, SbxClassTyp
}
-void SbUserFormModule::load()
+void SbUserFormModule::Load()
{
OSL_TRACE("** load() ");
// forces a load
@@ -1891,21 +2367,20 @@ void SbUserFormModule::Unload()
if( pMeth )
{
OSL_TRACE("Attempting too run the UnloadObjectMethod");
- m_xDialog = NULL; //release ref to the uno object
+ m_xDialog.clear(); //release ref to the uno object
SbxValues aVals;
- FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
bool bWaitForDispose = true; // assume dialog is showing
- if ( pFormListener )
+ if ( m_DialogListener.get() )
{
- bWaitForDispose = pFormListener->isShowing();
+ bWaitForDispose = m_DialogListener->isShowing();
OSL_TRACE("Showing %d", bWaitForDispose );
}
pMeth->Get( aVals);
- if ( !bWaitForDispose )
- {
- // we've either already got a dispose or we'er never going to get one
+ if ( !bWaitForDispose )
+ {
+ // we've either already got a dispose or we'er never going to get one
ResetApiObj();
- } // else wait for dispose
+ } // else wait for dispose
OSL_TRACE("UnloadObject completed ( we hope )");
}
}
@@ -1943,13 +2418,12 @@ void SbUserFormModule::InitObject()
pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.UserForm")), aArgs ) ) );
uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW );
// remove old listener if it exists
- FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
- if ( pFormListener )
- pFormListener->removeListener();
+ if ( m_DialogListener.get() )
+ m_DialogListener->removeListener();
m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
triggerInitializeEvent();
- }
+ }
}
catch( uno::Exception& )
{
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index c7e8f1101c..256dcf92e0 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -138,11 +138,10 @@ void SbiCodeGen::Save()
pCLASSFAC->AddClassModule( &rMod );
nIfaceCount = pParser->aIfaceVector.size();
+ if( !rMod.pClassData )
+ rMod.pClassData = new SbClassData;
if( nIfaceCount )
{
- if( !rMod.pClassData )
- rMod.pClassData = new SbClassData;
-
for( int i = 0 ; i < nIfaceCount ; i++ )
{
const String& rIfaceName = pParser->aIfaceVector[i];
@@ -152,6 +151,8 @@ void SbiCodeGen::Save()
pIfaces->Insert( pIfaceVar, pIfaces->Count() );
}
}
+
+ rMod.pClassData->maRequiredTypes = pParser->aRequiredTypes;
}
else
{
@@ -161,6 +162,7 @@ void SbiCodeGen::Save()
rMod.mnType = com::sun::star::script::ModuleType::NORMAL;
rMod.bIsProxyModule = false;
}
+
if( pParser->bText )
p->SetFlag( SBIMG_COMPARETEXT );
// GlobalCode-Flag
@@ -257,6 +259,10 @@ void SbiCodeGen::Save()
if( !pProc->IsPublic() )
pMeth->SetFlag( SBX_PRIVATE );
+ // Declare? -> Hidden
+ if( pProc->GetLib().Len() > 0 )
+ pMeth->SetFlag( SBX_HIDDEN );
+
pMeth->nStart = pProc->GetAddr();
pMeth->nLine1 = pProc->GetLine1();
pMeth->nLine2 = pProc->GetLine2();
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index b5131c99f1..367be2a3e3 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -161,6 +161,9 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed )
// In den String-Pool uebernehmen
rDef.SetTypeId( aGblStrings.Add( aCompleteName ) );
+
+ if( rDef.IsNew() && pProc == NULL )
+ aRequiredTypes.push_back( aCompleteName );
}
eType = SbxOBJECT;
break;
@@ -874,7 +877,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
}
if( bCompatible && Peek() == PARAMARRAY )
{
- if( bByVal || bByVal || bOptional )
+ if( bByVal || bOptional )
Error( SbERR_UNEXPECTED, PARAMARRAY );
Next();
bParamArray = TRUE;
@@ -946,6 +949,8 @@ void SbiParser::DefDeclare( BOOL bPrivate )
Error( SbERR_UNEXPECTED, eCurTok );
else
{
+ bool bFunction = (eCurTok == FUNCTION);
+
SbiProcDef* pDef = ProcDecl( TRUE );
if( pDef )
{
@@ -970,7 +975,70 @@ void SbiParser::DefDeclare( BOOL bPrivate )
aPublics.Add( pDef );
if ( pDef )
+ {
pDef->SetPublic( !bPrivate );
+
+ // New declare handling
+ if( pDef->GetLib().Len() > 0 )
+ {
+ if( bNewGblDefs && nGblChain == 0 )
+ {
+ nGblChain = aGen.Gen( _JUMP, 0 );
+ bNewGblDefs = FALSE;
+ }
+
+ USHORT nSavLine = nLine;
+ aGen.Statement();
+ pDef->Define();
+ pDef->SetLine1( nSavLine );
+ pDef->SetLine2( nSavLine );
+
+ SbiSymPool& rPool = pDef->GetParams();
+ USHORT nParCount = rPool.GetSize();
+
+ SbxDataType eType = pDef->GetType();
+ if( bFunction )
+ aGen.Gen( _PARAM, 0, sal::static_int_cast< UINT16 >( eType ) );
+
+ if( nParCount > 1 )
+ {
+ aGen.Gen( _ARGC );
+
+ for( USHORT i = 1 ; i < nParCount ; ++i )
+ {
+ SbiSymDef* pParDef = rPool.Get( i );
+ SbxDataType eParType = pParDef->GetType();
+
+ aGen.Gen( _PARAM, i, sal::static_int_cast< UINT16 >( eParType ) );
+ aGen.Gen( _ARGV );
+
+ USHORT nTyp = sal::static_int_cast< USHORT >( pParDef->GetType() );
+ if( pParDef->IsByVal() )
+ {
+ // Reset to avoid additional byval in call to wrapper function
+ pParDef->SetByVal( FALSE );
+ nTyp |= 0x8000;
+ }
+ aGen.Gen( _ARGTYP, nTyp );
+ }
+ }
+
+ aGen.Gen( _LIB, aGblStrings.Add( pDef->GetLib() ) );
+
+ SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL;
+ USHORT nId = pDef->GetId();
+ if( pDef->GetAlias().Len() )
+ nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() );
+ if( nParCount > 1 )
+ nId |= 0x8000;
+ aGen.Gen( eOp, nId, sal::static_int_cast< UINT16 >( eType ) );
+
+ if( bFunction )
+ aGen.Gen( _PUT );
+
+ aGen.Gen( _LEAVE );
+ }
+ }
}
}
}
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 82b2d39dcf..ea2dd286da 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -115,13 +115,8 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
}
else
{
- SbiProcDef* pProc = aVar.pDef->GetProcDef();
- // per DECLARE definiert?
- if( pProc && pProc->GetLib().Len() )
- eOp = pProc->IsCdecl() ? _CALLC : _CALL;
- else
- eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL :
- (aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
+ eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL :
+ (aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
}
if( eOp == _FIND )
@@ -187,17 +182,6 @@ void SbiExprNode::GenElement( SbiOpcode eOp )
aVar.pPar->Gen();
}
- SbiProcDef* pProc = aVar.pDef->GetProcDef();
- // per DECLARE definiert?
- if( pProc )
- {
- // Dann evtl. einen LIB-Befehl erzeugen
- if( pProc->GetLib().Len() )
- pGen->Gen( _LIB, pGen->GetParser()->aGblStrings.Add( pProc->GetLib() ) );
- // und den Aliasnamen nehmen
- if( pProc->GetAlias().Len() )
- nId = ( nId & 0x8000 ) | pGen->GetParser()->aGblStrings.Add( pProc->GetAlias() );
- }
pGen->Gen( eOp, nId, sal::static_int_cast< UINT16 >( GetType() ) );
if( aVar.pvMorePar )
@@ -223,13 +207,8 @@ void SbiExprList::Gen()
{
pParser->aGen.Gen( _ARGC );
// AB 10.1.96: Typ-Anpassung bei DECLARE
- USHORT nCount = 1, nParAnz = 0;
- SbiSymPool* pPool = NULL;
- if( pProc )
- {
- pPool = &pProc->GetParams();
- nParAnz = pPool->GetSize();
- }
+ USHORT nCount = 1 /*, nParAnz = 0*/;
+// SbiSymPool* pPool = NULL;
for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ )
{
pExpr->Gen();
@@ -239,6 +218,7 @@ void SbiExprList::Gen()
USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() );
pParser->aGen.Gen( _ARGN, nSid );
+ /* TODO: Check after Declare concept change
// AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen
if( pProc )
{
@@ -246,39 +226,26 @@ void SbiExprList::Gen()
pParser->Error( SbERR_NO_NAMED_ARGS );
// Spaeter, wenn Named Args bei DECLARE moeglich
- /*
- for( USHORT i = 1 ; i < nParAnz ; i++ )
- {
- SbiSymDef* pDef = pPool->Get( i );
- const String& rName = pDef->GetName();
- if( rName.Len() )
- {
- if( pExpr->GetName().ICompare( rName )
- == COMPARE_EQUAL )
- {
- pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
- break;
- }
- }
- }
- */
+ //for( USHORT i = 1 ; i < nParAnz ; i++ )
+ //{
+ // SbiSymDef* pDef = pPool->Get( i );
+ // const String& rName = pDef->GetName();
+ // if( rName.Len() )
+ // {
+ // if( pExpr->GetName().ICompare( rName )
+ // == COMPARE_EQUAL )
+ // {
+ // pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
+ // break;
+ // }
+ // }
+ //}
}
+ */
}
else
{
pParser->aGen.Gen( _ARGV );
-
- // Funktion mit DECLARE -> Typ-Anpassung
- if( pProc && nCount < nParAnz )
- {
- SbiSymDef* pDef = pPool->Get( nCount );
- USHORT nTyp = sal::static_int_cast< USHORT >(
- pDef->GetType() );
- // Zusätzliches Flag für BYVAL einbauen
- if( pDef->IsByVal() )
- nTyp |= 0x8000;
- pParser->aGen.Gen( _ARGTYP, nTyp );
- }
}
}
}
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 604ac61745..f858c428af 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -338,15 +338,6 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
// damit erwischen wir n% = 5 : print n
eType = eDefType;
}
- // Funktion?
- if( pDef->GetProcDef() )
- {
- SbiProcDef* pProc = pDef->GetProcDef();
- if( pPar && pProc->GetLib().Len() ) // DECLARE benutzt?
- pPar->SetProc( pProc );
- // Wenn keine Pars, vorerst nichts machen
- // Pruefung auf Typ-Anzahl waere denkbar
- }
// Typcheck bei Variablen:
// ist explizit im Scanner etwas anderes angegeben?
// Bei Methoden ist dies OK!
@@ -868,7 +859,6 @@ SbiExprList::SbiExprList( SbiParser* p )
{
pParser = p;
pFirst = NULL;
- pProc = NULL;
nExpr =
nDim = 0;
bError =
@@ -1009,13 +999,8 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa
else
pExpr = new SbiExpression( pParser );
- if( bByVal )
- {
- if( !pExpr->IsLvalue() )
- pParser->Error( SbERR_LVALUE_EXPECTED );
- else
- pExpr->SetByVal();
- }
+ if( bByVal && pExpr->IsLvalue() )
+ pExpr->SetByVal();
//pExpr = bConst ? new SbiConstExpression( pParser )
// : new SbiExpression( pParser );
diff --git a/basic/source/comp/makefile.mk b/basic/source/comp/makefile.mk
index bd3c750df3..d65f6a431e 100644
--- a/basic/source/comp/makefile.mk
+++ b/basic/source/comp/makefile.mk
@@ -34,39 +34,26 @@ TARGET=comp
.INCLUDE : settings.mk
-CXXFILES= \
- sbcomp.cxx \
- dim.cxx \
- exprtree.cxx \
- exprnode.cxx \
- exprgen.cxx \
- codegen.cxx \
- io.cxx \
- loops.cxx \
- parser.cxx \
- scanner.cxx \
- token.cxx \
- symtbl.cxx \
- buffer.cxx
-
SLOFILES= \
- $(SLO)$/sbcomp.obj \
+ $(SLO)$/buffer.obj \
+ $(SLO)$/codegen.obj \
$(SLO)$/dim.obj \
- $(SLO)$/exprtree.obj \
- $(SLO)$/exprnode.obj \
$(SLO)$/exprgen.obj \
- $(SLO)$/codegen.obj \
+ $(SLO)$/exprnode.obj \
+ $(SLO)$/exprtree.obj \
$(SLO)$/io.obj \
$(SLO)$/loops.obj \
$(SLO)$/parser.obj \
+ $(SLO)$/sbcomp.obj \
$(SLO)$/scanner.obj \
- $(SLO)$/token.obj \
$(SLO)$/symtbl.obj \
- $(SLO)$/buffer.obj
+ $(SLO)$/token.obj
EXCEPTIONSFILES= \
- $(SLO)$/parser.obj \
- $(SLO)$/exprtree.obj
+ $(SLO)$/codegen.obj \
+ $(SLO)$/dim.obj \
+ $(SLO)$/exprtree.obj \
+ $(SLO)$/parser.obj
# --- Targets --------------------------------------------------------------
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index c91624de5e..f9cd852efc 100644..100755
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -22,7 +22,7 @@
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
- *
+ *
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
@@ -31,10 +31,310 @@
#include <basic/sbx.hxx>
#include "sbcomp.hxx"
#include "image.hxx"
+#include "sbtrace.hxx"
+
+
+//==========================================================================
+// Tracing, for debugging only
+
+// To activate tracing enable in sbtrace.hxx
+#ifdef DBG_TRACE_BASIC
+
+#include <hash_map>
+
+// Trace Settings
+static const char* GpTraceFileName = "d:\\zBasic.Asm\\BasicTrace.txt";
+static const bool GbIncludePCodes = false;
+static const int GnIndentPerCallLevel = 4;
+static const int GnIndentForPCode = 2;
+
+struct TraceTextData
+{
+ rtl::OString m_aTraceStr_STMNT;
+ rtl::OString m_aTraceStr_PCode;
+};
+typedef std::hash_map< sal_Int32, TraceTextData > PCToTextDataMap;
+typedef std::hash_map< ::rtl::OUString, PCToTextDataMap*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleTraceMap;
+
+ModuleTraceMap GaModuleTraceMap;
+ModuleTraceMap& rModuleTraceMap = GaModuleTraceMap;
+
+static void lcl_PrepareTraceForModule( SbModule* pModule )
+{
+ String aModuleName = pModule->GetName();
+ ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
+ if( it != rModuleTraceMap.end() )
+ {
+ PCToTextDataMap* pInnerMap = it->second;
+ delete pInnerMap;
+ rModuleTraceMap.erase( it );
+ }
+
+ String aDisassemblyStr;
+ pModule->Disassemble( aDisassemblyStr );
+}
+
+static void lcl_lineOut( const char* pFileName, const char* pStr, const char* pPreStr = NULL )
+{
+ const char* pPrintFirst = (pPreStr != NULL) ? pPreStr : "";
+ FILE* pFile = fopen( pFileName, "a+" );
+ if( pFile != NULL )
+ {
+ fprintf( pFile, "%s%s\n", pPrintFirst, pStr );
+ fclose( pFile );
+ }
+}
+
+const char* lcl_getSpaces( int nSpaceCount )
+{
+ static sal_Char Spaces[] = " "
+ " "
+ " ";
+ static int nAvailableSpaceCount = strlen( Spaces );
+ static sal_Char* pSpacesEnd = Spaces + nAvailableSpaceCount;
+
+ if( nSpaceCount > nAvailableSpaceCount )
+ nSpaceCount = nAvailableSpaceCount;
+
+ return pSpacesEnd - nSpaceCount;
+}
+
+static rtl::OString lcl_toOStringSkipLeadingWhites( const String& aStr )
+{
+ static sal_Char Buffer[1000];
+
+ rtl::OString aOStr = OUStringToOString( rtl::OUString( aStr ), RTL_TEXTENCODING_ASCII_US );
+ const sal_Char* pStr = aOStr.getStr();
+ // Skip whitespace
+ sal_Char c = *pStr;
+ while( c == ' ' || c == '\t' )
+ {
+ pStr++;
+ c = *pStr;
+ }
+
+ int nLen = strlen( pStr );
+ strncpy( Buffer, pStr, nLen );
+ Buffer[nLen] = 0;
+
+ rtl::OString aORetStr( Buffer );
+ return aORetStr;
+}
+
+String dumpMethodParameters( SbMethod* pMethod )
+{
+ String aStr;
+ if( pMethod == NULL )
+ return aStr;
+
+ SbxError eOld = SbxBase::GetError();
+
+ SbxArray* pParams = pMethod->GetParameters();
+ SbxInfo* pInfo = pMethod->GetInfo();
+ if ( pParams )
+ {
+ aStr += '(';
+ // 0 is sub itself
+ for ( USHORT nParam = 1; nParam < pParams->Count(); nParam++ )
+ {
+ SbxVariable* pVar = pParams->Get( nParam );
+ DBG_ASSERT( pVar, "Parameter?!" );
+ if ( pVar->GetName().Len() )
+ aStr += pVar->GetName();
+ else if ( pInfo )
+ {
+ const SbxParamInfo* pParam = pInfo->GetParam( nParam );
+ if ( pParam )
+ aStr += pParam->aName;
+ }
+ aStr += '=';
+ if( pVar->GetType() & SbxARRAY )
+ aStr += String( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
+ else
+ aStr += pVar->GetString();
+ if ( nParam < ( pParams->Count() - 1 ) )
+ aStr += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) );
+ }
+ aStr += ')';
+ }
+
+ SbxBase::ResetError();
+ if( eOld != SbxERR_OK )
+ SbxBase::SetError( eOld );
+
+ return aStr;
+}
+
+// Public functions
+void dbg_InitTrace( void )
+{
+ FILE* pFile = fopen( GpTraceFileName, "w" );
+ if( pFile != NULL )
+ fclose( pFile );
+}
+
+void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl )
+{
+ SbModule* pTraceMod = pModule;
+ if( pTraceMod->ISA(SbClassModuleObject) )
+ {
+ SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
+ pTraceMod = pClassModuleObj->getClassModule();
+ }
+
+ String aModuleName = pTraceMod->GetName();
+ ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
+ if( it == rModuleTraceMap.end() )
+ {
+ const char* pModuleNameStr = OUStringToOString( rtl::OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr();
+ char Buffer[200];
+ sprintf( Buffer, "TRACE ERROR: Unknown module \"%s\"", pModuleNameStr );
+ lcl_lineOut( GpTraceFileName, Buffer );
+ return;
+ }
+ PCToTextDataMap* pInnerMap = it->second;
+ if( pInnerMap == NULL )
+ {
+ lcl_lineOut( GpTraceFileName, "TRACE INTERNAL ERROR: No inner map" );
+ return;
+ }
+
+ PCToTextDataMap::iterator itInner = pInnerMap->find( nPC );
+ if( itInner == pInnerMap->end() )
+ {
+ const char* pModuleNameStr = OUStringToOString( rtl::OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr();
+ char Buffer[200];
+ sprintf( Buffer, "TRACE ERROR: No info for PC = %d in module \"%s\"", nPC, pModuleNameStr );
+ lcl_lineOut( GpTraceFileName, Buffer );
+ return;
+ }
+
+ //nCallLvl--;
+ //if( nCallLvl < 0 )
+ // nCallLvl = 0;
+ int nIndent = nCallLvl * GnIndentPerCallLevel;
+
+ const TraceTextData& rTraceTextData = itInner->second;
+ const rtl::OString& rStr_STMNT = rTraceTextData.m_aTraceStr_STMNT;
+ if( rStr_STMNT.getLength() )
+ lcl_lineOut( GpTraceFileName, rStr_STMNT.getStr(), lcl_getSpaces( nIndent ) );
+
+ if( !GbIncludePCodes )
+ return;
+
+ nIndent += GnIndentForPCode;
+ const rtl::OString& rStr_PCode = rTraceTextData.m_aTraceStr_PCode;
+ if( rStr_PCode.getLength() )
+ lcl_lineOut( GpTraceFileName, rStr_PCode.getStr(), lcl_getSpaces( nIndent ) );
+}
+
+void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave )
+{
+ static const char* pSeparator = "' ================================================================================";
+
+ SbModule* pTraceMod = pModule;
+ SbClassModuleObject* pClassModuleObj = NULL;
+ if( pTraceMod->ISA(SbClassModuleObject) )
+ {
+ pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
+ pTraceMod = pClassModuleObj->getClassModule();
+ }
+
+ if( nCallLvl > 0 )
+ nCallLvl--;
+ int nIndent = nCallLvl * GnIndentPerCallLevel;
+ if( !bLeave )
+ {
+ lcl_lineOut( GpTraceFileName, "" );
+ lcl_lineOut( GpTraceFileName, pSeparator, lcl_getSpaces( nIndent ) );
+ }
+
+ String aStr;
+ if( bLeave )
+ {
+ lcl_lineOut( GpTraceFileName, "}", lcl_getSpaces( nIndent ) );
+ aStr.AppendAscii( "' Leaving " );
+ }
+ else
+ {
+ aStr.AppendAscii( "Entering " );
+ }
+ String aModuleName = pTraceMod->GetName();
+ aStr += aModuleName;
+ if( pMethod != NULL )
+ {
+ aStr.AppendAscii( "::" );
+ String aMethodName = pMethod->GetName();
+ aStr += aMethodName;
+ }
+ else
+ {
+ aStr.AppendAscii( "/RunInit" );
+ }
+
+ if( pClassModuleObj != NULL )
+ {
+ aStr.AppendAscii( "[this=" );
+ aStr += pClassModuleObj->GetName();
+ aStr.AppendAscii( "]" );
+ }
+ if( !bLeave )
+ aStr += dumpMethodParameters( pMethod );
+
+ lcl_lineOut( GpTraceFileName, OUStringToOString( rtl::OUString( aStr ), RTL_TEXTENCODING_ASCII_US ).getStr(), lcl_getSpaces( nIndent ) );
+ if( !bLeave )
+ lcl_lineOut( GpTraceFileName, "{", lcl_getSpaces( nIndent ) );
+
+ if( bLeave )
+ lcl_lineOut( GpTraceFileName, "" );
+}
+
+void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl )
+{
+ rtl::OString aOTraceErrMsg = OUStringToOString( rtl::OUString( aTraceErrMsg ), RTL_TEXTENCODING_ASCII_US );
+
+ char Buffer[200];
+ const char* pHandledStr = bTraceErrHandled ? " / HANDLED" : "";
+ sprintf( Buffer, "*** ERROR%s, Id = %d, Msg = \"%s\" ***", pHandledStr, (int)nTraceErr, aOTraceErrMsg.getStr() );
+ int nIndent = nCallLvl * GnIndentPerCallLevel;
+ lcl_lineOut( GpTraceFileName, Buffer, lcl_getSpaces( nIndent ) );
+}
+
+void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC,
+ const String& aTraceStr_STMNT, const String& aTraceStr_PCode )
+{
+ String aModuleName = pModule->GetName();
+ ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
+ PCToTextDataMap* pInnerMap;
+ if( it == rModuleTraceMap.end() )
+ {
+ pInnerMap = new PCToTextDataMap();
+ rModuleTraceMap[ aModuleName ] = pInnerMap;
+ }
+ else
+ {
+ pInnerMap = it->second;
+ }
+
+ TraceTextData aData;
+
+ rtl::OString aOTraceStr_STMNT = lcl_toOStringSkipLeadingWhites( aTraceStr_STMNT );
+ aData.m_aTraceStr_STMNT = aOTraceStr_STMNT;
+
+ rtl::OString aOTraceStr_PCode = lcl_toOStringSkipLeadingWhites( aTraceStr_PCode );
+ aData.m_aTraceStr_PCode = aOTraceStr_PCode;
+
+ (*pInnerMap)[nPC] = aData;
+}
+
+#endif
+
+
+//==========================================================================
// For debugging only
-// #define DBG_SAVE_DISASSEMBLY
+//#define DBG_SAVE_DISASSEMBLY
#ifdef DBG_SAVE_DISASSEMBLY
static bool dbg_bDisassemble = true;
@@ -67,7 +367,7 @@ void dbg_SaveDisassembly( SbModule* pModule )
( OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY );
if( xSFI.is() )
{
- String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/BasicAsm_") );
+ String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/zBasic.Asm/Asm_") );
StarBASIC* pBasic = (StarBASIC*)pModule->GetParent();
if( pBasic )
{
@@ -99,6 +399,7 @@ void dbg_SaveDisassembly( SbModule* pModule )
}
#endif
+
// Diese Routine ist hier definiert, damit der Compiler als eigenes Segment
// geladen werden kann.
@@ -131,6 +432,7 @@ BOOL SbModule::Compile()
if( bRet )
{
pBasic->ClearAllModuleVars();
+ RemoveVars(); // remove 'this' Modules variables
// clear all method statics
for( USHORT i = 0; i < pMethods->Count(); i++ )
{
@@ -154,6 +456,10 @@ BOOL SbModule::Compile()
dbg_SaveDisassembly( this );
#endif
+#ifdef DBG_TRACE_BASIC
+ lcl_PrepareTraceForModule( this );
+#endif
+
return bRet;
}
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index af7302d1e1..96604cbdd9 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -234,7 +234,6 @@ class SbiExprList { // Basisklasse fuer Parameter und Dims
protected:
SbiParser* pParser; // Parser
SbiExpression* pFirst; // Expressions
- SbiProcDef* pProc; // DECLARE-Funktion (Parameter-Anpassung)
short nExpr; // Anzahl Expressions
short nDim; // Anzahl Dimensionen
BOOL bError; // TRUE: Fehler
@@ -249,8 +248,6 @@ public:
SbiExpression* Get( short );
BOOL Test( const SbiProcDef& ); // Parameter-Checks
void Gen(); // Code-Erzeugung
- // Setzen einer Funktionsdefinition zum Abgleich der Parameter
- void SetProc( SbiProcDef* p ) { pProc = p; }
void addExpression( SbiExpression* pExpr );
};
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 6db0b96933..72cdcee2da 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -60,7 +60,7 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/compbase8.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-#include <com/sun/star/script/XVBACompat.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
class BasicManager;
@@ -74,7 +74,7 @@ typedef ::cppu::WeakComponentImplHelper8<
::com::sun::star::script::XLibraryContainerExport,
::com::sun::star::script::XLibraryContainer3,
::com::sun::star::container::XContainer,
- ::com::sun::star::script::XVBACompat,
+ ::com::sun::star::script::vba::XVBACompatibility,
::com::sun::star::lang::XServiceInfo > LibraryContainerHelper;
typedef ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameContainer,
@@ -507,9 +507,9 @@ public:
throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (::com::sun::star::uno::RuntimeException) = 0;
- // Methods XVBACompat
- virtual ::sal_Bool SAL_CALL getVBACompatModeOn() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException);
+ // Methods XVBACompatibility
+ virtual ::sal_Bool SAL_CALL getVBACompatibilityMode() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setVBACompatibilityMode( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException);
};
class LibraryContainerMethodGuard
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 4fb7b1886c..d83bc3c68c 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -34,7 +34,7 @@
#include <vector>
-typedef ::std::vector< String > IfaceVector;
+typedef ::std::vector< String > StringVector;
struct SbiParseStack;
@@ -81,7 +81,8 @@ public:
BOOL bText; // OPTION COMPARE TEXT
BOOL bExplicit; // TRUE: OPTION EXPLICIT
BOOL bClassModule; // TRUE: OPTION ClassModule
- IfaceVector aIfaceVector; // Holds all interfaces implemented by a class module
+ StringVector aIfaceVector; // Holds all interfaces implemented by a class module
+ StringVector aRequiredTypes; // Types used in Dim As New <type> outside subs
SbxDataType eDefTypes[26]; // DEFxxx-Datentypen
SbiParser( StarBASIC*, SbModule* );
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 938315aa12..00621e2c21 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -50,10 +50,16 @@ public:
virtual SbxObject* CreateObject( const String& );
};
+typedef ::std::vector< String > StringVector;
+
struct SbClassData
{
SbxArrayRef mxIfaces;
+ // types this module depends on because of use in Dim As New <type>
+ // needed for initialization order of class modules
+ StringVector maRequiredTypes;
+
SbClassData( void );
~SbClassData( void )
{ clear(); }
diff --git a/sfx2/source/appl/sfxdll.cxx b/basic/source/inc/sbtrace.hxx
index 3635770b38..6d24325c94 100644..100755
--- a/sfx2/source/appl/sfxdll.cxx
+++ b/basic/source/inc/sbtrace.hxx
@@ -25,45 +25,18 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-
-#ifdef WIN
-#include <svwin.h>
-#endif
-
-#ifndef GCC
-#endif
-
-#ifdef WIN
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0;
-
-//==========================================================================
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
+#ifndef _SBTRACE_HXX
+#define _SBTRACE_HXX
+
+// #define DBG_TRACE_BASIC
+
+#ifdef DBG_TRACE_BASIC
+void dbg_InitTrace( void );
+void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl );
+void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave = false );
+void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl );
+void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC,
+ const String& aTraceStr_STMNT, const String& aTraceStr_PCode );
#endif
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-
-//--------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-
-//==========================================================================
-
#endif
-
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index b8993c1e71..f2277e99d0 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -52,6 +52,7 @@ class SbUnoObject: public SbxObject
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation;
BOOL bNeedIntrospection;
+ BOOL bIgnoreNativeCOMObjectMembers;
::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection!
// Hilfs-Methode zum Anlegen der dbg_-Properties
diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx
index 2c71183918..71ad535600 100644
--- a/basic/source/inc/scriptcont.hxx
+++ b/basic/source/inc/scriptcont.hxx
@@ -30,7 +30,7 @@
#include "namecont.hxx"
#include <basic/basmgr.hxx>
-#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
#include <comphelper/uno3.hxx>
class BasicManager;
@@ -141,7 +141,7 @@ public:
//============================================================================
typedef std::hash_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInfoMap;
-typedef ::cppu::ImplHelper1 < ::com::sun::star::script::XVBAModuleInfo
+typedef ::cppu::ImplHelper1 < ::com::sun::star::script::vba::XVBAModuleInfo
> SfxScriptLibrary_BASE;
class SfxScriptLibrary : public SfxLibrary
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index a2a5896943..fd0906e022 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -159,7 +159,8 @@ public:
void SetOptional() { bOpt = TRUE; }
void SetParamArray() { bParamArray = TRUE; }
void SetWithEvents() { bWithEvents = TRUE; }
- void SetByVal() { bByVal = TRUE; }
+ void SetByVal( BOOL bByVal_ = TRUE )
+ { bByVal = bByVal_; }
void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; }
void SetNew() { bNew = TRUE; }
void SetDefinedAs() { bAs = TRUE; }
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 41e7df439c..29459b1de9 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -103,15 +103,10 @@ using namespace com::sun::star::io;
#include <stdlib.h>
#include <ctype.h>
-#if defined (WIN) || defined (WNT) || defined (OS2)
+#if defined (WNT) || defined (OS2)
#include <direct.h> // _getdcwd get current work directory, _chdrive
#endif
-#ifdef WIN
-#include <dos.h> // _dos_getfileattr
-#include <errno.h>
-#endif
-
#ifdef UNX
#include <errno.h>
#include <unistd.h>
@@ -420,7 +415,7 @@ RTLFUNC(CurDir)
// zu ermitteln, dass eine virtuelle URL geliefert werden koennte.
// rPar.Get(0)->PutEmpty();
-#if defined (WIN) || defined (WNT) || defined (OS2)
+#if defined (WNT) || defined (OS2)
int nCurDir = 0; // Current dir // JSM
if ( rPar.Count() == 2 )
{
@@ -527,7 +522,7 @@ RTLFUNC(ChDrive) // JSM
#ifndef UNX
String aPar1 = rPar.Get(1)->GetString();
-#if defined (WIN) || defined (WNT) || defined (OS2)
+#if defined (WNT) || defined (OS2)
if (aPar1.Len() > 0)
{
int nCurDrive = (int)aPar1.GetBuffer()[0]; ;
@@ -2792,11 +2787,7 @@ RTLFUNC(Dir)
pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger();
else
pRTLData->nDirFlags = 0;
- // Nur diese Bitmaske ist unter Windows erlaubt
- #ifdef WIN
- if( nFlags & ~0x1E )
- StarBASIC::Error( SbERR_BAD_ARGUMENT ), pRTLData->nDirFlags = 0;
- #endif
+
// Sb_ATTR_VOLUME wird getrennt gehandelt
if( pRTLData->nDirFlags & Sb_ATTR_VOLUME )
aPath = aEntry.GetVolume();
@@ -2826,31 +2817,7 @@ RTLFUNC(Dir)
}
DirEntry aNextEntry=(*(pRTLData->pDir))[pRTLData->nCurDirPos++];
aPath = aNextEntry.GetName(); //Full();
- #ifdef WIN
- aNextEntry.ToAbs();
- String sFull(aNextEntry.GetFull());
- unsigned nFlags;
-
- if (_dos_getfileattr( sFull.GetStr(), &nFlags ))
- StarBASIC::Error( SbERR_FILE_NOT_FOUND );
- else
- {
- INT16 nCurFlags = pRTLData->nDirFlags;
- if( (nCurFlags == Sb_ATTR_NORMAL)
- && !(nFlags & ( _A_HIDDEN | _A_SYSTEM | _A_VOLID | _A_SUBDIR ) ) )
- break;
- else if( (nCurFlags & Sb_ATTR_HIDDEN) && (nFlags & _A_HIDDEN) )
- break;
- else if( (nCurFlags & Sb_ATTR_SYSTEM) && (nFlags & _A_SYSTEM) )
- break;
- else if( (nCurFlags & Sb_ATTR_VOLUME) && (nFlags & _A_VOLID) )
- break;
- else if( (nCurFlags & Sb_ATTR_DIRECTORY) && (nFlags & _A_SUBDIR) )
- break;
- }
- #else
break;
- #endif
}
}
rPar.Get(0)->PutString( aPath );
@@ -3404,8 +3371,8 @@ RTLFUNC(Shell)
}
else
{
- USHORT nOptions = NAMESPACE_VOS(OProcess)::TOption_SearchPath|
- NAMESPACE_VOS(OProcess)::TOption_Detached;
+ USHORT nOptions = vos::OProcess::TOption_SearchPath|
+ vos::OProcess::TOption_Detached;
String aCmdLine = rPar.Get(1)->GetString();
// Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden
if( nArgCount >= 4 )
@@ -3483,13 +3450,13 @@ RTLFUNC(Shell)
switch( nWinStyle )
{
case 2:
- nOptions |= NAMESPACE_VOS(OProcess)::TOption_Minimized;
+ nOptions |= vos::OProcess::TOption_Minimized;
break;
case 3:
- nOptions |= NAMESPACE_VOS(OProcess)::TOption_Maximized;
+ nOptions |= vos::OProcess::TOption_Maximized;
break;
case 10:
- nOptions |= NAMESPACE_VOS(OProcess)::TOption_FullScreen;
+ nOptions |= vos::OProcess::TOption_FullScreen;
break;
}
@@ -3497,10 +3464,10 @@ RTLFUNC(Shell)
if( nArgCount >= 5 )
bSync = rPar.Get(4)->GetBool();
if( bSync )
- nOptions |= NAMESPACE_VOS(OProcess)::TOption_Wait;
+ nOptions |= vos::OProcess::TOption_Wait;
}
- NAMESPACE_VOS(OProcess)::TProcessOption eOptions =
- (NAMESPACE_VOS(OProcess)::TProcessOption)nOptions;
+ vos::OProcess::TProcessOption eOptions =
+ (vos::OProcess::TProcessOption)nOptions;
// #72471 Parameter aufbereiten
@@ -3530,25 +3497,25 @@ RTLFUNC(Shell)
}
//const char* pParams = aParams.Len() ? aParams.GetStr() : 0;
- NAMESPACE_VOS(OProcess)* pApp;
- pApp = new NAMESPACE_VOS(OProcess)( aOUStrProgUNC );
+ vos::OProcess* pApp;
+ pApp = new vos::OProcess( aOUStrProgUNC );
BOOL bSucc;
if( nParamCount == 0 )
{
- bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None;
+ bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None;
}
else
{
- NAMESPACE_VOS(OArgumentList) aArgList( pArgumentList, nParamCount );
- bSucc = pApp->execute( eOptions, aArgList ) == NAMESPACE_VOS(OProcess)::E_None;
+ vos::OArgumentList aArgList( pArgumentList, nParamCount );
+ bSucc = pApp->execute( eOptions, aArgList ) == vos::OProcess::E_None;
}
/*
if( nParamCount == 0 )
- pApp = new NAMESPACE_VOS(OProcess)( pProg );
+ pApp = new vos::OProcess( pProg );
else
- pApp = new NAMESPACE_VOS(OProcess)( pProg, pParamList, nParamCount );
- BOOL bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None;
+ pApp = new vos::OProcess( pProg, pParamList, nParamCount );
+ BOOL bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None;
*/
delete pApp;
@@ -4134,8 +4101,7 @@ RTLFUNC(Load)
{
if( pObj->IsA( TYPE( SbUserFormModule ) ) )
{
- SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
- pFormModule->load();
+ ((SbUserFormModule*)pObj)->Load();
}
else if( pObj->IsA( TYPE( SbxObject ) ) )
{
@@ -4381,16 +4347,6 @@ RTLFUNC(SetAttr) // JSM
// #57064 Bei virtuellen URLs den Real-Path extrahieren
DirEntry aEntry( aStr );
String aFile = aEntry.GetFull();
- #ifdef WIN
- int nErr = _dos_setfileattr( aFile.GetStr(),(unsigned ) nFlags );
- if ( nErr )
- {
- if (errno == EACCES)
- StarBASIC::Error( SbERR_ACCESS_DENIED );
- else
- StarBASIC::Error( SbERR_FILE_NOT_FOUND );
- }
- #endif
ByteString aByteFile( aFile, gsl_getSystemTextEncoding() );
#ifdef WNT
if (!SetFileAttributes (aByteFile.GetBuffer(),(DWORD)nFlags))
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index f22a52c51a..acf6cb92ba 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -28,11 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basic.hxx"
-#if defined(WIN)
-#include <string.h>
-#else
#include <stdlib.h> // getenv
-#endif
#include <vcl/svapp.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/wrkwin.hxx>
@@ -52,10 +48,6 @@
#include <svpm.h>
#endif
-#if defined(WIN)
-#include <tools/svwin.h>
-#endif
-
#ifndef CLK_TCK
#define CLK_TCK CLOCKS_PER_SEC
#endif
@@ -528,11 +520,13 @@ RTLFUNC(DoEvents)
(void)pBasic;
(void)bWrite;
(void)rPar;
- Timer aTimer;
- aTimer.SetTimeout( 1 );
- aTimer.Start();
- while ( aTimer.IsActive() )
- Application::Yield();
+ // Dummy implementation as the following code leads
+ // to performance problems for unknown reasons
+ //Timer aTimer;
+ //aTimer.SetTimeout( 1 );
+ //aTimer.Start();
+ //while ( aTimer.IsActive() )
+ // Application::Reschedule();
}
RTLFUNC(GetGUIVersion)
@@ -1163,31 +1157,10 @@ RTLFUNC(Environ)
}
String aResult;
// sollte ANSI sein, aber unter Win16 in DLL nicht moeglich
-#if defined(WIN)
- LPSTR lpszEnv = GetDOSEnvironment();
- String aCompareStr( rPar.Get(1)->GetString() );
- aCompareStr += '=';
- const char* pCompare = aCompareStr.GetStr();
- int nCompareLen = aCompareStr.Len();
- while ( *lpszEnv )
- {
- // Es werden alle EnvString in der Form ENV=VAL 0-terminiert
- // aneinander gehaengt.
-
- if ( strnicmp( pCompare, lpszEnv, nCompareLen ) == 0 )
- {
- aResult = (const char*)(lpszEnv+nCompareLen);
- rPar.Get(0)->PutString( aResult );
- return;
- }
- lpszEnv += lstrlen( lpszEnv ) + 1; // Next Enviroment-String
- }
-#else
ByteString aByteStr( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() );
const char* pEnvStr = getenv( aByteStr.GetBuffer() );
if ( pEnvStr )
aResult = String::CreateFromAscii( pEnvStr );
-#endif
rPar.Get(0)->PutString( aResult );
}
@@ -1198,11 +1171,7 @@ static double GetDialogZoomFactor( BOOL bX, long nValue )
if( pDevice )
{
Size aRefSize( nValue, nValue );
-#ifndef WIN
Fraction aFracX( 1, 26 );
-#else
- Fraction aFracX( 1, 23 );
-#endif
Fraction aFracY( 1, 24 );
MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY );
Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap );
@@ -1586,8 +1555,6 @@ RTLFUNC(Join)
}
-typedef ::std::vector< String > StringVector;
-
RTLFUNC(Split)
{
(void)pBasic;
diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx
index 5a215bb40d..c7e81cf162 100644
--- a/basic/source/runtime/props.cxx
+++ b/basic/source/runtime/props.cxx
@@ -76,6 +76,13 @@ RTLFUNC(False)
rPar.Get(0)->PutBool( FALSE );
}
+RTLFUNC(Empty)
+{
+ (void)pBasic;
+ (void)bWrite;
+ (void)rPar;
+}
+
RTLFUNC(Nothing)
{
(void)pBasic;
diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx
index 13485d7bb2..e3b2a05395 100644
--- a/basic/source/runtime/rtlproto.hxx
+++ b/basic/source/runtime/rtlproto.hxx
@@ -38,6 +38,7 @@ extern RTLFUNC(Date);
extern RTLFUNC(Err);
extern RTLFUNC(Erl);
extern RTLFUNC(False);
+extern RTLFUNC(Empty);
extern RTLFUNC(Nothing);
extern RTLFUNC(Null);
extern RTLFUNC(True);
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index b27495099a..a8eff4d55d 100755..100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include "sbunoobj.hxx"
#include "errobject.hxx"
+#include "sbtrace.hxx"
using namespace ::com::sun::star;
@@ -720,6 +721,12 @@ BOOL SbiRuntime::Step()
if( pInst->IsReschedule() && bStaticGlobalEnableReschedule )
Application::Reschedule();
}
+
+#ifdef DBG_TRACE_BASIC
+ UINT32 nPC = ( pCode - (const BYTE* )pImg->GetCode() );
+ dbg_traceStep( pMod, nPC, pINST->nCallLvl );
+#endif
+
SbiOpcode eOp = (SbiOpcode ) ( *pCode++ );
UINT32 nOp1, nOp2;
if( eOp <= SbOP0_END )
@@ -756,6 +763,11 @@ BOOL SbiRuntime::Step()
// (insbesondere nicht nach Compiler-Fehlern zur Laufzeit)
if( nError && bRun )
{
+#ifdef DBG_TRACE_BASIC
+ SbError nTraceErr = nError;
+ String aTraceErrMsg = GetSbData()->aErrMsg;
+ bool bTraceErrHandled = true;
+#endif
SbError err = nError;
ClearExprStack();
nError = 0;
@@ -836,12 +848,19 @@ BOOL SbiRuntime::Step()
// Kein Error-Hdl gefunden -> altes Vorgehen
else
{
+#ifdef DBG_TRACE_BASIC
+ bTraceErrHandled = false;
+#endif
pInst->Abort();
}
// ALT: Nur
// pInst->Abort();
}
+
+#ifdef DBG_TRACE_BASIC
+ dbg_traceNotifyError( nTraceErr, aTraceErrMsg, bTraceErrHandled, pINST->nCallLvl );
+#endif
}
}
return bRun;
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index a4a7f7f68b..d621a12f0f 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -221,6 +221,7 @@ static Methods aMethods[] = {
{ "FileSpec", SbxSTRING, 0,NULL,0 },
{ "DumpAll", SbxINTEGER, _OPT, NULL,0 },
+{ "Empty", SbxVARIANT, _CPROP, RTLNAME(Empty),0 },
{ "EqualUnoObjects",SbxBOOL, 2 | _FUNCTION, RTLNAME(EqualUnoObjects),0 },
{ "Variant", SbxVARIANT, 0,NULL,0 },
{ "Variant", SbxVARIANT, 0,NULL,0 },
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 2c576e07f6..f5c9d5dce1 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -138,7 +138,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp )
}
}
-#ifndef WIN
static SbxVariable* pTRUE = NULL;
static SbxVariable* pFALSE = NULL;
@@ -162,12 +161,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp )
}
PushVar( pFALSE );
}
-#else
- BOOL bRes = p2->Compare( eOp, *p1 );
- SbxVariable* pRes = new SbxVariable;
- pRes->PutBool( bRes );
- PushVar( pRes );
-#endif
}
void SbiRuntime::StepEXP() { StepArith( SbxEXP ); }
@@ -312,9 +305,21 @@ void SbiRuntime::StepIS()
{
SbxVariableRef refVar1 = PopVar();
SbxVariableRef refVar2 = PopVar();
- BOOL bRes = BOOL(
- refVar1->GetType() == SbxOBJECT
- && refVar2->GetType() == SbxOBJECT );
+
+ SbxDataType eType1 = refVar1->GetType();
+ SbxDataType eType2 = refVar2->GetType();
+ if ( eType1 == SbxEMPTY )
+ {
+ refVar1->Broadcast( SBX_HINT_DATAWANTED );
+ eType1 = refVar1->GetType();
+ }
+ if ( eType2 == SbxEMPTY )
+ {
+ refVar2->Broadcast( SBX_HINT_DATAWANTED );
+ eType2 = refVar2->GetType();
+ }
+
+ BOOL bRes = BOOL( eType1 == SbxOBJECT && eType2 == SbxOBJECT );
if ( bVBAEnabled && !bRes )
Error( SbERR_INVALID_USAGE_OBJECT );
bRes = ( bRes && refVar1->GetObject() == refVar2->GetObject() );
@@ -419,139 +424,143 @@ void SbiRuntime::StepPUT()
void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp )
{
// #67733 Typen mit Array-Flag sind auch ok
- SbxDataType eValType = refVal->GetType();
+
+ // Check var, !object is no error for sure if, only if type is fixed
SbxDataType eVarType = refVar->GetType();
- if( (eValType != SbxOBJECT
- && eValType != SbxEMPTY
-// seems like when using the default method its possible for objects
-// to be empty ( no broadcast has taken place yet ) or the actual value is
-
- && !bHandleDefaultProp
- && !(eValType & SbxARRAY)) ||
- (eVarType != SbxOBJECT
- && eVarType != SbxEMPTY
- && !bHandleDefaultProp
- && !(eVarType & SbxARRAY) ) )
+ if( !bHandleDefaultProp && eVarType != SbxOBJECT && !(eVarType & SbxARRAY) && refVar->IsFixed() )
{
Error( SbERR_INVALID_USAGE_OBJECT );
+ return;
}
- else
+
+ // Check value, !object is no error for sure if, only if type is fixed
+ SbxDataType eValType = refVal->GetType();
+// bool bGetValObject = false;
+ if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() )
+ {
+ Error( SbERR_INVALID_USAGE_OBJECT );
+ return;
+ }
+
+ // Getting in here causes problems with objects with default properties
+ // if they are SbxEMPTY I guess
+ if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) )
{
- // Getting in here causes problems with objects with default properties
- // if they are SbxEMPTY I guess
- if ( !bHandleDefaultProp || ( bHandleDefaultProp && refVal->GetType() == SbxOBJECT ) )
+ // Auf refVal GetObject fuer Collections ausloesen
+ SbxBase* pObjVarObj = refVal->GetObject();
+ if( pObjVarObj )
{
- // Auf refVal GetObject fuer Collections ausloesen
- SbxBase* pObjVarObj = refVal->GetObject();
- if( pObjVarObj )
- {
- SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
+ SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
- // #67733 Typen mit Array-Flag sind auch ok
- if( refObjVal )
- refVal = refObjVal;
- else if( !(eValType & SbxARRAY) )
- refVal = NULL;
- }
+ // #67733 Typen mit Array-Flag sind auch ok
+ if( refObjVal )
+ refVal = refObjVal;
+ else if( !(eValType & SbxARRAY) )
+ refVal = NULL;
}
+ }
- // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
- // Object deklarierten Variable zugewiesen werden, kann hier
- // refVal ungueltig sein!
- if( !refVal )
+ // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
+ // Object deklarierten Variable zugewiesen werden, kann hier
+ // refVal ungueltig sein!
+ if( !refVal )
+ {
+ Error( SbERR_INVALID_USAGE_OBJECT );
+ }
+ else
+ {
+ // Store auf die eigene Methode (innerhalb einer Function)?
+ BOOL bFlagsChanged = FALSE;
+ USHORT n = 0;
+ if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
{
- Error( SbERR_INVALID_USAGE_OBJECT );
+ bFlagsChanged = TRUE;
+ n = refVar->GetFlags();
+ refVar->SetFlag( SBX_WRITE );
}
- else
- {
- // Store auf die eigene Methode (innerhalb einer Function)?
- BOOL bFlagsChanged = FALSE;
- USHORT n = 0;
- if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
- {
- bFlagsChanged = TRUE;
- n = refVar->GetFlags();
- refVar->SetFlag( SBX_WRITE );
- }
- SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
- if( pProcProperty )
- pProcProperty->setSet( true );
+ SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
+ if( pProcProperty )
+ pProcProperty->setSet( true );
- if ( bHandleDefaultProp )
+ if ( bHandleDefaultProp )
+ {
+ // get default properties for lhs & rhs where necessary
+ // SbxVariable* defaultProp = NULL; unused variable
+ bool bLHSHasDefaultProp = false;
+ // LHS try determine if a default prop exists
+ if ( refVar->GetType() == SbxOBJECT )
{
- // get default properties for lhs & rhs where necessary
- // SbxVariable* defaultProp = NULL; unused variable
- bool bLHSHasDefaultProp = false;
- // LHS try determine if a default prop exists
- if ( refVar->GetType() == SbxOBJECT )
+ SbxVariable* pDflt = getDefaultProp( refVar );
+ if ( pDflt )
{
- SbxVariable* pDflt = getDefaultProp( refVar );
- if ( pDflt )
- {
- refVar = pDflt;
- bLHSHasDefaultProp = true;
- }
+ refVar = pDflt;
+ bLHSHasDefaultProp = true;
}
- // RHS only get a default prop is the rhs has one
- if ( refVal->GetType() == SbxOBJECT )
+ }
+ // RHS only get a default prop is the rhs has one
+ if ( refVal->GetType() == SbxOBJECT )
+ {
+ // check if lhs is a null object
+ // if it is then use the object not the default property
+ SbxObject* pObj = NULL;
+
+
+ pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
+
+ // calling GetObject on a SbxEMPTY variable raises
+ // object not set errors, make sure its an Object
+ if ( !pObj && refVar->GetType() == SbxOBJECT )
{
- // check if lhs is a null object
- // if it is then use the object not the default property
- SbxObject* pObj = NULL;
-
-
- pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
-
- // calling GetObject on a SbxEMPTY variable raises
- // object not set errors, make sure its an Object
- if ( !pObj && refVar->GetType() == SbxOBJECT )
- {
- SbxBase* pObjVarObj = refVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
- }
- SbxVariable* pDflt = NULL;
- if ( pObj || bLHSHasDefaultProp )
- // lhs is either a valid object || or has a defaultProp
- pDflt = getDefaultProp( refVal );
- if ( pDflt )
- refVal = pDflt;
- }
- }
-
- // Handle withevents
- BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
+ SbxBase* pObjVarObj = refVar->GetObject();
+ pObj = PTR_CAST(SbxObject,pObjVarObj);
+ }
+ SbxVariable* pDflt = NULL;
+ if ( pObj || bLHSHasDefaultProp )
+ // lhs is either a valid object || or has a defaultProp
+ pDflt = getDefaultProp( refVal );
+ if ( pDflt )
+ refVal = pDflt;
+ }
+ }
+
+ // Handle withevents
+ BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
+ if ( bWithEvents )
+ {
Reference< XInterface > xComListener;
- if( bWithEvents )
+
+ SbxBase* pObj = refVal->GetObject();
+ SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
+ if( pUnoObj != NULL )
{
- SbxBase* pObj = refVal->GetObject();
- SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
- if( pUnoObj != NULL )
- {
- Any aControlAny = pUnoObj->getUnoAny();
- String aDeclareClassName = refVar->GetDeclareClassName();
- ::rtl::OUString aVBAType = aDeclareClassName;
- ::rtl::OUString aPrefix = refVar->GetName();
- SbxObjectRef xScopeObj = refVar->GetParent();
- xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
- }
+ Any aControlAny = pUnoObj->getUnoAny();
+ String aDeclareClassName = refVar->GetDeclareClassName();
+ ::rtl::OUString aVBAType = aDeclareClassName;
+ ::rtl::OUString aPrefix = refVar->GetName();
+ SbxObjectRef xScopeObj = refVar->GetParent();
+ xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
+
+ refVal->SetDeclareClassName( aDeclareClassName );
+ refVal->SetComListener( xComListener ); // Hold reference
}
*refVar = *refVal;
-
- if( bWithEvents )
- refVar->SetComListener( xComListener ); // Hold reference
-
- // lhs is a property who's value is currently (Empty e.g. no broadcast yet)
- // in this case if there is a default prop involved the value of the
- // default property may infact be void so the type will also be SbxEMPTY
- // in this case we do not want to call checkUnoStructCopy 'cause that will
- // cause an error also
- if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
- // #67607 Uno-Structs kopieren
- checkUnoStructCopy( refVal, refVar );
- if( bFlagsChanged )
- refVar->SetFlags( n );
}
+ else
+ {
+ *refVar = *refVal;
+ }
+
+ // lhs is a property who's value is currently (Empty e.g. no broadcast yet)
+ // in this case if there is a default prop involved the value of the
+ // default property may infact be void so the type will also be SbxEMPTY
+ // in this case we do not want to call checkUnoStructCopy 'cause that will
+ // cause an error also
+ if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
+ // #67607 Uno-Structs kopieren
+ checkUnoStructCopy( refVal, refVar );
+ if( bFlagsChanged )
+ refVar->SetFlags( n );
}
}
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 48a0a0da99..995c425c0e 100644..100755
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -261,10 +261,12 @@ SbxVariable* SbiRuntime::FindElement
if( bSet )
pElem->SetType( t2 );
pElem = pNew;
- }
+ }
// Index-Access bei UnoObjekten beruecksichtigen
- /*
- else if( pElem->ISA(SbUnoProperty) )
+ // definitely we want this for VBA where properties are often
+ // collections ( which need index access ), but lets only do
+ // this if we actually have params following
+ else if( bVBAEnabled && pElem->ISA(SbUnoProperty) && pElem->GetParameters() )
{
// pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen
SbxVariableRef refTemp = pElem;
@@ -274,7 +276,6 @@ SbxVariable* SbiRuntime::FindElement
pElem->SetParameters( NULL ); // sonst bleibt Ref auf sich selbst
pElem = pNew;
}
- */
}
return CheckArray( pElem );
}
@@ -377,7 +378,8 @@ void SbiRuntime::SetupArgs( SbxVariable* p, UINT32 nOp1 )
bool bError_ = true;
SbUnoMethod* pUnoMethod = PTR_CAST(SbUnoMethod,p);
- if( pUnoMethod )
+ SbUnoProperty* pUnoProperty = PTR_CAST(SbUnoProperty,p);
+ if( pUnoMethod || pUnoProperty )
{
SbUnoObject* pParentUnoObj = PTR_CAST( SbUnoObject,p->GetParent() );
if( pParentUnoObj )
@@ -677,7 +679,18 @@ void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 )
while( iLoop >= nParamCount )
{
p = new SbxVariable();
- p->PutErr( 448 ); // Wie in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND)
+
+ if( SbiRuntime::isVBAEnabled() &&
+ (t == SbxOBJECT || t == SbxSTRING) )
+ {
+ if( t == SbxOBJECT )
+ p->PutObject( NULL );
+ else
+ p->PutString( String() );
+ }
+ else
+ p->PutErr( 448 ); // Wie in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND)
+
refParams->Put( p, iLoop );
iLoop--;
}
@@ -1157,15 +1170,26 @@ void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 )
StepPUBLIC_Impl( nOp1, nOp2, true );
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
- SbxDataType t = (SbxDataType)(SbxDataType)(nOp2 & 0xffff);;
- BOOL bFlag = rBasic.IsSet( SBX_NO_MODIFY );
+ SbxDataType t = (SbxDataType)(nOp2 & 0xffff);
+
+ // Store module scope variables at module scope
+ // in non vba mode these are stored at the library level :/
+ // not sure if this really should not be enabled for ALL basic
+ SbxObject* pStorage = &rBasic;
+ if ( SbiRuntime::isVBAEnabled() )
+ {
+ pStorage = pMod;
+ pMod->AddVarName( aName );
+ }
+
+ BOOL bFlag = pStorage->IsSet( SBX_NO_MODIFY );
rBasic.SetFlag( SBX_NO_MODIFY );
- SbxVariableRef p = rBasic.Find( aName, SbxCLASS_PROPERTY );
+ SbxVariableRef p = pStorage->Find( aName, SbxCLASS_PROPERTY );
if( p.Is() )
- rBasic.Remove (p);
- p = rBasic.Make( aName, SbxCLASS_PROPERTY, t );
+ pStorage->Remove (p);
+ p = pStorage->Make( aName, SbxCLASS_PROPERTY, t );
if( !bFlag )
- rBasic.ResetFlag( SBX_NO_MODIFY );
+ pStorage->ResetFlag( SBX_NO_MODIFY );
if( p )
{
p->SetFlag( SBX_DONTSTORE );
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 2a7849cb82..5304d892b5 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -48,18 +48,11 @@ TYPEINIT0(SbxBase)
SbxAppData* GetSbxData_Impl()
{
-#ifndef DOS
SbxAppData** ppData = (SbxAppData**) ::GetAppData( SHL_SBX );
SbxAppData* p = *ppData;
if( !p )
p = *ppData = new SbxAppData;
return p;
-#else
- SbxAppData** ppData;
- SbxAppData* p;
- p = *ppData = new SbxAppData;
- return p;
-#endif
}
SbxAppData::~SbxAppData()
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx
index 38ca84eddf..7551a586b3 100644
--- a/basic/source/sbx/sbxbool.cxx
+++ b/basic/source/sbx/sbxbool.cxx
@@ -87,21 +87,20 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
case SbxSTRING:
case SbxLPSTR:
nRes = SbxFALSE;
- if( p->pString )
+ if ( p->pOUString )
{
- if( p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_TRUE ) ) )
+ if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) )
nRes = SbxTRUE;
- else if( !p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_FALSE ) ) )
+ else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) )
{
// Jetzt kann es noch in eine Zahl konvertierbar sein
BOOL bError = TRUE;
double n;
SbxDataType t;
USHORT nLen = 0;
- String s( *p->pString );
- if( ImpScan( s, n, t, &nLen ) == SbxERR_OK )
+ if( ImpScan( *p->pOUString, n, t, &nLen ) == SbxERR_OK )
{
- if( nLen == s.Len() )
+ if( nLen == p->pOUString->getLength() )
{
bError = FALSE;
if( n != 0.0 )
@@ -202,9 +201,10 @@ void ImpPutBool( SbxValues* p, INT16 n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = SbxRes( n ? STRING_TRUE : STRING_FALSE );
+ if ( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( SbxRes( n ? STRING_TRUE : STRING_FALSE ) );
+ else
+ *p->pOUString = SbxRes( n ? STRING_TRUE : STRING_FALSE );
break;
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 12ec2fd3c6..b70b82662a 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -165,13 +165,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXBYTE )
{
@@ -279,9 +279,9 @@ void ImpPutByte( SbxValues* p, BYTE n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index 9f0bb41ce6..ca52057a7c 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -39,7 +39,7 @@ using namespace rtl;
xub_Unicode ImpGetChar( const SbxValues* p )
{
SbxValues aTmp;
- xub_Unicode nRes;
+ xub_Unicode nRes = 0;
start:
switch( +p->eType )
{
@@ -156,13 +156,11 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- nRes = 0;
- else
+ if ( p->pOUString )
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXCHAR )
{
@@ -274,9 +272,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = n;
+ if ( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( n );
+ else
+ *p->pOUString = ::rtl::OUString( n );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index 57c42889a0..83e1a8dbc8 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -33,13 +33,13 @@
class SbxArray;
// SBXSCAN.CXX
-extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE );
+extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString=FALSE );
extern SbxError ImpScan
- ( const String& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen,
+ ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen,
BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE );
// mit erweiterter Auswertung (International, "TRUE"/"FALSE")
-extern BOOL ImpConvStringExt( String& rSrc, SbxDataType eTargetType );
+extern BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType );
// SBXINT.CXX
@@ -116,9 +116,9 @@ void ImpPutDate( SbxValues*, double );
// SBXSTR.CXX
-String ImpGetString( const SbxValues* );
-String ImpGetCoreString( const SbxValues* );
-void ImpPutString( SbxValues*, const String* );
+::rtl::OUString ImpGetString( const SbxValues* );
+::rtl::OUString ImpGetCoreString( const SbxValues* );
+void ImpPutString( SbxValues*, const ::rtl::OUString* );
// SBXCHAR.CXX
@@ -145,7 +145,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* );
void ImpPutBool( SbxValues*, INT16 );
// ByteArry <--> String
-SbxArray* StringToByteArray(const String& rStr);
-String ByteArrayToString(SbxArray* pArr);
+SbxArray* StringToByteArray(const ::rtl::OUString& rStr);
+::rtl::OUString ByteArrayToString(SbxArray* pArr);
#endif
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index db21871188..9ca7f8e0cd 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -37,8 +37,8 @@
#include <basic/sbxvar.hxx>
#include "sbxconv.hxx"
-static String ImpCurrencyToString( const SbxINT64& );
-static SbxINT64 ImpStringToCurrency( const String& );
+static ::rtl::OUString ImpCurrencyToString( const SbxINT64& );
+static SbxINT64 ImpStringToCurrency( const ::rtl::OUString& );
SbxINT64 ImpGetCurrency( const SbxValues* p )
{
@@ -121,10 +121,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes.SetNull();
else
- nRes = ImpStringToCurrency( *p->pString );
+ nRes = ImpStringToCurrency( *p->pOUString );
break;
case SbxOBJECT:
{
@@ -224,10 +224,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
- *p->pString = ImpCurrencyToString( r );
+ *p->pOUString = ImpCurrencyToString( r );
break;
case SbxOBJECT:
{
@@ -319,7 +319,7 @@ start:
// Hilfs-Funktionen zur Wandlung
-static String ImpCurrencyToString( const SbxINT64 &r )
+static ::rtl::OUString ImpCurrencyToString( const SbxINT64 &r )
{
BigInt a10000 = 10000;
@@ -331,20 +331,20 @@ static String ImpCurrencyToString( const SbxINT64 &r )
aFrac %= a10000;
aFrac += a10000;
- String aString;
+ ::rtl::OUString aString;
if( r.nHigh < 0 )
- aString = '-';
+ aString = ::rtl::OUString( (sal_Unicode)'-' );
aString += aInt.GetString();
- aString += '.';
+ aString += ::rtl::OUString( (sal_Unicode)'.' );
aString += aFrac.GetString().GetBuffer()+1;
return aString;
}
-static SbxINT64 ImpStringToCurrency( const String &r )
+static SbxINT64 ImpStringToCurrency( const ::rtl::OUString &r )
{
int nDec = 4;
String aStr;
- const sal_Unicode* p = r.GetBuffer();
+ const sal_Unicode* p = r.getStr();
if( *p == '-' )
aStr += *p++;
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index a653b77a9b..f1a4c3b6a0 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -86,11 +86,10 @@ double ImpGetDate( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
-#ifndef DOS
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
SvNumberFormatter* pFormatter;
@@ -126,7 +125,7 @@ double ImpGetDate( const SbxValues* p )
pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
nIndex, LANGUAGE_GERMAN, eLangType );
- BOOL bSuccess = pFormatter->IsNumberFormat( *p->pString, nIndex, nRes );
+ BOOL bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
if ( bSuccess )
{
short nType_ = pFormatter->GetType( nIndex );
@@ -141,9 +140,6 @@ double ImpGetDate( const SbxValues* p )
}
delete pFormatter;
-#else
- SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0;
-#endif
}
break;
case SbxOBJECT:
@@ -246,10 +242,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
-#ifndef DOS
{
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
Color* pColor;
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
@@ -299,13 +294,12 @@ start:
nIndex,
LANGUAGE_GERMAN,
eLangType );
- pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor );
+ String aTmpString;
+ pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor );
+ *p->pOUString = aTmpString;
delete pFormatter;
-#endif
break;
-#ifndef DOS
}
-#endif
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx
index 9c28864c0d..c8009245d0 100644
--- a/basic/source/sbx/sbxdbl.cxx
+++ b/basic/source/sbx/sbxdbl.cxx
@@ -76,7 +76,7 @@ double ImpGetDouble( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
{
nRes = 0;
if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
@@ -86,7 +86,7 @@ double ImpGetDouble( const SbxValues* p )
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
{
nRes = 0;
if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
@@ -188,9 +188,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 14, *p->pString, bCoreString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 14, *p->pOUString, bCoreString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 72c6b14f5b..09fa957041 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -211,7 +211,7 @@ void SbxDecimal::setUInt( unsigned int val )
// sbxscan.cxx
void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep );
-bool SbxDecimal::setString( String* pString )
+bool SbxDecimal::setString( ::rtl::OUString* pOUString )
{
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
@@ -224,11 +224,11 @@ bool SbxDecimal::setString( String* pString )
HRESULT hResult;
if( cDecimalSep != '.' || cThousandSep != ',' )
{
- int nLen = pString->Len();
+ int nLen = pOUString->getLength();
sal_Unicode* pBuffer = new sal_Unicode[nLen + 1];
pBuffer[nLen] = 0;
- const sal_Unicode* pSrc = pString->GetBuffer();
+ const sal_Unicode* pSrc = pOUString->getStr();
int i;
for( i = 0 ; i < nLen ; ++i )
pBuffer[i] = pSrc[i];
@@ -248,7 +248,7 @@ bool SbxDecimal::setString( String* pString )
}
else
{
- hResult = VarDecFromStr( (OLECHAR*)pString->GetBuffer(), nLANGID, 0, &maDec );
+ hResult = VarDecFromStr( (OLECHAR*)pOUString->getStr(), nLANGID, 0, &maDec );
}
bRet = ( hResult == S_OK );
return bRet;
@@ -373,7 +373,7 @@ bool SbxDecimal::setSingle( float val ) { (void)val; return false; }
bool SbxDecimal::setDouble( double val ) { (void)val; return false; }
void SbxDecimal::setInt( int val ) { (void)val; }
void SbxDecimal::setUInt( unsigned int val ) { (void)val; }
-bool SbxDecimal::setString( String* pString ) { (void)pString; return false; }
+bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { (void)pOUString; return false; }
bool SbxDecimal::getChar( sal_Unicode& rVal ) { (void)rVal; return false; }
bool SbxDecimal::getByte( BYTE& rVal ) { (void)rVal; return false; }
@@ -388,7 +388,7 @@ bool SbxDecimal::getUInt( unsigned int& rVal ) { (void)rVal; return false; }
#endif
-bool SbxDecimal::getString( String& rString )
+bool SbxDecimal::getString( ::rtl::OUString& rString )
{
#ifdef WIN32
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
@@ -528,7 +528,7 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- pnDecRes->setString( p->pString ); break;
+ pnDecRes->setString( p->pOUString ); break;
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
@@ -670,10 +670,10 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
// ImpCvtNum( (double) n, 0, *p->pString );
- pDec->getString( *p->pString );
+ pDec->getString( *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx
index 3fb31e6860..3b623476bf 100644
--- a/basic/source/sbx/sbxdec.hxx
+++ b/basic/source/sbx/sbxdec.hxx
@@ -85,7 +85,7 @@ public:
bool setDouble( double val );
void setInt( int val );
void setUInt( unsigned int val );
- bool setString( String* pString );
+ bool setString( ::rtl::OUString* pOUString );
void setDecimal( SbxDecimal* pDecimal )
{
#ifdef WIN32
@@ -106,7 +106,7 @@ public:
bool getDouble( double& rVal );
bool getInt( int& rVal );
bool getUInt( unsigned int& rVal );
- bool getString( String& rString );
+ bool getString( ::rtl::OUString& rString );
bool operator -= ( const SbxDecimal &r );
bool operator += ( const SbxDecimal &r );
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index f831040a1d..0ed76dfdef 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -154,13 +154,13 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXINT )
{
@@ -275,9 +275,9 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
@@ -456,20 +456,19 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
- ::rtl::OUString aOUStr( *p->pString );
::rtl::OString aOStr = ::rtl::OUStringToOString
- ( aOUStr, RTL_TEXTENCODING_ASCII_US );
+ ( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
nRes = aOStr.toInt64();
if( nRes == 0 )
{
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else
nRes = ImpDoubleToSalInt64( d );
@@ -575,13 +574,12 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
::rtl::OString aOStr = ::rtl::OString::valueOf( n );
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString
+ (*p->pOUString) = ::rtl::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
- (*p->pString) = aOUStr;
break;
}
case SbxOBJECT:
@@ -745,20 +743,19 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
- ::rtl::OUString aOUStr( *p->pString );
::rtl::OString aOStr = ::rtl::OUStringToOString
- ( aOUStr, RTL_TEXTENCODING_ASCII_US );
+ ( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
sal_Int64 n64 = aOStr.toInt64();
if( n64 == 0 )
{
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXSALUINT64 )
{
@@ -879,16 +876,15 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
if( n > SbxMAXSALINT64 )
SbxBase::SetError( SbxERR_CONVERSION );
else
{
::rtl::OString aOStr = ::rtl::OString::valueOf( (sal_Int64)n );
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString
+ (*p->pOUString) = ::rtl::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
- (*p->pString) = aOUStr;
}
break;
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx
index a36fd1fc49..8ef9f5bd86 100644
--- a/basic/source/sbx/sbxlng.cxx
+++ b/basic/source/sbx/sbxlng.cxx
@@ -119,13 +119,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXLNG )
{
@@ -240,9 +240,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx
index b450bf6faa..40cae63485 100644
--- a/basic/source/sbx/sbxres.cxx
+++ b/basic/source/sbx/sbxres.cxx
@@ -86,6 +86,6 @@ const char* GetSbxRes( USHORT nId )
}
SbxRes::SbxRes( USHORT nId )
- : XubString( String::CreateFromAscii( GetSbxRes( nId ) ) )
+ : ::rtl::OUString( ::rtl::OUString::createFromAscii( GetSbxRes( nId ) ) )
{}
diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx
index 0d4ad5f39e..1685123c5f 100644
--- a/basic/source/sbx/sbxres.hxx
+++ b/basic/source/sbx/sbxres.hxx
@@ -75,7 +75,7 @@
#define SBXRES_MAX 44
-class SbxRes : public String
+class SbxRes : public ::rtl::OUString
{
public:
SbxRes( USHORT );
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index f6d6842786..3bf354c41a 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -71,10 +71,10 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
// Das ganze gibt auch noch einen Konversionsfehler, wenn der Datentyp
// Fixed ist und das ganze nicht hineinpasst!
-SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType,
+SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType,
USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl )
{
- ByteString aBStr( rWSrc, RTL_TEXTENCODING_ASCII_US );
+ ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) );
// Bei International Komma besorgen
char cIntntlComma, cIntntl1000;
@@ -100,7 +100,7 @@ SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType,
cIntntl1000 = (char)cThousandSep;
}
- const char* pStart = aBStr.GetBuffer();
+ const char* pStart = aBStr.getStr();
const char* p = pStart;
char buf[ 80 ], *q = buf;
BOOL bRes = TRUE;
@@ -391,7 +391,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
#pragma warning(disable: 4748) // "... because optimizations are disabled ..."
#endif
-void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString )
+void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString )
{
char *q;
char cBuf[ 40 ], *p = cBuf;
@@ -415,18 +415,18 @@ void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString )
if( *p == cDecimalSep ) p--;
while( *q ) *++p = *q++;
*++p = 0;
- rRes = String::CreateFromAscii( cBuf );
+ rRes = ::rtl::OUString::createFromAscii( cBuf );
}
#ifdef _MSC_VER
#pragma optimize( "", on )
#endif
-BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
+BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
{
// Merken, ob ueberhaupt was geaendert wurde
BOOL bChanged = FALSE;
- String aNewString;
+ ::rtl::OUString aNewString;
// Nur Spezial-Fälle behandeln, als Default tun wir nichts
switch( eTargetType )
@@ -436,7 +436,7 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
case SbxDOUBLE:
case SbxCURRENCY:
{
- ByteString aBStr( rSrc, RTL_TEXTENCODING_ASCII_US );
+ ::rtl::OString aBStr( ::rtl::OUStringToOString( rSrc, RTL_TEXTENCODING_ASCII_US ) );
// Komma besorgen
sal_Unicode cDecimalSep, cThousandSep;
@@ -446,10 +446,11 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
// Ersetzen, wenn DecimalSep kein '.' (nur den ersten)
if( cDecimalSep != (sal_Unicode)'.' )
{
- USHORT nPos = aNewString.Search( cDecimalSep );
- if( nPos != STRING_NOTFOUND )
+ sal_Int32 nPos = aNewString.indexOf( cDecimalSep );
+ if( nPos != -1 )
{
- aNewString.SetChar( nPos, '.' );
+ sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr();
+ pStr[nPos] = (sal_Unicode)'.';
bChanged = TRUE;
}
}
@@ -459,15 +460,15 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
// Bei BOOL TRUE und FALSE als String pruefen
case SbxBOOL:
{
- if( rSrc.EqualsIgnoreCaseAscii( "true" ) )
+ if( rSrc.equalsIgnoreAsciiCaseAscii( "true" ) )
{
- aNewString = String::CreateFromInt32(SbxTRUE);
+ aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE );
bChanged = TRUE;
}
else
- if( rSrc.EqualsIgnoreCaseAscii( "false" ) )
+ if( rSrc.equalsIgnoreAsciiCaseAscii( "false" ) )
{
- aNewString = String::CreateFromInt32(SbxFALSE);
+ aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE );
bChanged = TRUE;
}
break;
@@ -935,7 +936,11 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
//old: printfmtnum( GetDouble(), rRes, *pFmt );
}
else
- ImpCvtNum( GetDouble(), nComma, rRes );
+ {
+ ::rtl::OUString aTmpString( rRes );
+ ImpCvtNum( GetDouble(), nComma, aTmpString );
+ rRes = aTmpString;
+ }
break;
case SbxSTRING:
if( pFmt )
diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx
index d3b873b96a..521a8ff04a 100644
--- a/basic/source/sbx/sbxsng.cxx
+++ b/basic/source/sbx/sbxsng.cxx
@@ -112,13 +112,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXSNG )
{
@@ -237,9 +237,9 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 6, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 6, *p->pOUString );
break;
}
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index 73167aafb2..b4d1c402dd 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -44,12 +44,12 @@ using namespace rtl;
// Die Konversion eines Items auf String wird ueber die Put-Methoden
// der einzelnen Datentypen abgewickelt, um doppelten Code zu vermeiden.
-XubString ImpGetString( const SbxValues* p )
+::rtl::OUString ImpGetString( const SbxValues* p )
{
SbxValues aTmp;
- XubString aRes;
+ ::rtl::OUString aRes;
aTmp.eType = SbxSTRING;
- aTmp.pString = &aRes;
+ aTmp.pOUString = &aRes;
switch( +p->eType )
{
case SbxNULL:
@@ -86,8 +86,8 @@ XubString ImpGetString( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( p->pString )
- aRes = *p->pString;
+ if ( p->pOUString )
+ *aTmp.pOUString = *p->pOUString;
break;
case SbxOBJECT:
{
@@ -109,7 +109,7 @@ XubString ImpGetString( const SbxValues* p )
case SbxERROR:
// Hier wird der String "Error n" erzeugt
aRes = SbxRes( STRING_ERRORMSG );
- aRes += p->nUShort; break;
+ aRes += ::rtl::OUString( p->nUShort ); break;
case SbxDATE:
ImpPutDate( &aTmp, p->nDouble ); break;
@@ -145,7 +145,7 @@ XubString ImpGetString( const SbxValues* p )
}
// AB 10.4.97, neue Funktion fuer SbxValue::GetCoreString()
-XubString ImpGetCoreString( const SbxValues* p )
+::rtl::OUString ImpGetCoreString( const SbxValues* p )
{
// Vorerst nur fuer double
if( ( p->eType & (~SbxBYREF) ) == SbxDOUBLE )
@@ -153,7 +153,6 @@ XubString ImpGetCoreString( const SbxValues* p )
SbxValues aTmp;
XubString aRes;
aTmp.eType = SbxSTRING;
- aTmp.pString = &aRes;
if( p->eType == SbxDOUBLE )
ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE );
else
@@ -164,15 +163,15 @@ XubString ImpGetCoreString( const SbxValues* p )
return ImpGetString( p );
}
-void ImpPutString( SbxValues* p, const XubString* n )
+void ImpPutString( SbxValues* p, const ::rtl::OUString* n )
{
SbxValues aTmp;
aTmp.eType = SbxSTRING;
- XubString* pTmp = NULL;
+ ::rtl::OUString* pTmp = NULL;
// Sicherheitshalber, falls ein NULL-Ptr kommt
if( !n )
- n = pTmp = new XubString;
- aTmp.pString = (XubString*) n;
+ n = pTmp = new ::rtl::OUString;
+ aTmp.pOUString = (::rtl::OUString*)n;
switch( +p->eType )
{
case SbxCHAR:
@@ -209,14 +208,15 @@ void ImpPutString( SbxValues* p, const XubString* n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( n->Len() )
+ if( n->getLength() )
{
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = *n;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( *n );
+ else
+ *p->pOUString = *n;
}
else
- delete p->pString, p->pString = NULL;
+ delete p->pOUString, p->pOUString = NULL;
break;
case SbxOBJECT:
{
@@ -258,18 +258,18 @@ void ImpPutString( SbxValues* p, const XubString* n )
}
// Convert string to an array of bytes, preserving unicode (2bytes per character)
-SbxArray* StringToByteArray(const String& rStr)
+SbxArray* StringToByteArray(const ::rtl::OUString& rStr)
{
- USHORT nArraySize = rStr.Len() * 2;
- const sal_Unicode* pSrc = rStr.GetBuffer();
+ sal_Int32 nArraySize = rStr.getLength() * 2;
+ const sal_Unicode* pSrc = rStr.getStr();
SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
if( nArraySize )
{
if( bIncIndex )
- pArray->AddDim( 1, nArraySize );
+ pArray->AddDim32( 1, nArraySize );
else
- pArray->AddDim( 0, nArraySize-1 );
+ pArray->AddDim32( 0, nArraySize-1 );
}
else
{
@@ -290,7 +290,7 @@ SbxArray* StringToByteArray(const String& rStr)
}
// Convert an array of bytes to string (2bytes per character)
-String ByteArrayToString(SbxArray* pArr)
+::rtl::OUString ByteArrayToString(SbxArray* pArr)
{
USHORT nCount = pArr->Count();
OUStringBuffer aStrBuf;
@@ -315,7 +315,5 @@ String ByteArrayToString(SbxArray* pArr)
aStrBuf.append(aChar);
}
- String aStr(aStrBuf.makeStringAndClear());
-
- return aStr;
+ return aStrBuf.makeStringAndClear();
}
diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx
index 008677959d..94eca8aa34 100644
--- a/basic/source/sbx/sbxuint.cxx
+++ b/basic/source/sbx/sbxuint.cxx
@@ -151,13 +151,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXUINT )
{
@@ -272,9 +272,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx
index aa9f18f7da..b68358c246 100644
--- a/basic/source/sbx/sbxulng.cxx
+++ b/basic/source/sbx/sbxulng.cxx
@@ -127,13 +127,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXULNG )
{
@@ -246,9 +246,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 34ca872679..9cbdeafdb2 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -236,7 +236,7 @@ SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase()
case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break;
case SbxDATE:
case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break;
- case SbxSTRING: n |= SbxBYREF; aData.pString = (XubString*) p; break;
+ case SbxSTRING: n |= SbxBYREF; aData.pOUString = (::rtl::OUString*) p; break;
case SbxERROR:
case SbxUSHORT:
case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break;
@@ -280,8 +280,8 @@ SbxValue::SbxValue( const SbxValue& r )
switch( aData.eType )
{
case SbxSTRING:
- if( aData.pString )
- aData.pString = new XubString( *aData.pString );
+ if( aData.pOUString )
+ aData.pOUString = new ::rtl::OUString( *aData.pOUString );
break;
case SbxOBJECT:
if( aData.pObj )
@@ -309,7 +309,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
&& aData.pObj && ( aData.pObj->GetType() == (SbxARRAY | SbxBYTE) )
&& (r.aData.eType == SbxSTRING) )
{
- String aStr = r.GetString();
+ ::rtl::OUString aStr = r.GetString();
SbxArray* pArr = StringToByteArray(aStr);
PutObject(pArr);
return *this;
@@ -323,7 +323,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
SbxArray* pArr = PTR_CAST(SbxArray, pObj);
if( pArr )
{
- String aStr = ByteArrayToString( pArr );
+ ::rtl::OUString aStr = ByteArrayToString( pArr );
PutString(aStr);
return *this;
}
@@ -385,7 +385,7 @@ void SbxValue::Clear()
case SbxVOID:
break;
case SbxSTRING:
- delete aData.pString; aData.pString = NULL;
+ delete aData.pOUString; aData.pOUString = NULL;
break;
case SbxOBJECT:
if( aData.pObj )
@@ -551,9 +551,9 @@ BOOL SbxValue::Get( SbxValues& rRes ) const
case SbxULONG: rRes.nULong = ImpGetULong( &p->aData ); break;
case SbxLPSTR:
case SbxSTRING: p->aPic = ImpGetString( &p->aData );
- rRes.pString = &p->aPic; break;
+ rRes.pOUString = &p->aPic; break;
case SbxCoreSTRING: p->aPic = ImpGetCoreString( &p->aData );
- rRes.pString = &p->aPic; break;
+ rRes.pOUString = &p->aPic; break;
case SbxINT:
#if SAL_TYPES_SIZEOFINT == 2
rRes.nInt = (int) ImpGetInteger( &p->aData );
@@ -618,13 +618,11 @@ const XubString& SbxValue::GetString() const
SbxValues aRes;
aRes.eType = SbxSTRING;
if( Get( aRes ) )
- // Geht in Ordnung, da Ptr eine Kopie ist
- return *aRes.pString;
+ ((SbxValue*) this)->aToolString = *aRes.pOUString;
else
- {
- ((SbxValue*) this)->aPic.Erase();
- return aPic;
- }
+ ((SbxValue*) this)->aToolString.Erase();
+
+ return aToolString;
}
const XubString& SbxValue::GetCoreString() const
@@ -632,13 +630,22 @@ const XubString& SbxValue::GetCoreString() const
SbxValues aRes;
aRes.eType = SbxCoreSTRING;
if( Get( aRes ) )
- // Geht in Ordnung, da Ptr eine Kopie ist
- return *aRes.pString;
+ ((SbxValue*) this)->aToolString = *aRes.pOUString;
else
- {
- ((SbxValue*) this)->aPic.Erase();
- return aPic;
- }
+ ((SbxValue*) this)->aToolString.Erase();
+
+ return aToolString;
+}
+
+::rtl::OUString SbxValue::GetOUString() const
+{
+ ::rtl::OUString aResult;
+ SbxValues aRes;
+ aRes.eType = SbxSTRING;
+ if( Get( aRes ) )
+ aResult = *aRes.pOUString;
+
+ return aResult;
}
BOOL SbxValue::HasObject() const
@@ -727,7 +734,7 @@ BOOL SbxValue::Put( const SbxValues& rVal )
case SbxUSHORT: ImpPutUShort( &p->aData, rVal.nUShort ); break;
case SbxULONG: ImpPutULong( &p->aData, rVal.nULong ); break;
case SbxLPSTR:
- case SbxSTRING: ImpPutString( &p->aData, rVal.pString ); break;
+ case SbxSTRING: ImpPutString( &p->aData, rVal.pOUString ); break;
case SbxINT:
#if SAL_TYPES_SIZEOFINT == 2
ImpPutInteger( &p->aData, (INT16) rVal.nInt );
@@ -803,10 +810,10 @@ BOOL SbxValue::Put( const SbxValues& rVal )
// werden koennen, wenn Floats mit ',' als Dezimaltrenner oder BOOLs
// explizit mit "TRUE" oder "FALSE" angegeben werden.
// Implementierung in ImpConvStringExt (SBXSCAN.CXX)
-BOOL SbxValue::PutStringExt( const XubString& r )
+BOOL SbxValue::PutStringExt( const ::rtl::OUString& r )
{
// Kopieren, bei Unicode gleich konvertieren
- String aStr( r );
+ ::rtl::OUString aStr( r );
// Eigenen Typ bestimmen (nicht wie in Put() mit TheRealValue(),
// Objekte werden sowieso nicht behandelt)
@@ -820,9 +827,9 @@ BOOL SbxValue::PutStringExt( const XubString& r )
// sonst Original (Unicode bleibt erhalten)
BOOL bRet;
if( ImpConvStringExt( aStr, eTargetType ) )
- aRes.pString = (XubString*)&aStr;
+ aRes.pOUString = (::rtl::OUString*)&aStr;
else
- aRes.pString = (XubString*)&r;
+ aRes.pOUString = (::rtl::OUString*)&r;
// #34939: Bei Strings. die eine Zahl enthalten und wenn this einen
// Num-Typ hat, Fixed-Flag setzen, damit der Typ nicht veraendert wird
@@ -851,10 +858,10 @@ BOOL SbxValue::PutStringExt( const XubString& r )
BOOL SbxValue::PutString( const xub_Unicode* p )
{
- XubString aVal( p );
+ ::rtl::OUString aVal( p );
SbxValues aRes;
aRes.eType = SbxSTRING;
- aRes.pString = &aVal;
+ aRes.pOUString = &aVal;
Put( aRes );
return BOOL( !IsError() );
}
@@ -909,19 +916,19 @@ BOOL SbxValue::fillAutomationDecimal
BOOL SbxValue::PutpChar( const xub_Unicode* p )
{
- XubString aVal( p );
+ ::rtl::OUString aVal( p );
SbxValues aRes;
aRes.eType = SbxLPSTR;
- aRes.pString = &aVal;
+ aRes.pOUString = &aVal;
Put( aRes );
return BOOL( !IsError() );
}
-BOOL SbxValue::PutString( const XubString& r )
+BOOL SbxValue::PutString( const ::rtl::OUString& r )
{
SbxValues aRes;
aRes.eType = SbxSTRING;
- aRes.pString = (XubString*) &r;
+ aRes.pOUString = (::rtl::OUString*) &r;
Put( aRes );
return BOOL( !IsError() );
}
@@ -986,14 +993,14 @@ BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const
SbxDataType t = GetType();
if( t == SbxSTRING )
{
- if( aData.pString )
+ if( aData.pOUString )
{
- XubString s( *aData.pString );
+ ::rtl::OUString s( *aData.pOUString );
double n;
SbxDataType t2;
USHORT nLen = 0;
if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK )
- return BOOL( nLen == s.Len() );
+ return BOOL( nLen == s.getLength() );
}
return FALSE;
}
@@ -1046,7 +1053,7 @@ BOOL SbxValue::SetType( SbxDataType t )
switch( aData.eType )
{
case SbxSTRING:
- delete aData.pString;
+ delete aData.pOUString;
break;
case SbxOBJECT:
if( aData.pObj && aData.pObj != this )
@@ -1163,14 +1170,14 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
Get( aL );
// #30576: Erstmal testen, ob Wandlung geklappt hat
- if( aL.pString != NULL && aR.pString != NULL )
+ if( aL.pOUString != NULL && aR.pOUString != NULL )
{
- *aL.pString += *aR.pString;
+ *aL.pOUString += *aR.pOUString;
}
// Nicht einmal Left OK?
- else if( aL.pString == NULL )
+ else if( aL.pOUString == NULL )
{
- aL.pString = new String();
+ aL.pOUString = new ::rtl::OUString();
}
Put( aL );
}
@@ -1493,17 +1500,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
if( Get( aL ) && rOp.Get( aR ) ) switch( eOp )
{
case SbxEQ:
- bRes = BOOL( *aL.pString == *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString == *aR.pOUString ); break;
case SbxNE:
- bRes = BOOL( *aL.pString != *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString != *aR.pOUString ); break;
case SbxLT:
- bRes = BOOL( *aL.pString < *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString < *aR.pOUString ); break;
case SbxGT:
- bRes = BOOL( *aL.pString > *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString > *aR.pOUString ); break;
case SbxLE:
- bRes = BOOL( *aL.pString <= *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString <= *aR.pOUString ); break;
case SbxGE:
- bRes = BOOL( *aL.pString >= *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString >= *aR.pOUString ); break;
default:
SetError( SbxERR_NOTIMP );
}
@@ -1668,9 +1675,9 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT )
XubString aVal;
r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
if( aVal.Len() )
- aData.pString = new XubString( aVal );
+ aData.pOUString = new ::rtl::OUString( aVal );
else
- aData.pString = NULL; // JSM 22.09.1995
+ aData.pOUString = NULL; // JSM 22.09.1995
break;
}
case SbxERROR:
@@ -1781,9 +1788,9 @@ BOOL SbxValue::StoreData( SvStream& r ) const
break;
}
case SbxSTRING:
- if( aData.pString )
+ if( aData.pOUString )
{
- r.WriteByteString( *aData.pString, RTL_TEXTENCODING_ASCII_US );
+ r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US );
}
else
{
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 69ae79cad5..4ce6eaf961 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -239,9 +239,9 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
if( i )
aTmp += ',';
if( q->nFlags & SBX_OPTIONAL )
- aTmp += SbxRes( STRING_OPTIONAL );
+ aTmp += String( SbxRes( STRING_OPTIONAL ) );
if( q->eType & SbxBYREF )
- aTmp += SbxRes( STRING_BYREF );
+ aTmp += String( SbxRes( STRING_BYREF ) );
aTmp += q->aName;
cType = ' ';
// Kurzer Typ? Dann holen, evtl. ist dieser 0.
@@ -263,12 +263,12 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// langer Typ?
if( t != SbxNAME_SHORT )
{
- aTmp += SbxRes( STRING_AS );
+ aTmp += String( SbxRes( STRING_AS ) );
if( nt < 32 )
- aTmp += SbxRes(
- sal::static_int_cast< USHORT >( STRING_TYPES + nt ) );
+ aTmp += String( SbxRes(
+ sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ) );
else
- aTmp += SbxRes( STRING_ANY );
+ aTmp += String( SbxRes( STRING_ANY ) );
}
}
}
@@ -276,15 +276,15 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// Langer Typ? Dann holen
if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY )
{
- aTmp += SbxRes( STRING_AS );
+ aTmp += String( SbxRes( STRING_AS ) );
if( et < 32 )
- aTmp += SbxRes(
- sal::static_int_cast< USHORT >( STRING_TYPES + et ) );
+ aTmp += String( SbxRes(
+ sal::static_int_cast< USHORT >( STRING_TYPES + et ) ) );
else
- aTmp += SbxRes( STRING_ANY );
+ aTmp += String( SbxRes( STRING_ANY ) );
}
- ((SbxVariable*) this)->aPic = aTmp;
- return aPic;
+ ((SbxVariable*) this)->aToolString = aTmp;
+ return aToolString;
}
// Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet.
@@ -431,9 +431,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD )
nType = SbxEMPTY;
SbxValues aTmp;
- XubString aVal;
+ String aTmpString;
+ ::rtl::OUString aVal;
aTmp.eType = aData.eType = (SbxDataType) nType;
- aTmp.pString = &aVal;
+ aTmp.pOUString = &aVal;
switch( nType )
{
case SbxBOOL:
@@ -445,10 +446,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
case SbxSINGLE:
{
// Floats als ASCII
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
double d;
SbxDataType t;
- if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
+ if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
{
aTmp.nSingle = 0;
return FALSE;
@@ -460,9 +461,9 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
case SbxDOUBLE:
{
// Floats als ASCII
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
SbxDataType t;
- if( ImpScan( aVal, aTmp.nDouble, t, NULL ) != SbxERR_OK )
+ if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK )
{
aTmp.nDouble = 0;
return FALSE;
@@ -470,7 +471,8 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
break;
}
case SbxSTRING:
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
+ aVal = aTmpString;
break;
case SbxEMPTY:
case SbxNULL:
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index b641323507..2eb7a4e77e 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2793,8 +2793,7 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
}
}
-
-//XLibraryContainer3
+//XLibraryContainer3
OUString SAL_CALL SfxLibraryContainer::getOriginalLibraryLinkURL( const OUString& Name )
throw (IllegalArgumentException, NoSuchElementException, RuntimeException)
{
@@ -2808,12 +2807,13 @@ OUString SAL_CALL SfxLibraryContainer::getOriginalLibraryLinkURL( const OUString
}
-::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatModeOn() throw (RuntimeException)
+// XVBACompatibility
+::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatibilityMode() throw (RuntimeException)
{
return mbVBACompat;
}
-void SAL_CALL SfxLibraryContainer::setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException)
+void SAL_CALL SfxLibraryContainer::setVBACompatibilityMode( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException)
{
BasicManager* pBasMgr = getBasicManager();
if( pBasMgr )
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 2bc4787a65..e10d1110f1 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -216,8 +216,7 @@ void SAL_CALL SfxScriptLibraryContainer::writeLibraryElement
Any aElement = xLib->getByName( aElementName );
aElement >>= aMod.aCode;
- Reference < script::XVBAModuleInfo > xModInfo( xLib, UNO_QUERY );
-
+ Reference< script::vba::XVBAModuleInfo > xModInfo( xLib, UNO_QUERY );
if( xModInfo.is() && xModInfo->hasModuleInfo( aElementName ) )
{
script::ModuleInfo aModInfo = xModInfo->getModuleInfo( aElementName );
@@ -312,9 +311,9 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
// aMod.aName ignored
if( aMod.aModuleType.getLength() > 0 )
{
- if( !getVBACompatModeOn() )
+ if( !getVBACompatibilityMode() )
{
- setVBACompatModeOn( sal_True );
+ setVBACompatibilityMode( sal_True );
Any aGlobs;
Sequence< Any > aArgs(1);
@@ -381,8 +380,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
}
}
- Reference< script::XVBAModuleInfo > xVBAModuleInfo( xLib,
- UNO_QUERY );
+ Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY );
if( xVBAModuleInfo.is() )
{
if( xVBAModuleInfo->hasModuleInfo( aElementName ) )
diff --git a/basic/util/makefile.mk b/basic/util/makefile.mk
index 629586f044..31a4dcca8f 100644
--- a/basic/util/makefile.mk
+++ b/basic/util/makefile.mk
@@ -143,4 +143,10 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
$(SRS)$/basic.srs:
$(TYPE) $(SRS)$/classes.srs + $(SRS)$/runtime.srs + $(SRS)$/sbx.srs > $@
+ALLTAR : $(MISC)/sb.component
+$(MISC)/sb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sb.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sb.component
diff --git a/configmgr/source/span.hxx b/basic/util/sb.component
index 6896186137..4687bd1e7d 100644
--- a/configmgr/source/span.hxx
+++ b/basic/util/sb.component
@@ -1,4 +1,5 @@
-/*************************************************************************
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,42 +24,16 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
-************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
-
-#include "sal/config.h"
-
-#include "rtl/string.h"
-#include "sal/types.h"
-
-namespace configmgr {
-
-struct Span {
- char const * begin;
- sal_Int32 length;
-
- inline Span(): begin(0), length(0) {}
- // init length to avoid compiler warnings
-
- inline Span(char const * theBegin, sal_Int32 theLength):
- begin(theBegin), length(theLength) {}
-
- inline void clear() throw() { begin = 0; }
-
- inline bool is() const { return begin != 0; }
-
- inline bool equals(Span const & text) const {
- return rtl_str_compare_WithLength(
- begin, length, text.begin, text.length) == 0;
- }
-
- inline bool equals(char const * textBegin, sal_Int32 textLength) const {
- return equals(Span(textBegin, textLength));
- }
-};
-
-}
-
-#endif
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sfx2.DialogLibraryContainer">
+ <service name="com.sun.star.script.DialogLibraryContainer"/>
+ <service name="com.sun.star.script.DocumentDialogLibraryContainer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.ScriptLibraryContainer">
+ <service name="com.sun.star.script.DocumentScriptLibraryContainer"/>
+ <service name="com.sun.star.script.ScriptLibraryContainer"/>
+ </implementation>
+</component>
diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst
index 9fcccbc73b..bbd0d7f34a 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -1,4 +1,4 @@
-cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport NULL
+cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport xmlreader NULL
cg configmgr\inc nmake - all cg_inc NULL
cg configmgr\source nmake - all cg_source cg_inc NULL
cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL
diff --git a/configmgr/prj/d.lst b/configmgr/prj/d.lst
index 17ccdbe86a..34b6cf3e00 100644
--- a/configmgr/prj/d.lst
+++ b/configmgr/prj/d.lst
@@ -1,3 +1,4 @@
..\%__SRC%\bin\configmgr.uno.dll %_DEST%\bin%_EXT%\configmgr.uno.dll
..\%__SRC%\lib\configmgr.uno.dylib %_DEST%\lib%_EXT%\configmgr.uno.dylib
..\%__SRC%\lib\configmgr.uno.so %_DEST%\lib%_EXT%\configmgr.uno.so
+..\%__SRC%\misc\configmgr.component %_DEST%\xml%_EXT%\configmgr.component
diff --git a/configmgr/source/README b/configmgr/source/README
index b731043d34..f26c68ecf7 100644
--- a/configmgr/source/README
+++ b/configmgr/source/README
@@ -51,16 +51,13 @@ propertynode.cxx
setnode.cxx
Internal representations of data nodes.
-pad.cxx
parsemanager.cxx
parser.hxx
-span.hxx
valueparser.cxx
xcdparser.cxx
xcsparser.cxx
xcuparser.cxx
xmldata.cxx
-xmlreader.cxx
XML file reading.
modifications.cxx
@@ -70,6 +67,7 @@ writemodfile.cxx
broadcaster.cxx
Notification management.
+additions.hxx
update.cxx
Extension manager interface.
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 190db364cd..eda60e6d61 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -798,13 +798,22 @@ void Access::initBroadcasterAndChanges(
css::uno::Any(), css::uno::Any()));
//TODO: non-void ReplacedElement
}
- //TODO: if (allChanges != 0) {
- // allChanges->push_back(
- // css::util::ElementChange(
- // css::uno::makeAny(...),
- // css::uno::Any(), css::uno::Any()));
- // //TODO: non-void ReplacedElement
- //}
+ if (allChanges != 0) {
+ rtl::OUStringBuffer path(
+ getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(
+ Data::createSegment(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")),
+ i->first));
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(path.makeStringAndClear()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
}
// else: spurious Modifications::Node not representing a change
break;
diff --git a/configmgr/source/pad.hxx b/configmgr/source/additions.hxx
index 66a51f4800..f34373c7f7 100644
--- a/configmgr/source/pad.hxx
+++ b/configmgr/source/additions.hxx
@@ -25,36 +25,18 @@
*
************************************************************************/
-#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
+#ifndef INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX
#include "sal/config.h"
-#include "rtl/strbuf.hxx"
-#include "sal/types.h"
+#include <list>
-#include "span.hxx"
+#include "path.hxx"
namespace configmgr {
-class Pad {
-public:
- void add(char const * begin, sal_Int32 length);
-
- void addEphemeral(char const * begin, sal_Int32 length);
-
- void clear();
-
- bool is() const;
-
- Span get() const;
-
-private:
- void flushSpan();
-
- Span span_;
- rtl::OStringBuffer buffer_;
-};
+typedef std::list< Path > Additions;
}
diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
index bb77039dcc..ab59d333d6 100644
--- a/configmgr/source/broadcaster.cxx
+++ b/configmgr/source/broadcaster.cxx
@@ -32,13 +32,17 @@
#include "com/sun/star/beans/XPropertyChangeListener.hpp"
#include "com/sun/star/container/XContainerListener.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/uno/XInterface.hpp"
#include "com/sun/star/util/XChangesListener.hpp"
+#include "cppuhelper/exc_hlp.hxx"
#include "osl/diagnose.hxx"
+#include "rtl/string.h"
+#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
@@ -50,6 +54,13 @@ namespace {
namespace css = com::sun::star;
+void appendMessage(
+ rtl::OUStringBuffer & buffer, css::uno::Exception const & exception)
+{
+ buffer.appendAscii(RTL_CONSTASCII_STRINGPARAM("; "));
+ buffer.append(exception.Message);
+}
+
}
void Broadcaster::addDisposeNotification(
@@ -108,14 +119,16 @@ void Broadcaster::addChangesNotification(
}
void Broadcaster::send() {
- bool exception = false;
+ css::uno::Any exception;
+ rtl::OUStringBuffer messages;
for (DisposeNotifications::iterator i(disposeNotifications_.begin());
i != disposeNotifications_.end(); ++i) {
try {
i->listener->disposing(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
for (ContainerNotifications::iterator i(
@@ -125,8 +138,9 @@ void Broadcaster::send() {
try {
i->listener->elementInserted(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
for (ContainerNotifications::iterator i(
@@ -136,8 +150,9 @@ void Broadcaster::send() {
try {
i->listener->elementRemoved(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
for (ContainerNotifications::iterator i(
@@ -147,8 +162,9 @@ void Broadcaster::send() {
try {
i->listener->elementReplaced(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
for (PropertyChangeNotifications::iterator i(
@@ -158,8 +174,9 @@ void Broadcaster::send() {
try {
i->listener->propertyChange(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
for (PropertiesChangeNotifications::iterator i(
@@ -169,8 +186,9 @@ void Broadcaster::send() {
try {
i->listener->propertiesChange(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
for (ChangesNotifications::iterator i(changesNotifications_.begin());
@@ -178,16 +196,19 @@ void Broadcaster::send() {
try {
i->listener->changesOccurred(i->event);
} catch (css::lang::DisposedException &) {
- } catch (css::uno::Exception &) {
- exception = true;
+ } catch (css::uno::Exception & e) {
+ exception = cppu::getCaughtException();
+ appendMessage(messages, e);
}
}
- if (exception) { //TODO
- throw css::uno::RuntimeException(
- rtl::OUString(
+ if (exception.hasValue()) {
+ throw css::lang::WrappedTargetRuntimeException(
+ (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
- "configmgr exceptions during listener notification")),
- css::uno::Reference< css::uno::XInterface >());
+ "configmgr exceptions during listener notification")) +
+ messages.makeStringAndClear()),
+ css::uno::Reference< css::uno::XInterface >(),
+ exception);
}
}
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index b0f525f1c5..14102f5628 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -54,10 +54,12 @@
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "additions.hxx"
#include "components.hxx"
#include "data.hxx"
#include "modifications.hxx"
#include "node.hxx"
+#include "nodemap.hxx"
#include "parsemanager.hxx"
#include "partial.hxx"
#include "rootaccess.hxx"
@@ -86,12 +88,12 @@ typedef std::list< UnresolvedListItem > UnresolvedList;
void parseXcsFile(
rtl::OUString const & url, int layer, Data & data, Partial const * partial,
- Modifications * modifications)
+ Modifications * modifications, Additions * additions)
SAL_THROW((
css::container::NoSuchElementException, css::uno::RuntimeException))
{
- OSL_ASSERT(partial == 0 && modifications == 0);
- (void) partial; (void) modifications;
+ OSL_ASSERT(partial == 0 && modifications == 0 && additions == 0);
+ (void) partial; (void) modifications; (void) additions;
OSL_VERIFY(
rtl::Reference< ParseManager >(
new ParseManager(url, new XcsParser(layer, data)))->parse());
@@ -99,14 +101,16 @@ void parseXcsFile(
void parseXcuFile(
rtl::OUString const & url, int layer, Data & data, Partial const * partial,
- Modifications * modifications)
+ Modifications * modifications, Additions * additions)
SAL_THROW((
css::container::NoSuchElementException, css::uno::RuntimeException))
{
OSL_VERIFY(
rtl::Reference< ParseManager >(
new ParseManager(
- url, new XcuParser(layer, data, partial, modifications)))->
+ url,
+ new XcuParser(
+ layer, data, partial, modifications, additions)))->
parse());
}
@@ -116,6 +120,29 @@ rtl::OUString expand(rtl::OUString const & str) {
return s;
}
+bool canRemoveFromLayer(int layer, rtl::Reference< Node > const & node) {
+ OSL_ASSERT(node.is());
+ if (node->getLayer() > layer && node->getLayer() < Data::NO_LAYER) {
+ return false;
+ }
+ switch (node->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ case Node::KIND_GROUP:
+ for (NodeMap::iterator i(node->getMembers().begin());
+ i != node->getMembers().end(); ++i)
+ {
+ if (!canRemoveFromLayer(layer, i->second)) {
+ return false;
+ }
+ }
+ return true;
+ case Node::KIND_SET:
+ return node->getMembers().empty();
+ default: // Node::KIND_PROPERTY, Node::KIND_LOCALIZED_VALUE
+ return true;
+ }
+}
+
static bool singletonCreated = false;
static Components * singleton = 0;
@@ -218,7 +245,7 @@ void Components::insertExtensionXcsFile(
bool shared, rtl::OUString const & fileUri)
{
try {
- parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0);
+ parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0, 0);
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -233,9 +260,12 @@ void Components::insertExtensionXcuFile(
bool shared, rtl::OUString const & fileUri, Modifications * modifications)
{
OSL_ASSERT(modifications != 0);
+ int layer = shared ? 10 : 14;
+ Additions * adds = data_.addExtensionXcuAdditions(fileUri, layer);
try {
- parseXcuFile(fileUri, shared ? 10 : 14, data_, 0, modifications);
+ parseXcuFile(fileUri, layer, data_, 0, modifications, adds);
} catch (css::container::NoSuchElementException & e) {
+ data_.removeExtensionXcuAdditions(fileUri);
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
@@ -245,6 +275,58 @@ void Components::insertExtensionXcuFile(
}
}
+void Components::removeExtensionXcuFile(
+ rtl::OUString const & fileUri, Modifications * modifications)
+{
+ //TODO: Ideally, exactly the data coming from the specified xcu file would
+ // be removed. However, not enough information is recorded in the in-memory
+ // data structures to do so. So, as a workaround, all those set elements
+ // that were freshly added by the xcu and have afterwards been left
+ // unchanged or have only had their properties changed in the user layer are
+ // removed (and nothing else). The heuristic to determine
+ // whether a node has been left unchanged is to check the layer ID (as
+ // usual) and additionally to check that the node does not recursively
+ // contain any non-empty sets (multiple extension xcu files are merged into
+ // one layer, so checking layer ID alone is not enough). Since
+ // item->additions records all additions of set members in textual order,
+ // the latter check works well when iterating through item->additions in
+ // reverse order.
+ OSL_ASSERT(modifications != 0);
+ rtl::Reference< Data::ExtensionXcu > item(
+ data_.removeExtensionXcuAdditions(fileUri));
+ if (item.is()) {
+ for (Additions::reverse_iterator i(item->additions.rbegin());
+ i != item->additions.rend(); ++i)
+ {
+ rtl::Reference< Node > parent;
+ NodeMap const * map = &data_.components;
+ rtl::Reference< Node > node;
+ for (Path::const_iterator j(i->begin()); j != i->end(); ++j) {
+ parent = node;
+ node = Data::findNode(Data::NO_LAYER, *map, *j);
+ if (!node.is()) {
+ break;
+ }
+ map = &node->getMembers();
+ }
+ if (node.is()) {
+ OSL_ASSERT(parent.is());
+ if (parent->kind() == Node::KIND_SET) {
+ OSL_ASSERT(
+ node->kind() == Node::KIND_GROUP ||
+ node->kind() == Node::KIND_SET);
+ if (canRemoveFromLayer(item->layer, node)) {
+ parent->getMembers().erase(i->back());
+ data_.modifications.remove(*i);
+ modifications->add(*i);
+ }
+ }
+ }
+ }
+ writeModifications();
+ }
+}
+
void Components::insertModificationXcuFile(
rtl::OUString const & fileUri,
std::set< rtl::OUString > const & includedPaths,
@@ -252,12 +334,14 @@ void Components::insertModificationXcuFile(
Modifications * modifications)
{
OSL_ASSERT(modifications != 0);
+ Partial part(includedPaths, excludedPaths);
try {
- Partial part(includedPaths, excludedPaths);
- parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications);
- } catch (css::uno::Exception & e) { //TODO: more specific exception catching
+ parseFileLeniently(
+ &parseXcuFile, fileUri, Data::NO_LAYER, data_, &part, modifications,
+ 0);
+ } catch (css::container::NoSuchElementException & e) {
OSL_TRACE(
- "configmgr error inserting %s: %s",
+ "configmgr error inserting non-existing %s: %s",
rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(),
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
@@ -369,7 +453,7 @@ Components::Components(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"$BRAND_BASE_DIR/share/registry/modules"))));
- parseXcsXcuIniLayer(
+ parseXcsXcuIniLayer(
7,
expand(
rtl::OUString(
@@ -377,7 +461,8 @@ Components::Components(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
":BUNDLED_EXTENSIONS_USER}/registry/"
"com.sun.star.comp.deployment.configuration."
- "PackageRegistryBackend/configmgr.ini"))));
+ "PackageRegistryBackend/configmgr.ini"))),
+ false);
parseXcsXcuIniLayer(
9,
expand(
@@ -386,8 +471,9 @@ Components::Components(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
":SHARED_EXTENSIONS_USER}/registry/"
"com.sun.star.comp.deployment.configuration."
- "PackageRegistryBackend/configmgr.ini"))));
- parseXcsXcuLayer( //TODO: migrate
+ "PackageRegistryBackend/configmgr.ini"))),
+ true);
+ parseXcsXcuLayer(
11,
expand(
rtl::OUString(
@@ -396,6 +482,8 @@ Components::Components(
":UNO_USER_PACKAGES_CACHE}/registry/"
"com.sun.star.comp.deployment.configuration."
"PackageRegistryBackend/registry"))));
+ // can be dropped once old UserInstallation format can no longer exist
+ // (probably OOo 4)
parseXcsXcuIniLayer(
13,
expand(
@@ -404,21 +492,34 @@ Components::Components(
"${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
":UNO_USER_PACKAGES_CACHE}/registry/"
"com.sun.star.comp.deployment.configuration."
- "PackageRegistryBackend/configmgr.ini"))));
+ "PackageRegistryBackend/configmgr.ini"))),
+ true);
+ parseModificationLayer();
+ RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing");
+}
+
+Components::~Components() {}
+
+void Components::parseFileLeniently(
+ FileParser * parseFile, rtl::OUString const & url, int layer, Data & data,
+ Partial const * partial, Modifications * modifications,
+ Additions * additions)
+{
+ OSL_ASSERT(parseFile != 0);
try {
- parseModificationLayer();
+ (*parseFile)(url, layer, data, partial, modifications, additions);
+ } catch (css::container::NoSuchElementException &) {
+ throw;
} catch (css::uno::Exception & e) { //TODO: more specific exception catching
- // Silently ignore unreadable parts of a corrupted user modification
- // layer, instead of completely preventing OOo from starting:
+ // Silently ignore invalid XML files, instead of completely preventing
+ // OOo from starting:
OSL_TRACE(
- "configmgr error reading user modification layer: %s",
+ "configmgr error reading %s: %s",
+ rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(),
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
- RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing");
}
-Components::~Components() {}
-
void Components::parseFiles(
int layer, rtl::OUString const & extension, FileParser * parseFile,
rtl::OUString const & url, bool recursive)
@@ -470,7 +571,8 @@ void Components::parseFiles(
file.match(extension, file.getLength() - extension.getLength()))
{
try {
- (*parseFile)(stat.getFileURL(), layer, data_, 0, 0);
+ parseFileLeniently(
+ parseFile, stat.getFileURL(), layer, data_, 0, 0, 0);
} catch (css::container::NoSuchElementException & e) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -486,19 +588,26 @@ void Components::parseFiles(
void Components::parseFileList(
int layer, FileParser * parseFile, rtl::OUString const & urls,
- rtl::Bootstrap const & ini)
+ rtl::Bootstrap const & ini, bool recordAdditions)
{
for (sal_Int32 i = 0;;) {
rtl::OUString url(urls.getToken(0, ' ', i));
if (url.getLength() != 0) {
ini.expandMacrosFrom(url); //TODO: detect failure
+ Additions * adds = 0;
+ if (recordAdditions) {
+ adds = data_.addExtensionXcuAdditions(url, layer);
+ }
try {
- (*parseFile)(url, layer, data_, 0, 0);
+ parseFileLeniently(parseFile, url, layer, data_, 0, 0, adds);
} catch (css::container::NoSuchElementException & e) {
OSL_TRACE(
"configmgr file does not exist: %s",
rtl::OUStringToOString(
e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ if (adds != 0) {
+ data_.removeExtensionXcuAdditions(url);
+ }
}
}
if (i == -1) {
@@ -610,18 +719,20 @@ void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) {
url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/data")), false);
}
-void Components::parseXcsXcuIniLayer(int layer, rtl::OUString const & url) {
+void Components::parseXcsXcuIniLayer(
+ int layer, rtl::OUString const & url, bool recordAdditions)
+{
//TODO: rtl::Bootstrap::getFrom "first trie[s] to retrieve the value via the
// global function"
rtl::Bootstrap ini(url);
rtl::OUString urls;
if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCHEMA")), urls))
{
- parseFileList(layer, &parseXcsFile, urls, ini);
+ parseFileList(layer, &parseXcsFile, urls, ini, false);
}
if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls))
{
- parseFileList(layer + 1, &parseXcuFile, urls, ini);
+ parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions);
}
}
@@ -650,13 +761,15 @@ rtl::OUString Components::getModificationFileUrl() const {
void Components::parseModificationLayer() {
try {
- parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0);
+ parseFileLeniently(
+ &parseXcuFile, getModificationFileUrl(), Data::NO_LAYER, data_, 0,
+ 0, 0);
} catch (css::container::NoSuchElementException &) {
OSL_TRACE(
"configmgr user registrymodifications.xcu does not (yet) exist");
// Migrate old user layer data (can be removed once migration is no
- // longer relevant; also see hack for xsi namespace in XmlReader
- // constructor):
+ // longer relevant, probably OOo 4; also see hack for xsi namespace in
+ // xmlreader::XmlReader::registerNamespaceIri):
parseFiles(
Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
&parseXcuFile,
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 2e635680c1..4fc47f7918 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -38,7 +38,10 @@
#include "com/sun/star/uno/Reference.hxx"
#include "rtl/ref.hxx"
+#include "additions.hxx"
#include "data.hxx"
+#include "modifications.hxx"
+#include "nodemap.hxx"
#include "path.hxx"
namespace com { namespace sun { namespace star {
@@ -56,7 +59,6 @@ namespace rtl {
namespace configmgr {
class Broadcaster;
-class Modifications;
class Node;
class Partial;
class RootAccess;
@@ -98,6 +100,9 @@ public:
bool shared, rtl::OUString const & fileUri,
Modifications * modifications);
+ void removeExtensionXcuFile(
+ rtl::OUString const & fileUri, Modifications * modifications);
+
void insertModificationXcuFile(
rtl::OUString const & fileUri,
std::set< rtl::OUString > const & includedPaths,
@@ -109,7 +114,8 @@ public:
private:
typedef void FileParser(
- rtl::OUString const &, int, Data &, Partial const *, Modifications *);
+ rtl::OUString const &, int, Data &, Partial const *, Modifications *,
+ Additions *);
Components(
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
@@ -117,19 +123,25 @@ private:
~Components();
+ void parseFileLeniently(
+ FileParser * parseFile, rtl::OUString const & url, int layer,
+ Data & data, Partial const * partial, Modifications * modifications,
+ Additions * additions);
+
void parseFiles(
int layer, rtl::OUString const & extension, FileParser * parseFile,
rtl::OUString const & url, bool recursive);
void parseFileList(
int layer, FileParser * parseFile, rtl::OUString const & urls,
- rtl::Bootstrap const & ini);
+ rtl::Bootstrap const & ini, bool recordAdditions);
void parseXcdFiles(int layer, rtl::OUString const & url);
void parseXcsXcuLayer(int layer, rtl::OUString const & url);
- void parseXcsXcuIniLayer(int layer, rtl::OUString const & url);
+ void parseXcsXcuIniLayer(
+ int layer, rtl::OUString const & url, bool recordAdditions);
void parseModuleLayer(int layer, rtl::OUString const & url);
diff --git a/configmgr/source/configmgr.component b/configmgr/source/configmgr.component
new file mode 100644
index 0000000000..6ed5125700
--- /dev/null
+++ b/configmgr/source/configmgr.component
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.ConfigurationProvider">
+ <service name="com.sun.star.configuration.ConfigurationProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.configuration.ConfigurationRegistry">
+ <service name="com.sun.star.configuration.ConfigurationRegistry"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.configuration.DefaultProvider">
+ <service name="com.sun.star.configuration.DefaultProvider"/>
+ <singleton name="com.sun.star.configuration.theDefaultProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.configuration.Update">
+ <service name="com.sun.star.configuration.Update_Service"/>
+ <singleton name="com.sun.star.configuration.Update"/>
+ </implementation>
+</component>
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index a89540a881..78d71e73e7 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -241,7 +241,7 @@ Service::createInstanceWithArguments(
if (nodepath.getLength() == 0) {
badNodePath();
}
- // For backwards compatibility, allow a notepath that misses the leading
+ // For backwards compatibility, allow a nodepath that misses the leading
// slash:
if (nodepath[0] != '/') {
nodepath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + nodepath;
@@ -456,7 +456,8 @@ Factory::createInstanceWithArgumentsAndContext(
" arguments")),
0);
}
- // For backwards compatibility, allow "Locale" in any case:
+ // For backwards compatibility, allow "Locale" and (ignored)
+ // "EnableAsync" in any case:
if (name.equalsIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("locale")))
{
@@ -471,8 +472,9 @@ Factory::createInstanceWithArgumentsAndContext(
" one, non-empty, string Locale argument")),
0);
}
- } else {
- //TODO
+ } else if (!name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("enableasync")))
+ {
throw css::uno::Exception(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index e12f959694..50466ca053 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -36,11 +36,13 @@
#include "osl/diagnose.h"
#include "rtl/ref.hxx"
#include "rtl/string.h"
+#include "rtl/textenc.h"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "additions.hxx"
#include "data.hxx"
#include "groupnode.hxx"
#include "node.hxx"
@@ -325,4 +327,46 @@ rtl::Reference< Node > Data::getTemplate(
return findNode(layer, templates, fullName);
}
+Additions * Data::addExtensionXcuAdditions(
+ rtl::OUString const & url, int layer)
+{
+ rtl::Reference< ExtensionXcu > item(new ExtensionXcu);
+ ExtensionXcuAdditions::iterator i(
+ extensionXcuAdditions_.insert(
+ ExtensionXcuAdditions::value_type(
+ url, rtl::Reference< ExtensionXcu >())).first);
+ if (i->second.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "already added extension xcu ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ i->second = item;
+ item->layer = layer;
+ return &item->additions;
+}
+
+rtl::Reference< Data::ExtensionXcu > Data::removeExtensionXcuAdditions(
+ rtl::OUString const & url)
+{
+ ExtensionXcuAdditions::iterator i(extensionXcuAdditions_.find(url));
+ if (i == extensionXcuAdditions_.end()) {
+ // This can happen, as migration of pre OOo 3.3 UserInstallation
+ // extensions in dp_registry::backend::configuration::BackendImpl::
+ // PackageImpl::processPackage_ can cause just-in-time creation of
+ // extension xcu files that are never added via addExtensionXcuAdditions
+ // (also, there might be url spelling differences between calls to
+ // addExtensionXcuAdditions and removeExtensionXcuAdditions?):
+ OSL_TRACE(
+ "unknown configmgr::Data::removeExtensionXcuAdditions(%s)",
+ rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr());
+ return rtl::Reference< ExtensionXcu >();
+ }
+ rtl::Reference< ExtensionXcu > item(i->second);
+ extensionXcuAdditions_.erase(i);
+ return item;
+}
+
}
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
index 52353d066b..8f5f7af0d8 100644
--- a/configmgr/source/data.hxx
+++ b/configmgr/source/data.hxx
@@ -31,18 +31,20 @@
#include "sal/config.h"
#include <climits>
+#include <map>
#include <vector>
#include "boost/noncopyable.hpp"
#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "salhelper/simplereferenceobject.hxx"
+#include "additions.hxx"
#include "modifications.hxx"
#include "nodemap.hxx"
#include "path.hxx"
-namespace rtl { class OUString; }
-
namespace configmgr {
class Node;
@@ -50,6 +52,11 @@ class Node;
struct Data: private boost::noncopyable {
enum { NO_LAYER = INT_MAX };
+ struct ExtensionXcu: public salhelper::SimpleReferenceObject {
+ int layer;
+ Additions additions;
+ };
+
NodeMap templates;
NodeMap components;
@@ -80,6 +87,18 @@ struct Data: private boost::noncopyable {
rtl::Reference< Node > getTemplate(
int layer, rtl::OUString const & fullName) const;
+
+ Additions * addExtensionXcuAdditions(
+ rtl::OUString const & url, int layer);
+
+ rtl::Reference< ExtensionXcu > removeExtensionXcuAdditions(
+ rtl::OUString const & url);
+
+private:
+ typedef std::map< rtl::OUString, rtl::Reference< ExtensionXcu > >
+ ExtensionXcuAdditions;
+
+ ExtensionXcuAdditions extensionXcuAdditions_;
};
}
diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk
index 777fed3323..94747d9dd8 100644
--- a/configmgr/source/makefile.mk
+++ b/configmgr/source/makefile.mk
@@ -52,7 +52,6 @@ SLOFILES = \
$(SLO)/modifications.obj \
$(SLO)/node.obj \
$(SLO)/nodemap.obj \
- $(SLO)/pad.obj \
$(SLO)/parsemanager.obj \
$(SLO)/partial.obj \
$(SLO)/propertynode.obj \
@@ -66,8 +65,7 @@ SLOFILES = \
$(SLO)/xcdparser.obj \
$(SLO)/xcsparser.obj \
$(SLO)/xcuparser.obj \
- $(SLO)/xmldata.obj \
- $(SLO)/xmlreader.obj
+ $(SLO)/xmldata.obj
SHL1IMPLIB = i$(SHL1TARGET)
SHL1OBJS = $(SLOFILES)
@@ -76,9 +74,18 @@ SHL1STDLIBS = \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALHELPERLIB) \
- $(SALLIB)
+ $(SALLIB) \
+ $(XMLREADERLIB)
SHL1TARGET = configmgr.uno
SHL1USE_EXPORTS = name
DEF1NAME = $(SHL1TARGET)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/configmgr.component
+
+$(MISC)/configmgr.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ configmgr.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt configmgr.component
diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx
index 2ad3b5ef8b..add18ceaa1 100644
--- a/configmgr/source/modifications.cxx
+++ b/configmgr/source/modifications.cxx
@@ -59,6 +59,27 @@ void Modifications::add(Path const & path) {
p->children.clear();
}
+void Modifications::remove(Path const & path) {
+ OSL_ASSERT(!path.empty());
+ Node * p = &root_;
+ for (Path::const_iterator i(path.begin());;) {
+ Node::Children::iterator j(p->children.find(*i));
+ if (j == p->children.end()) {
+ break;
+ }
+ if (++i == path.end()) {
+ p->children.erase(j);
+ if (p->children.empty()) {
+ Path parent(path);
+ parent.pop_back();
+ remove(parent);
+ }
+ break;
+ }
+ p = &j->second;
+ }
+}
+
Modifications::Node const & Modifications::getRoot() const {
return root_;
}
diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx
index e29a101501..c28b1aadd1 100644
--- a/configmgr/source/modifications.hxx
+++ b/configmgr/source/modifications.hxx
@@ -54,6 +54,8 @@ public:
void add(Path const & path);
+ void remove(Path const & path);
+
Node const & getRoot() const;
private:
diff --git a/configmgr/source/pad.cxx b/configmgr/source/pad.cxx
deleted file mode 100644
index c8c7218b6d..0000000000
--- a/configmgr/source/pad.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* 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.
-*
-************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include "osl/diagnose.h"
-#include "rtl/string.h"
-#include "sal/types.h"
-
-#include "pad.hxx"
-#include "span.hxx"
-
-namespace configmgr {
-
-void Pad::add(char const * begin, sal_Int32 length) {
- OSL_ASSERT(
- begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
- if (length != 0) {
- flushSpan();
- if (buffer_.getLength() == 0) {
- span_ = Span(begin, length);
- } else {
- buffer_.append(begin, length);
- }
- }
-}
-
-void Pad::addEphemeral(char const * begin, sal_Int32 length) {
- OSL_ASSERT(
- begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
- if (length != 0) {
- flushSpan();
- buffer_.append(begin, length);
- }
-}
-
-void Pad::clear() {
- OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
- span_.clear();
- buffer_.setLength(0);
-}
-
-bool Pad::is() const {
- OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
- return span_.is() || buffer_.getLength() != 0;
-}
-
-Span Pad::get() const {
- OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
- if (span_.is()) {
- return span_;
- } else if (buffer_.getLength() == 0) {
- return Span(RTL_CONSTASCII_STRINGPARAM(""));
- } else {
- return Span(buffer_.getStr(), buffer_.getLength());
- }
-}
-
-void Pad::flushSpan() {
- if (span_.is()) {
- buffer_.append(span_.begin, span_.length);
- span_.clear();
- }
-}
-
-}
diff --git a/configmgr/source/parsemanager.cxx b/configmgr/source/parsemanager.cxx
index 69a5515b97..c17eddd297 100644
--- a/configmgr/source/parsemanager.cxx
+++ b/configmgr/source/parsemanager.cxx
@@ -32,10 +32,11 @@
#include "com/sun/star/uno/RuntimeException.hpp"
#include "osl/diagnose.h"
#include "sal/types.h"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "parsemanager.hxx"
#include "parser.hxx"
-#include "xmlreader.hxx"
namespace configmgr {
@@ -52,28 +53,42 @@ ParseManager::ParseManager(
reader_(url), parser_(parser)
{
OSL_ASSERT(parser.is());
+ int id;
+ id = reader_.registerNamespaceIri(
+ xmlreader::Span(
+ RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry")));
+ OSL_ASSERT(id == NAMESPACE_OOR);
+ id = reader_.registerNamespaceIri(
+ xmlreader::Span(
+ RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema")));
+ OSL_ASSERT(id == NAMESPACE_XS);
+ id = reader_.registerNamespaceIri(
+ xmlreader::Span(
+ RTL_CONSTASCII_STRINGPARAM(
+ "http://www.w3.org/2001/XMLSchema-instance")));
+ OSL_ASSERT(id == NAMESPACE_XSI);
}
bool ParseManager::parse() {
for (;;) {
switch (itemData_.is()
- ? XmlReader::RESULT_BEGIN
+ ? xmlreader::XmlReader::RESULT_BEGIN
: reader_.nextItem(
- parser_->getTextMode(), &itemData_, &itemNamespace_))
+ parser_->getTextMode(), &itemData_, &itemNamespaceId_))
{
- case XmlReader::RESULT_BEGIN:
- if (!parser_->startElement(reader_, itemNamespace_, itemData_))
+ case xmlreader::XmlReader::RESULT_BEGIN:
+ if (!parser_->startElement(reader_, itemNamespaceId_, itemData_))
{
return false;
}
break;
- case XmlReader::RESULT_END:
+ case xmlreader::XmlReader::RESULT_END:
parser_->endElement(reader_);
break;
- case XmlReader::RESULT_TEXT:
+ case xmlreader::XmlReader::RESULT_TEXT:
parser_->characters(itemData_);
break;
- case XmlReader::RESULT_DONE:
+ case xmlreader::XmlReader::RESULT_DONE:
return true;
}
itemData_.clear();
diff --git a/configmgr/source/parsemanager.hxx b/configmgr/source/parsemanager.hxx
index 18292859ab..19d16c7462 100644
--- a/configmgr/source/parsemanager.hxx
+++ b/configmgr/source/parsemanager.hxx
@@ -35,9 +35,8 @@
#include "rtl/ref.hxx"
#include "sal/types.h"
#include "salhelper/simplereferenceobject.hxx"
-
-#include "span.hxx"
-#include "xmlreader.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
namespace rtl { class OUString; }
@@ -55,13 +54,15 @@ public:
bool parse();
+ enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 };
+
private:
virtual ~ParseManager();
- XmlReader reader_;
+ xmlreader::XmlReader reader_;
rtl::Reference< Parser > parser_;
- Span itemData_;
- XmlReader::Namespace itemNamespace_;
+ xmlreader::Span itemData_;
+ int itemNamespaceId_;
};
}
diff --git a/configmgr/source/parser.hxx b/configmgr/source/parser.hxx
index da29941953..f782e0dbc1 100644
--- a/configmgr/source/parser.hxx
+++ b/configmgr/source/parser.hxx
@@ -33,23 +33,23 @@
#include <memory>
#include "salhelper/simplereferenceobject.hxx"
+#include "xmlreader/xmlreader.hxx"
-#include "xmlreader.hxx"
+namespace xmlreader { struct Span; }
namespace configmgr {
-struct Span;
-
class Parser: public salhelper::SimpleReferenceObject {
public:
- virtual XmlReader::Text getTextMode() = 0;
+ virtual xmlreader::XmlReader::Text getTextMode() = 0;
virtual bool startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name) = 0;
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
+ = 0;
- virtual void endElement(XmlReader const & reader) = 0;
+ virtual void endElement(xmlreader::XmlReader const & reader) = 0;
- virtual void characters(Span const & text) = 0;
+ virtual void characters(xmlreader::Span const & text) = 0;
protected:
Parser() {}
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 95a346d720..f5d0bb1372 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -96,11 +96,12 @@ void RootAccess::initBroadcaster(
for (ChangesListeners::iterator i(changesListeners_.begin());
i != changesListeners_.end(); ++i)
{
+ cppu::OWeakObject* pSource = static_cast< cppu::OWeakObject * >(this);
+ css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY );
broadcaster->addChangesNotification(
*i,
css::util::ChangesEvent(
- static_cast< cppu::OWeakObject * >(this),
- css::uno::makeAny(pathRepresentation_), set));
+ pSource, makeAny( xBase ), set));
}
}
}
diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx
index f8c3289664..b1ef8d2169 100644
--- a/configmgr/source/services.cxx
+++ b/configmgr/source/services.cxx
@@ -28,7 +28,6 @@
#include "precompiled_configmgr.hxx"
#include "sal/config.h"
-#include "com/sun/star/registry/XRegistryKey.hpp"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
@@ -36,9 +35,6 @@
#include "cppuhelper/implementationentry.hxx"
#include "osl/diagnose.h"
#include "uno/lbnames.h"
-#include "rtl/textenc.h"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "configurationprovider.hxx"
@@ -89,47 +85,3 @@ component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey)
-{
- if (!component_writeInfoHelper(pServiceManager, pRegistryKey, services)) {
- return false;
- }
- try {
- css::uno::Reference< css::registry::XRegistryKey >(
- (css::uno::Reference< css::registry::XRegistryKey >(
- static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
- createKey(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "/com.sun.star.comp.configuration.DefaultProvider/UNO/"
- "SINGLETONS/"
- "com.sun.star.configuration.theDefaultProvider")))),
- css::uno::UNO_SET_THROW)->
- setStringValue(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.DefaultProvider")));
- css::uno::Reference< css::registry::XRegistryKey >(
- (css::uno::Reference< css::registry::XRegistryKey >(
- static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
- createKey(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "/com.sun.star.comp.configuration.Update/UNO/"
- "SINGLETONS/com.sun.star.configuration.Update")))),
- css::uno::UNO_SET_THROW)->
- setStringValue(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.Update_Service")));
- } catch (css::uno::Exception & e) {
- (void) e;
- OSL_TRACE(
- "configmgr component_writeInfo exception: %s",
- rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
- return false;
- }
- return true;
-}
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
index 4c1d59d5d0..403b761a5a 100644
--- a/configmgr/source/update.cxx
+++ b/configmgr/source/update.cxx
@@ -89,6 +89,9 @@ private:
sal_Bool shared, rtl::OUString const & fileUri)
throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeExtensionXcuFile(rtl::OUString const & fileUri)
+ throw (css::uno::RuntimeException);
+
virtual void SAL_CALL insertModificationXcuFile(
rtl::OUString const & fileUri,
css::uno::Sequence< rtl::OUString > const & includedPaths,
@@ -120,6 +123,20 @@ void Service::insertExtensionXcuFile(
bc.send();
}
+void Service::removeExtensionXcuFile(rtl::OUString const & fileUri)
+ throw (css::uno::RuntimeException)
+{
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ Modifications mods;
+ Components::getSingleton().removeExtensionXcuFile(fileUri, &mods);
+ Components::getSingleton().initGlobalBroadcaster(
+ mods, rtl::Reference< RootAccess >(), &bc);
+ }
+ bc.send();
+}
+
void Service::insertModificationXcuFile(
rtl::OUString const & fileUri,
css::uno::Sequence< rtl::OUString > const & includedPaths,
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index 4adf452c40..0be173f749 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -40,16 +40,17 @@
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "localizedvaluenode.hxx"
#include "node.hxx"
#include "nodemap.hxx"
+#include "parsemanager.hxx"
#include "propertynode.hxx"
-#include "span.hxx"
#include "type.hxx"
#include "valueparser.hxx"
#include "xmldata.hxx"
-#include "xmlreader.hxx"
namespace configmgr {
@@ -74,7 +75,7 @@ bool parseHexDigit(char c, int * value) {
return false;
}
-bool parseValue(Span const & text, sal_Bool * value) {
+bool parseValue(xmlreader::Span const & text, sal_Bool * value) {
OSL_ASSERT(text.is() && value != 0);
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) ||
text.equals(RTL_CONSTASCII_STRINGPARAM("1")))
@@ -91,7 +92,7 @@ bool parseValue(Span const & text, sal_Bool * value) {
return false;
}
-bool parseValue(Span const & text, sal_Int16 * value) {
+bool parseValue(xmlreader::Span const & text, sal_Int16 * value) {
OSL_ASSERT(text.is() && value != 0);
// For backwards compatibility, support hexadecimal values:
sal_Int32 n =
@@ -110,7 +111,7 @@ bool parseValue(Span const & text, sal_Int16 * value) {
return false;
}
-bool parseValue(Span const & text, sal_Int32 * value) {
+bool parseValue(xmlreader::Span const & text, sal_Int32 * value) {
OSL_ASSERT(text.is() && value != 0);
// For backwards compatibility, support hexadecimal values:
*value =
@@ -125,7 +126,7 @@ bool parseValue(Span const & text, sal_Int32 * value) {
return true;
}
-bool parseValue(Span const & text, sal_Int64 * value) {
+bool parseValue(xmlreader::Span const & text, sal_Int64 * value) {
OSL_ASSERT(text.is() && value != 0);
// For backwards compatibility, support hexadecimal values:
*value =
@@ -140,20 +141,22 @@ bool parseValue(Span const & text, sal_Int64 * value) {
return true;
}
-bool parseValue(Span const & text, double * value) {
+bool parseValue(xmlreader::Span const & text, double * value) {
OSL_ASSERT(text.is() && value != 0);
*value = rtl::OString(text.begin, text.length).toDouble();
//TODO: check valid lexical representation
return true;
}
-bool parseValue(Span const & text, rtl::OUString * value) {
+bool parseValue(xmlreader::Span const & text, rtl::OUString * value) {
OSL_ASSERT(text.is() && value != 0);
- *value = xmldata::convertFromUtf8(text);
+ *value = text.convertFromUtf8();
return true;
}
-bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
+bool parseValue(
+ xmlreader::Span const & text, css::uno::Sequence< sal_Int8 > * value)
+{
OSL_ASSERT(text.is() && value != 0);
if ((text.length & 1) != 0) {
return false;
@@ -173,7 +176,9 @@ bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
return true;
}
-template< typename T > css::uno::Any parseSingleValue(Span const & text) {
+template< typename T > css::uno::Any parseSingleValue(
+ xmlreader::Span const & text)
+{
T val;
if (!parseValue(text, &val)) {
throw css::uno::RuntimeException(
@@ -184,21 +189,23 @@ template< typename T > css::uno::Any parseSingleValue(Span const & text) {
}
template< typename T > css::uno::Any parseListValue(
- rtl::OString const & separator, Span const & text)
+ rtl::OString const & separator, xmlreader::Span const & text)
{
comphelper::SequenceAsVector< T > seq;
- Span sep;
+ xmlreader::Span sep;
if (separator.getLength() == 0) {
- sep = Span(RTL_CONSTASCII_STRINGPARAM(" "));
+ sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" "));
} else {
- sep = Span(separator.getStr(), separator.getLength());
+ sep = xmlreader::Span(separator.getStr(), separator.getLength());
}
if (text.length != 0) {
- for (Span t(text);;) {
+ for (xmlreader::Span t(text);;) {
sal_Int32 i = rtl_str_indexOfStr_WithLength(
t.begin, t.length, sep.begin, sep.length);
T val;
- if (!parseValue(Span(t.begin, i == -1 ? t.length : i), &val)) {
+ if (!parseValue(
+ xmlreader::Span(t.begin, i == -1 ? t.length : i), &val))
+ {
throw css::uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
css::uno::Reference< css::uno::XInterface >());
@@ -215,7 +222,7 @@ template< typename T > css::uno::Any parseListValue(
}
css::uno::Any parseValue(
- rtl::OString const & separator, Span const & text, Type type)
+ rtl::OString const & separator, xmlreader::Span const & text, Type type)
{
switch (type) {
case TYPE_ANY:
@@ -266,7 +273,7 @@ ValueParser::ValueParser(int layer): layer_(layer) {}
ValueParser::~ValueParser() {}
-XmlReader::Text ValueParser::getTextMode() const {
+xmlreader::XmlReader::Text ValueParser::getTextMode() const {
if (node_.is()) {
switch (state_) {
case STATE_TEXT:
@@ -278,23 +285,24 @@ XmlReader::Text ValueParser::getTextMode() const {
return
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
separator_.getLength() != 0)
- ? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED;
+ ? xmlreader::XmlReader::TEXT_RAW
+ : xmlreader::XmlReader::TEXT_NORMALIZED;
default:
break;
}
}
- return XmlReader::TEXT_NONE;
+ return xmlreader::XmlReader::TEXT_NONE;
}
bool ValueParser::startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{
if (!node_.is()) {
return false;
}
switch (state_) {
case STATE_TEXT:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
isListType(type_) && separator_.getLength() == 0)
{
@@ -306,18 +314,18 @@ bool ValueParser::startElement(
}
// fall through
case STATE_IT:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) &&
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
{
sal_Int32 scalar = -1;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar")))
{
if (!parseValue(reader.getAttributeValue(true), &scalar)) {
@@ -352,7 +360,7 @@ bool ValueParser::startElement(
}
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
@@ -439,7 +447,7 @@ bool ValueParser::endElement() {
return true;
}
-void ValueParser::characters(Span const & text) {
+void ValueParser::characters(xmlreader::Span const & text) {
if (node_.is()) {
OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT);
pad_.add(text.begin, text.length);
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
index 4e899f4632..c5e1d0a0a4 100644
--- a/configmgr/source/valueparser.hxx
+++ b/configmgr/source/valueparser.hxx
@@ -36,19 +36,19 @@
#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include "rtl/ustring.hxx"
+#include "xmlreader/pad.hxx"
+#include "xmlreader/xmlreader.hxx"
-#include "pad.hxx"
#include "type.hxx"
-#include "xmlreader.hxx"
namespace com { namespace sun { namespace star { namespace uno {
class Any;
} } } }
+namespace xmlreader { struct Span; }
namespace configmgr {
class Node;
-struct Span;
class ValueParser: private boost::noncopyable {
public:
@@ -56,14 +56,14 @@ public:
~ValueParser();
- XmlReader::Text getTextMode() const;
+ xmlreader::XmlReader::Text getTextMode() const;
bool startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
bool endElement();
- void characters(Span const & text);
+ void characters(xmlreader::Span const & text);
void start(
rtl::Reference< Node > const & property,
@@ -83,7 +83,7 @@ private:
rtl::Reference< Node > node_;
rtl::OUString localizedName_;
State state_;
- Pad pad_;
+ xmlreader::Pad pad_;
std::vector< com::sun::star::uno::Any > items_;
};
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index c2573ab674..5616833abf 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -45,6 +45,7 @@
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "xmlreader/span.hxx"
#include "data.hxx"
#include "groupnode.hxx"
@@ -54,7 +55,6 @@
#include "node.hxx"
#include "nodemap.hxx"
#include "propertynode.hxx"
-#include "span.hxx"
#include "type.hxx"
#include "writemodfile.hxx"
@@ -341,22 +341,23 @@ void writeNode(
rtl::Reference< Node > const & parent, rtl::OUString const & name,
rtl::Reference< Node > const & node)
{
- static Span const typeNames[] = {
- Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY
- Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
- Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
- Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
- Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
- Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
- Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
- Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
- Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
+ static xmlreader::Span const typeNames[] = {
+ xmlreader::Span(), xmlreader::Span(), xmlreader::Span(),
+ // TYPE_ERROR, TYPE_NIL, TYPE_ANY
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
+ xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
switch (node->kind()) {
case Node::KIND_PROPERTY:
{
diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
index 498254b356..a7b66fe601 100644
--- a/configmgr/source/xcdparser.cxx
+++ b/configmgr/source/xcdparser.cxx
@@ -37,13 +37,14 @@
#include "rtl/string.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
-#include "span.hxx"
+#include "parsemanager.hxx"
#include "xcdparser.hxx"
#include "xcsparser.hxx"
#include "xcuparser.hxx"
#include "xmldata.hxx"
-#include "xmlreader.hxx"
namespace configmgr {
@@ -59,22 +60,22 @@ XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data & data):
XcdParser::~XcdParser() {}
-XmlReader::Text XcdParser::getTextMode() {
+xmlreader::XmlReader::Text XcdParser::getTextMode() {
return nestedParser_.is()
- ? nestedParser_->getTextMode() : XmlReader::TEXT_NONE;
+ ? nestedParser_->getTextMode() : xmlreader::XmlReader::TEXT_NONE;
}
bool XcdParser::startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{
if (nestedParser_.is()) {
OSL_ASSERT(nesting_ != LONG_MAX);
++nesting_;
- return nestedParser_->startElement(reader, ns, name);
+ return nestedParser_->startElement(reader, nsId, name);
}
switch (state_) {
case STATE_START:
- if (ns == XmlReader::NAMESPACE_OOR &&
+ if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("data")))
{
state_ = STATE_DEPENDENCIES;
@@ -82,18 +83,19 @@ bool XcdParser::startElement(
}
break;
case STATE_DEPENDENCIES:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
{
if (dependency_.getLength() == 0) {
- Span attrFile;
+ xmlreader::Span attrFile;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR
+ if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE &&
+ //TODO: _OOR
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file")))
{
attrFile = reader.getAttributeValue(false);
@@ -107,7 +109,7 @@ bool XcdParser::startElement(
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
- dependency_ = xmldata::convertFromUtf8(attrFile);
+ dependency_ = attrFile.convertFromUtf8();
if (dependency_.getLength() == 0) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -127,19 +129,19 @@ bool XcdParser::startElement(
state_ = STATE_COMPONENTS;
// fall through
case STATE_COMPONENTS:
- if (ns == XmlReader::NAMESPACE_OOR &&
+ if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema")))
{
nestedParser_ = new XcsParser(layer_, data_);
nesting_ = 1;
- return nestedParser_->startElement(reader, ns, name);
+ return nestedParser_->startElement(reader, nsId, name);
}
- if (ns == XmlReader::NAMESPACE_OOR &&
+ if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
{
- nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0);
+ nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0);
nesting_ = 1;
- return nestedParser_->startElement(reader, ns, name);
+ return nestedParser_->startElement(reader, nsId, name);
}
break;
default: // STATE_DEPENDENCY
@@ -148,12 +150,12 @@ bool XcdParser::startElement(
}
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
-void XcdParser::endElement(XmlReader const & reader) {
+void XcdParser::endElement(xmlreader::XmlReader const & reader) {
if (nestedParser_.is()) {
nestedParser_->endElement(reader);
if (--nesting_ == 0) {
@@ -174,7 +176,7 @@ void XcdParser::endElement(XmlReader const & reader) {
}
}
-void XcdParser::characters(Span const & text) {
+void XcdParser::characters(xmlreader::Span const & text) {
if (nestedParser_.is()) {
nestedParser_->characters(text);
}
diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx
index 2ad8ecea7f..a807e011b2 100644
--- a/configmgr/source/xcdparser.hxx
+++ b/configmgr/source/xcdparser.hxx
@@ -34,14 +34,15 @@
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "parser.hxx"
-#include "xmlreader.hxx"
+
+namespace xmlreader { struct Span; }
namespace configmgr {
struct Data;
-struct Span;
class XcdParser: public Parser {
public:
@@ -52,14 +53,14 @@ public:
private:
virtual ~XcdParser();
- virtual XmlReader::Text getTextMode();
+ virtual xmlreader::XmlReader::Text getTextMode();
virtual bool startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
- virtual void endElement(XmlReader const & reader);
+ virtual void endElement(xmlreader::XmlReader const & reader);
- virtual void characters(Span const & text);
+ virtual void characters(xmlreader::Span const & text);
enum State {
STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 79e122759f..1deb8e9f30 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -41,18 +41,19 @@
#include "rtl/string.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "data.hxx"
#include "localizedpropertynode.hxx"
#include "groupnode.hxx"
#include "node.hxx"
#include "nodemap.hxx"
+#include "parsemanager.hxx"
#include "propertynode.hxx"
#include "setnode.hxx"
-#include "span.hxx"
#include "xcsparser.hxx"
#include "xmldata.hxx"
-#include "xmlreader.hxx"
namespace configmgr {
@@ -125,18 +126,18 @@ XcsParser::XcsParser(int layer, Data & data):
XcsParser::~XcsParser() {}
-XmlReader::Text XcsParser::getTextMode() {
+xmlreader::XmlReader::Text XcsParser::getTextMode() {
return valueParser_.getTextMode();
}
bool XcsParser::startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{
- if (valueParser_.startElement(reader, ns, name)) {
+ if (valueParser_.startElement(reader, nsId, name)) {
return true;
}
if (state_ == STATE_START) {
- if (ns == XmlReader::NAMESPACE_OOR &&
+ if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) {
handleComponentSchema(reader);
state_ = STATE_COMPONENT_SCHEMA;
@@ -148,7 +149,7 @@ bool XcsParser::startElement(
// prop constraints; accepting all four at illegal places (and with
// illegal content):
if (ignoring_ > 0 ||
- (ns == XmlReader::NAMESPACE_NONE &&
+ (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
(name.equals(RTL_CONSTASCII_STRINGPARAM("info")) ||
name.equals(RTL_CONSTASCII_STRINGPARAM("import")) ||
name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) ||
@@ -160,7 +161,7 @@ bool XcsParser::startElement(
}
switch (state_) {
case STATE_COMPONENT_SCHEMA:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("templates")))
{
state_ = STATE_TEMPLATES;
@@ -168,7 +169,7 @@ bool XcsParser::startElement(
}
// fall through
case STATE_TEMPLATES_DONE:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{
state_ = STATE_COMPONENT;
@@ -183,13 +184,13 @@ bool XcsParser::startElement(
break;
case STATE_TEMPLATES:
if (elements_.empty()) {
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
{
handleGroup(reader, true);
return true;
}
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
{
handleSet(reader, true);
@@ -203,7 +204,7 @@ bool XcsParser::startElement(
switch (elements_.top().node->kind()) {
case Node::KIND_PROPERTY:
case Node::KIND_LOCALIZED_PROPERTY:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
{
handlePropValue(reader, elements_.top().node);
@@ -211,25 +212,25 @@ bool XcsParser::startElement(
}
break;
case Node::KIND_GROUP:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
{
handleProp(reader);
return true;
}
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref")))
{
handleNodeRef(reader);
return true;
}
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
{
handleGroup(reader, false);
return true;
}
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
{
handleSet(reader, false);
@@ -237,7 +238,7 @@ bool XcsParser::startElement(
}
break;
case Node::KIND_SET:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
{
handleSetItem(
@@ -260,12 +261,12 @@ bool XcsParser::startElement(
}
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
-void XcsParser::endElement(XmlReader const & reader) {
+void XcsParser::endElement(xmlreader::XmlReader const & reader) {
if (valueParser_.endElement()) {
return;
}
@@ -321,15 +322,19 @@ void XcsParser::endElement(XmlReader const & reader) {
} else {
switch (state_) {
case STATE_COMPONENT_SCHEMA:
+ // To support old, broken extensions with .xcs files that contain
+ // empty <component-schema> elements:
+ state_ = STATE_COMPONENT_DONE;
+ break;
+ case STATE_TEMPLATES:
+ state_ = STATE_TEMPLATES_DONE;
+ break;
case STATE_TEMPLATES_DONE:
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("no component element in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
- case STATE_TEMPLATES:
- state_ = STATE_TEMPLATES_DONE;
- break;
case STATE_COMPONENT_DONE:
break;
default:
@@ -338,23 +343,23 @@ void XcsParser::endElement(XmlReader const & reader) {
}
}
-void XcsParser::characters(Span const & text) {
+void XcsParser::characters(xmlreader::Span const & text) {
valueParser_.characters(text);
}
-void XcsParser::handleComponentSchema(XmlReader & reader) {
+void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
//TODO: oor:version, xml:lang attributes
rtl::OStringBuffer buf;
buf.append('.');
bool hasPackage = false;
bool hasName = false;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
{
if (hasPackage) {
@@ -367,9 +372,9 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >());
}
hasPackage = true;
- Span s(reader.getAttributeValue(false));
+ xmlreader::Span s(reader.getAttributeValue(false));
buf.insert(0, s.begin, s.length);
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
if (hasName) {
@@ -381,7 +386,7 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >());
}
hasName = true;
- Span s(reader.getAttributeValue(false));
+ xmlreader::Span s(reader.getAttributeValue(false));
buf.append(s.begin, s.length);
}
}
@@ -401,38 +406,36 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
- componentName_ = xmldata::convertFromUtf8(
- Span(buf.getStr(), buf.getLength()));
+ componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
+ convertFromUtf8();
}
-void XcsParser::handleNodeRef(XmlReader & reader) {
+void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) {
bool hasName = false;
rtl::OUString name;
rtl::OUString component(componentName_);
bool hasNodeType = false;
rtl::OUString nodeType;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{
- component = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ component = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{
hasNodeType = true;
- nodeType = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
+ nodeType = reader.getAttributeValue(false).convertFromUtf8();
}
}
if (!hasName) {
@@ -461,33 +464,33 @@ void XcsParser::handleNodeRef(XmlReader & reader) {
elements_.push(Element(node, name));
}
-void XcsParser::handleProp(XmlReader & reader) {
+void XcsParser::handleProp(xmlreader::XmlReader & reader) {
bool hasName = false;
rtl::OUString name;
valueParser_.type_ = TYPE_ERROR;
bool localized = false;
bool nillable = true;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{
valueParser_.type_ = xmldata::parseType(
reader, reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized")))
{
localized = xmldata::parseBoolean(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable")))
{
nillable = xmldata::parseBoolean(reader.getAttributeValue(true));
@@ -521,16 +524,16 @@ void XcsParser::handleProp(XmlReader & reader) {
}
void XcsParser::handlePropValue(
- XmlReader & reader, rtl::Reference< Node > const & property)
+ xmlreader::XmlReader & reader, rtl::Reference< Node > const & property)
{
- Span attrSeparator;
+ xmlreader::Span attrSeparator;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
{
attrSeparator = reader.getAttributeValue(false);
@@ -549,22 +552,22 @@ void XcsParser::handlePropValue(
valueParser_.start(property);
}
-void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
+void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) {
bool hasName = false;
rtl::OUString name;
bool extensible = false;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible")))
{
extensible = xmldata::parseBoolean(reader.getAttributeValue(true));
@@ -588,34 +591,32 @@ void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
name));
}
-void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
+void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) {
bool hasName = false;
rtl::OUString name;
rtl::OUString component(componentName_);
bool hasNodeType = false;
rtl::OUString nodeType;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{
- component = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ component = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{
hasNodeType = true;
- nodeType = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
+ nodeType = reader.getAttributeValue(false).convertFromUtf8();
}
}
if (!hasName) {
@@ -638,27 +639,25 @@ void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
name));
}
-void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) {
+void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) {
rtl::OUString component(componentName_);
bool hasNodeType = false;
rtl::OUString nodeType;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{
- component = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ component = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{
hasNodeType = true;
- nodeType = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
+ nodeType = reader.getAttributeValue(false).convertFromUtf8();
}
}
set->getAdditionalTemplateNames().push_back(
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
index 196add9a82..1fac315c07 100644
--- a/configmgr/source/xcsparser.hxx
+++ b/configmgr/source/xcsparser.hxx
@@ -34,17 +34,18 @@
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "node.hxx"
#include "parser.hxx"
#include "valueparser.hxx"
-#include "xmlreader.hxx"
+
+namespace xmlreader { struct Span; }
namespace configmgr {
class SetNode;
struct Data;
-struct Span;
class XcsParser: public Parser {
public:
@@ -53,29 +54,29 @@ public:
private:
virtual ~XcsParser();
- virtual XmlReader::Text getTextMode();
+ virtual xmlreader::XmlReader::Text getTextMode();
virtual bool startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
- virtual void endElement(XmlReader const & reader);
+ virtual void endElement(xmlreader::XmlReader const & reader);
- virtual void characters(Span const & text);
+ virtual void characters(xmlreader::Span const & text);
- void handleComponentSchema(XmlReader & reader);
+ void handleComponentSchema(xmlreader::XmlReader & reader);
- void handleNodeRef(XmlReader & reader);
+ void handleNodeRef(xmlreader::XmlReader & reader);
- void handleProp(XmlReader & reader);
+ void handleProp(xmlreader::XmlReader & reader);
void handlePropValue(
- XmlReader & reader, rtl::Reference< Node > const & property);
+ xmlreader::XmlReader & reader, rtl::Reference< Node > const & property);
- void handleGroup(XmlReader & reader, bool isTemplate);
+ void handleGroup(xmlreader::XmlReader & reader, bool isTemplate);
- void handleSet(XmlReader & reader, bool isTemplate);
+ void handleSet(xmlreader::XmlReader & reader, bool isTemplate);
- void handleSetItem(XmlReader & reader, SetNode * set);
+ void handleSetItem(xmlreader::XmlReader & reader, SetNode * set);
enum State {
STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES,
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index cd1e6e55d0..1a9575bb67 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -41,6 +41,8 @@
#include "rtl/string.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "data.hxx"
#include "localizedpropertynode.hxx"
@@ -49,14 +51,13 @@
#include "modifications.hxx"
#include "node.hxx"
#include "nodemap.hxx"
+#include "parsemanager.hxx"
#include "partial.hxx"
#include "path.hxx"
#include "propertynode.hxx"
#include "setnode.hxx"
-#include "span.hxx"
#include "xcuparser.hxx"
#include "xmldata.hxx"
-#include "xmlreader.hxx"
namespace configmgr {
@@ -68,32 +69,33 @@ namespace css = com::sun::star;
XcuParser::XcuParser(
int layer, Data & data, Partial const * partial,
- Modifications * broadcastModifications):
+ Modifications * broadcastModifications, Additions * additions):
valueParser_(layer), data_(data),
partial_(partial), broadcastModifications_(broadcastModifications),
- recordModifications_(layer == Data::NO_LAYER),
+ additions_(additions), recordModifications_(layer == Data::NO_LAYER),
trackPath_(
- partial_ != 0 || broadcastModifications_ != 0 || recordModifications_)
+ partial_ != 0 || broadcastModifications_ != 0 || additions_ != 0 ||
+ recordModifications_)
{}
XcuParser::~XcuParser() {}
-XmlReader::Text XcuParser::getTextMode() {
+xmlreader::XmlReader::Text XcuParser::getTextMode() {
return valueParser_.getTextMode();
}
bool XcuParser::startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{
- if (valueParser_.startElement(reader, ns, name)) {
+ if (valueParser_.startElement(reader, nsId, name)) {
return true;
}
if (state_.empty()) {
- if (ns == XmlReader::NAMESPACE_OOR &&
+ if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
{
handleComponentData(reader);
- } else if (ns == XmlReader::NAMESPACE_OOR &&
+ } else if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("items")))
{
state_.push(State(rtl::Reference< Node >(), false));
@@ -101,7 +103,7 @@ bool XcuParser::startElement(
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bad root element <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
@@ -109,7 +111,7 @@ bool XcuParser::startElement(
} else if (state_.top().ignore) {
state_.push(State(false));
} else if (!state_.top().node.is()) {
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
{
handleItem(reader);
@@ -117,7 +119,7 @@ bool XcuParser::startElement(
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
@@ -125,7 +127,7 @@ bool XcuParser::startElement(
} else {
switch (state_.top().node->kind()) {
case Node::KIND_PROPERTY:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
{
handlePropValue(
@@ -136,14 +138,14 @@ bool XcuParser::startElement(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"bad property node member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
break;
case Node::KIND_LOCALIZED_PROPERTY:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
{
handleLocpropValue(
@@ -155,7 +157,7 @@ bool XcuParser::startElement(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"bad localized property node member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
@@ -164,18 +166,18 @@ bool XcuParser::startElement(
case Node::KIND_LOCALIZED_VALUE:
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
case Node::KIND_GROUP:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
{
handleGroupProp(
reader,
dynamic_cast< GroupNode * >(state_.top().node.get()));
- } else if (ns == XmlReader::NAMESPACE_NONE &&
+ } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
{
handleGroupNode(reader, state_.top().node);
@@ -184,19 +186,19 @@ bool XcuParser::startElement(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"bad group node member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
break;
case Node::KIND_SET:
- if (ns == XmlReader::NAMESPACE_NONE &&
+ if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
{
handleSetNode(
reader, dynamic_cast< SetNode * >(state_.top().node.get()));
- } else if (ns == XmlReader::NAMESPACE_NONE &&
+ } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
{
OSL_TRACE(
@@ -208,7 +210,7 @@ bool XcuParser::startElement(
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) +
- xmldata::convertFromUtf8(name) +
+ name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
@@ -219,7 +221,7 @@ bool XcuParser::startElement(
return true;
}
-void XcuParser::endElement(XmlReader const &) {
+void XcuParser::endElement(xmlreader::XmlReader const &) {
if (valueParser_.endElement()) {
return;
}
@@ -244,11 +246,11 @@ void XcuParser::endElement(XmlReader const &) {
}
}
-void XcuParser::characters(Span const & text) {
+void XcuParser::characters(xmlreader::Span const & text) {
valueParser_.characters(text);
}
-XcuParser::Operation XcuParser::parseOperation(Span const & text) {
+XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) {
OSL_ASSERT(text.is());
if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) {
return OPERATION_MODIFY;
@@ -264,11 +266,11 @@ XcuParser::Operation XcuParser::parseOperation(Span const & text) {
}
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) +
- xmldata::convertFromUtf8(text)),
+ text.convertFromUtf8()),
css::uno::Reference< css::uno::XInterface >());
}
-void XcuParser::handleComponentData(XmlReader & reader) {
+void XcuParser::handleComponentData(xmlreader::XmlReader & reader) {
rtl::OStringBuffer buf;
buf.append('.');
bool hasPackage = false;
@@ -276,12 +278,12 @@ void XcuParser::handleComponentData(XmlReader & reader) {
Operation op = OPERATION_MODIFY;
bool finalized = false;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
{
if (hasPackage) {
@@ -294,9 +296,9 @@ void XcuParser::handleComponentData(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >());
}
hasPackage = true;
- Span s(reader.getAttributeValue(false));
+ xmlreader::Span s(reader.getAttributeValue(false));
buf.insert(0, s.begin, s.length);
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
if (hasName) {
@@ -308,13 +310,13 @@ void XcuParser::handleComponentData(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >());
}
hasName = true;
- Span s(reader.getAttributeValue(false));
+ xmlreader::Span s(reader.getAttributeValue(false));
buf.append(s.begin, s.length);
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{
op = parseOperation(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
@@ -336,8 +338,8 @@ void XcuParser::handleComponentData(XmlReader & reader) {
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
- componentName_ = xmldata::convertFromUtf8(
- Span(buf.getStr(), buf.getLength()));
+ componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
+ convertFromUtf8();
if (trackPath_) {
OSL_ASSERT(path_.empty());
path_.push_back(componentName_);
@@ -379,15 +381,15 @@ void XcuParser::handleComponentData(XmlReader & reader) {
state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
}
-void XcuParser::handleItem(XmlReader & reader) {
- Span attrPath;
+void XcuParser::handleItem(xmlreader::XmlReader & reader) {
+ xmlreader::Span attrPath;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path")))
{
attrPath = reader.getAttributeValue(false);
@@ -400,7 +402,7 @@ void XcuParser::handleItem(XmlReader & reader) {
reader.getUrl()),
css::uno::Reference< css::uno::XInterface >());
}
- rtl::OUString path(xmldata::convertFromUtf8(attrPath));
+ rtl::OUString path(attrPath.convertFromUtf8());
int finalizedLayer;
rtl::Reference< Node > node(
data_.resolvePathRepresentation(
@@ -445,21 +447,23 @@ void XcuParser::handleItem(XmlReader & reader) {
state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
}
-void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
+void XcuParser::handlePropValue(
+ xmlreader::XmlReader & reader, PropertyNode * prop)
+ {
bool nil = false;
rtl::OString separator;
rtl::OUString external;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_XSI &&
+ if (attrNsId == ParseManager::NAMESPACE_XSI &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
{
nil = xmldata::parseBoolean(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{
Type type = xmldata::parseType(
@@ -472,10 +476,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
css::uno::Reference< css::uno::XInterface >());
}
valueParser_.type_ = type;
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
{
- Span s(reader.getAttributeValue(false));
+ xmlreader::Span s(reader.getAttributeValue(false));
if (s.length == 0) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -485,10 +489,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
css::uno::Reference< css::uno::XInterface >());
}
separator = rtl::OString(s.begin, s.length);
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external")))
{
- external = xmldata::convertFromUtf8(reader.getAttributeValue(true));
+ external = reader.getAttributeValue(true).convertFromUtf8();
if (external.getLength() == 0) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -528,27 +532,27 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
}
void XcuParser::handleLocpropValue(
- XmlReader & reader, LocalizedPropertyNode * locprop)
+ xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop)
{
rtl::OUString name;
bool nil = false;
rtl::OString separator;
Operation op = OPERATION_FUSE;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_XML &&
+ if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang")))
{
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_XSI &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_XSI &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
{
nil = xmldata::parseBoolean(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{
Type type = xmldata::parseType(
@@ -561,10 +565,10 @@ void XcuParser::handleLocpropValue(
css::uno::Reference< css::uno::XInterface >());
}
valueParser_.type_ = type;
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
{
- Span s(reader.getAttributeValue(false));
+ xmlreader::Span s(reader.getAttributeValue(false));
if (s.length == 0) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -574,7 +578,7 @@ void XcuParser::handleLocpropValue(
css::uno::Reference< css::uno::XInterface >());
}
separator = rtl::OString(s.begin, s.length);
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{
op = parseOperation(reader.getAttributeValue(true));
@@ -624,7 +628,7 @@ void XcuParser::handleLocpropValue(
pop = true;
}
if (trackPath_) {
- recordModification();
+ recordModification(false);
if (pop) {
path_.pop_back();
}
@@ -638,7 +642,7 @@ void XcuParser::handleLocpropValue(
locprop->getMembers().erase(i);
}
state_.push(State(true));
- recordModification();
+ recordModification(false);
break;
default:
throw css::uno::RuntimeException(
@@ -650,32 +654,34 @@ void XcuParser::handleLocpropValue(
}
}
-void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
+void XcuParser::handleGroupProp(
+ xmlreader::XmlReader & reader, GroupNode * group)
+{
bool hasName = false;
rtl::OUString name;
Type type = TYPE_ERROR;
Operation op = OPERATION_MODIFY;
bool finalized = false;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{
type = xmldata::parseType(reader, reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{
op = parseOperation(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
@@ -725,8 +731,8 @@ void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
}
void XcuParser::handleUnknownGroupProp(
- XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
- Type type, Operation operation, bool finalized)
+ xmlreader::XmlReader const & reader, GroupNode * group,
+ rtl::OUString const & name, Type type, Operation operation, bool finalized)
{
switch (operation) {
case OPERATION_REPLACE:
@@ -750,7 +756,7 @@ void XcuParser::handleUnknownGroupProp(
prop->setFinalized(valueParser_.getLayer());
}
state_.push(State(prop, name, state_.top().locked));
- recordModification();
+ recordModification(false);
break;
}
// fall through
@@ -766,7 +772,7 @@ void XcuParser::handleUnknownGroupProp(
}
void XcuParser::handlePlainGroupProp(
- XmlReader const & reader, GroupNode * group,
+ xmlreader::XmlReader const & reader, GroupNode * group,
NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
Type type, Operation operation, bool finalized)
{
@@ -800,7 +806,7 @@ void XcuParser::handlePlainGroupProp(
property,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- recordModification();
+ recordModification(false);
break;
case OPERATION_REMOVE:
if (!property->isExtension()) {
@@ -814,13 +820,13 @@ void XcuParser::handlePlainGroupProp(
}
group->getMembers().erase(propertyIndex);
state_.push(State(true)); // ignore children
- recordModification();
+ recordModification(false);
break;
}
}
void XcuParser::handleLocalizedGroupProp(
- XmlReader const & reader, LocalizedPropertyNode * property,
+ xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
rtl::OUString const & name, Type type, Operation operation, bool finalized)
{
if (property->getLayer() > valueParser_.getLayer()) {
@@ -863,7 +869,7 @@ void XcuParser::handleLocalizedGroupProp(
replacement, name,
(state_.top().locked ||
finalizedLayer < valueParser_.getLayer())));
- recordModification();
+ recordModification(false);
}
break;
case OPERATION_REMOVE:
@@ -878,28 +884,28 @@ void XcuParser::handleLocalizedGroupProp(
}
void XcuParser::handleGroupNode(
- XmlReader & reader, rtl::Reference< Node > const & group)
+ xmlreader::XmlReader & reader, rtl::Reference< Node > const & group)
{
bool hasName = false;
rtl::OUString name;
Operation op = OPERATION_MODIFY;
bool finalized = false;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{
op = parseOperation(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
@@ -949,7 +955,7 @@ void XcuParser::handleGroupNode(
state_.top().locked || finalizedLayer < valueParser_.getLayer()));
}
-void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
+void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) {
bool hasName = false;
rtl::OUString name;
rtl::OUString component(componentName_);
@@ -959,36 +965,34 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
bool finalized = false;
bool mandatory = false;
for (;;) {
- XmlReader::Namespace attrNs;
- Span attrLn;
- if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ int attrNsId;
+ xmlreader::Span attrLn;
+ if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break;
}
- if (attrNs == XmlReader::NAMESPACE_OOR &&
+ if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{
hasName = true;
- name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ name = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{
- component = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ component = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{
hasNodeType = true;
- nodeType = xmldata::convertFromUtf8(
- reader.getAttributeValue(false));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ nodeType = reader.getAttributeValue(false).convertFromUtf8();
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{
op = parseOperation(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
- } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory")))
{
mandatory = xmldata::parseBoolean(reader.getAttributeValue(true));
@@ -1070,7 +1074,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
member->setFinalized(finalizedLayer);
member->setMandatory(mandatoryLayer);
state_.push(State(member, name, false));
- recordModification();
+ recordModification(i == set->getMembers().end());
}
break;
case OPERATION_FUSE:
@@ -1084,7 +1088,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
member->setFinalized(finalizedLayer);
member->setMandatory(mandatoryLayer);
state_.push(State(member, name, false));
- recordModification();
+ recordModification(true);
}
} else {
state_.push(
@@ -1104,15 +1108,18 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
set->getMembers().erase(i);
}
state_.push(State(true));
- recordModification();
+ recordModification(false);
break;
}
}
-void XcuParser::recordModification() {
+void XcuParser::recordModification(bool addition) {
if (broadcastModifications_ != 0) {
broadcastModifications_->add(path_);
}
+ if (addition && additions_ != 0) {
+ additions_->push_back(path_);
+ }
if (recordModifications_) {
data_.modifications.add(path_);
}
diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx
index 64108451b4..6cd600c8aa 100644
--- a/configmgr/source/xcuparser.hxx
+++ b/configmgr/source/xcuparser.hxx
@@ -34,7 +34,9 @@
#include "rtl/ref.hxx"
#include "rtl/ustring.hxx"
+#include "xmlreader/xmlreader.hxx"
+#include "additions.hxx"
#include "node.hxx"
#include "nodemap.hxx"
#include "parser.hxx"
@@ -42,7 +44,8 @@
#include "type.hxx"
#include "valueparser.hxx"
#include "xmldata.hxx"
-#include "xmlreader.hxx"
+
+namespace xmlreader { struct Span; }
namespace configmgr {
@@ -53,62 +56,62 @@ class Partial;
class PropertyNode;
class SetNode;
struct Data;
-struct Span;
class XcuParser: public Parser {
public:
XcuParser(
int layer, Data & data, Partial const * partial,
- Modifications * broadcastModifications);
+ Modifications * broadcastModifications, Additions * additions);
private:
virtual ~XcuParser();
- virtual XmlReader::Text getTextMode();
+ virtual xmlreader::XmlReader::Text getTextMode();
virtual bool startElement(
- XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+ xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
- virtual void endElement(XmlReader const & reader);
+ virtual void endElement(xmlreader::XmlReader const & reader);
- virtual void characters(Span const & span);
+ virtual void characters(xmlreader::Span const & span);
enum Operation {
OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE };
- static Operation parseOperation(Span const & text);
+ static Operation parseOperation(xmlreader::Span const & text);
- void handleComponentData(XmlReader & reader);
+ void handleComponentData(xmlreader::XmlReader & reader);
- void handleItem(XmlReader & reader);
+ void handleItem(xmlreader::XmlReader & reader);
- void handlePropValue(XmlReader & reader, PropertyNode * prop);
+ void handlePropValue(xmlreader::XmlReader & reader, PropertyNode * prop);
void handleLocpropValue(
- XmlReader & reader, LocalizedPropertyNode * locprop);
+ xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop);
- void handleGroupProp(XmlReader & reader, GroupNode * group);
+ void handleGroupProp(xmlreader::XmlReader & reader, GroupNode * group);
void handleUnknownGroupProp(
- XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
- Type type, Operation operation, bool finalized);
+ xmlreader::XmlReader const & reader, GroupNode * group,
+ rtl::OUString const & name, Type type, Operation operation,
+ bool finalized);
void handlePlainGroupProp(
- XmlReader const & reader, GroupNode * group,
+ xmlreader::XmlReader const & reader, GroupNode * group,
NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
Type type, Operation operation, bool finalized);
void handleLocalizedGroupProp(
- XmlReader const & reader, LocalizedPropertyNode * property,
+ xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
rtl::OUString const & name, Type type, Operation operation,
bool finalized);
void handleGroupNode(
- XmlReader & reader, rtl::Reference< Node > const & group);
+ xmlreader::XmlReader & reader, rtl::Reference< Node > const & group);
- void handleSetNode(XmlReader & reader, SetNode * set);
+ void handleSetNode(xmlreader::XmlReader & reader, SetNode * set);
- void recordModification();
+ void recordModification(bool addition);
struct State {
rtl::Reference< Node > node; // empty iff ignore or <items>
@@ -141,6 +144,7 @@ private:
Data & data_;
Partial const * partial_;
Modifications * broadcastModifications_;
+ Additions * additions_;
bool recordModifications_;
bool trackPath_;
rtl::OUString componentName_;
diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx
index 07ad4d17a3..7d3d9ead3d 100644
--- a/configmgr/source/xmldata.cxx
+++ b/configmgr/source/xmldata.cxx
@@ -40,12 +40,12 @@
#include "rtl/ref.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/string.h"
-#include "rtl/textcvt.h"
-#include "rtl/textenc.h"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "xmlreader/span.hxx"
+#include "xmlreader/xmlreader.hxx"
#include "data.hxx"
#include "groupnode.hxx"
@@ -57,9 +57,7 @@
#include "parser.hxx"
#include "propertynode.hxx"
#include "setnode.hxx"
-#include "span.hxx"
#include "type.hxx"
-#include "xmlreader.hxx"
namespace configmgr {
@@ -71,90 +69,88 @@ namespace css = com::sun::star;
}
-rtl::OUString convertFromUtf8(Span const & text) {
- OSL_ASSERT(text.is());
- rtl_uString * s = 0;
- if (!rtl_convertStringToUString(
- &s, text.begin, text.length, RTL_TEXTENCODING_UTF8,
- (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
- RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
- RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
- {
- throw css::uno::RuntimeException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("cannot convert from UTF-8")),
- css::uno::Reference< css::uno::XInterface >());
- }
- return rtl::OUString(s, SAL_NO_ACQUIRE);
-}
-
-Type parseType(XmlReader const & reader, Span const & text) {
+Type parseType(
+ xmlreader::XmlReader const & reader, xmlreader::Span const & text)
+{
OSL_ASSERT(text.is());
sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':');
if (i >= 0) {
- switch (reader.getNamespace(Span(text.begin, i))) {
- case XmlReader::NAMESPACE_OOR:
- if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("any")))
+ switch (reader.getNamespaceId(xmlreader::Span(text.begin, i))) {
+ case ParseManager::NAMESPACE_OOR:
+ if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("any")))
{
return TYPE_ANY;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("boolean-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("boolean-list")))
{
return TYPE_BOOLEAN_LIST;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("short-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("short-list")))
{
return TYPE_SHORT_LIST;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("int-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("int-list")))
{
return TYPE_INT_LIST;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("long-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("long-list")))
{
return TYPE_LONG_LIST;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("double-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("double-list")))
{
return TYPE_DOUBLE_LIST;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("string-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("string-list")))
{
return TYPE_STRING_LIST;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
{
return TYPE_HEXBINARY_LIST;
}
break;
- case XmlReader::NAMESPACE_XS:
- if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("boolean")))
+ case ParseManager::NAMESPACE_XS:
+ if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("boolean")))
{
return TYPE_BOOLEAN;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("short")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("short")))
{
return TYPE_SHORT;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("int")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("int")))
{
return TYPE_INT;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("long")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("long")))
{
return TYPE_LONG;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("double")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("double")))
{
return TYPE_DOUBLE;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("string")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("string")))
{
return TYPE_STRING;
- } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
- RTL_CONSTASCII_STRINGPARAM("hexBinary")))
+ } else if (xmlreader::Span(
+ text.begin + i + 1, text.length - (i + 1)).
+ equals(RTL_CONSTASCII_STRINGPARAM("hexBinary")))
{
return TYPE_HEXBINARY;
}
@@ -165,11 +161,11 @@ Type parseType(XmlReader const & reader, Span const & text) {
}
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) +
- convertFromUtf8(text)),
+ text.convertFromUtf8()),
css::uno::Reference< css::uno::XInterface >());
}
-bool parseBoolean(Span const & text) {
+bool parseBoolean(xmlreader::Span const & text) {
OSL_ASSERT(text.is());
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
return true;
@@ -179,7 +175,7 @@ bool parseBoolean(Span const & text) {
}
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) +
- convertFromUtf8(text)),
+ text.convertFromUtf8()),
css::uno::Reference< css::uno::XInterface >());
}
diff --git a/configmgr/source/xmldata.hxx b/configmgr/source/xmldata.hxx
index 15a0a36336..e60e1082ca 100644
--- a/configmgr/source/xmldata.hxx
+++ b/configmgr/source/xmldata.hxx
@@ -33,19 +33,19 @@
#include "type.hxx"
namespace rtl { class OUString; }
+namespace xmlreader {
+ class XmlReader;
+ struct Span;
+}
namespace configmgr {
-class XmlReader;
-struct Span;
-
namespace xmldata {
-rtl::OUString convertFromUtf8(Span const & text);
-
-Type parseType(XmlReader const & reader, Span const & text);
+Type parseType(
+ xmlreader::XmlReader const & reader, xmlreader::Span const & text);
-bool parseBoolean(Span const & text);
+bool parseBoolean(xmlreader::Span const & text);
rtl::OUString parseTemplateReference(
rtl::OUString const & component, bool hasNodeType,
diff --git a/configmgr/source/xmlreader.cxx b/configmgr/source/xmlreader.cxx
deleted file mode 100644
index ac6a08d186..0000000000
--- a/configmgr/source/xmlreader.cxx
+++ /dev/null
@@ -1,1054 +0,0 @@
-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* 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.
-*
-************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include <cstddef>
-
-#include "com/sun/star/container/NoSuchElementException.hpp"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/XInterface.hpp"
-#include "osl/diagnose.h"
-#include "osl/file.h"
-#include "rtl/string.h"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-#include "pad.hxx"
-#include "span.hxx"
-#include "xmlreader.hxx"
-
-namespace configmgr {
-
-namespace {
-
-namespace css = com::sun::star;
-
-bool isSpace(char c) {
- switch (c) {
- case '\x09':
- case '\x0A':
- case '\x0D':
- case ' ':
- return true;
- default:
- return false;
- }
-}
-
-}
-
-XmlReader::XmlReader(rtl::OUString const & fileUrl)
- SAL_THROW((
- css::container::NoSuchElementException, css::uno::RuntimeException)):
- fileUrl_(fileUrl)
-{
- switch (osl_openFile(fileUrl_.pData, &fileHandle_, osl_File_OpenFlag_Read))
- {
- case osl_File_E_None:
- break;
- case osl_File_E_NOENT:
- throw css::container::NoSuchElementException(
- fileUrl_, css::uno::Reference< css::uno::XInterface >());
- default:
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot open ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- oslFileError e = osl_getFileSize(fileHandle_, &fileSize_);
- if (e == osl_File_E_None) {
- e = osl_mapFile(
- fileHandle_, &fileAddress_, fileSize_, 0,
- osl_File_MapFlag_WillNeed);
- }
- if (e != osl_File_E_None) {
- e = osl_closeFile(fileHandle_);
- if (e != osl_File_E_None) {
- OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e));
- }
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot mmap ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- namespaces_.push_back(
- NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xml")), NAMESPACE_XML));
- namespaces_.push_back(
- NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xsi")), NAMESPACE_XSI));
- // old user layer .xcu files used the xsi namespace prefix without
- // declaring a corresponding namespace binding, see issue 77174; reading
- // those files during migration would fail without this hack that can be
- // removed once migration is no longer relevant (see
- // Components::parseModificationLayer)
- pos_ = static_cast< char * >(fileAddress_);
- end_ = pos_ + fileSize_;
- state_ = STATE_CONTENT;
-}
-
-XmlReader::~XmlReader() {
- oslFileError e = osl_unmapFile(fileAddress_, fileSize_);
- if (e != osl_File_E_None) {
- OSL_TRACE("osl_unmapFile failed with %ld", static_cast< long >(e));
- }
- e = osl_closeFile(fileHandle_);
- if (e != osl_File_E_None) {
- OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e));
- }
-}
-
-XmlReader::Result XmlReader::nextItem(
- Text reportText, Span * data, Namespace * ns)
-{
- switch (state_) {
- case STATE_CONTENT:
- switch (reportText) {
- case TEXT_NONE:
- return handleSkippedText(data, ns);
- case TEXT_RAW:
- return handleRawText(data);
- case TEXT_NORMALIZED:
- return handleNormalizedText(data);
- }
- case STATE_START_TAG:
- return handleStartTag(ns, data);
- case STATE_END_TAG:
- return handleEndTag();
- case STATE_EMPTY_ELEMENT_TAG:
- handleElementEnd();
- return RESULT_END;
- default: // STATE_DONE
- return RESULT_DONE;
- }
-}
-
-bool XmlReader::nextAttribute(Namespace * ns, Span * localName) {
- OSL_ASSERT(ns != 0 && localName != 0);
- if (firstAttribute_) {
- currentAttribute_ = attributes_.begin();
- firstAttribute_ = false;
- } else {
- ++currentAttribute_;
- }
- if (currentAttribute_ == attributes_.end()) {
- return false;
- }
- if (currentAttribute_->nameColon == 0) {
- *ns = NAMESPACE_NONE;
- *localName = Span(
- currentAttribute_->nameBegin,
- currentAttribute_->nameEnd - currentAttribute_->nameBegin);
- } else {
- *ns = getNamespace(
- Span(
- currentAttribute_->nameBegin,
- currentAttribute_->nameColon - currentAttribute_->nameBegin));
- *localName = Span(
- currentAttribute_->nameColon + 1,
- currentAttribute_->nameEnd - (currentAttribute_->nameColon + 1));
- }
- return true;
-}
-
-Span XmlReader::getAttributeValue(bool fullyNormalize) {
- return handleAttributeValue(
- currentAttribute_->valueBegin, currentAttribute_->valueEnd,
- fullyNormalize);
-}
-
-XmlReader::Namespace XmlReader::getNamespace(Span const & prefix) const {
- for (NamespaceList::const_reverse_iterator i(namespaces_.rbegin());
- i != namespaces_.rend(); ++i)
- {
- if (prefix.equals(i->prefix)) {
- return i->ns;
- }
- }
- return NAMESPACE_OTHER;
-}
-
-rtl::OUString XmlReader::getUrl() const {
- return fileUrl_;
-}
-
-void XmlReader::normalizeLineEnds(Span const & text) {
- char const * p = text.begin;
- sal_Int32 n = text.length;
- for (;;) {
- sal_Int32 i = rtl_str_indexOfChar_WithLength(p, n, '\x0D');
- if (i < 0) {
- break;
- }
- pad_.add(p, i);
- p += i + 1;
- n -= i + 1;
- if (n == 0 || *p != '\x0A') {
- pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A"));
- }
- }
- pad_.add(p, n);
-}
-
-void XmlReader::skipSpace() {
- while (isSpace(peek())) {
- ++pos_;
- }
-}
-
-bool XmlReader::skipComment() {
- if (rtl_str_shortenedCompare_WithLength(
- pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"),
- RTL_CONSTASCII_LENGTH("--")) !=
- 0)
- {
- return false;
- }
- pos_ += RTL_CONSTASCII_LENGTH("--");
- sal_Int32 i = rtl_str_indexOfStr_WithLength(
- pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"));
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within comment) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- pos_ += i + RTL_CONSTASCII_LENGTH("--");
- if (read() != '>') {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "illegal \"--\" within comment in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- return true;
-}
-
-void XmlReader::skipProcessingInstruction() {
- sal_Int32 i = rtl_str_indexOfStr_WithLength(
- pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("?>"));
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad '<?' in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- pos_ += i + RTL_CONSTASCII_LENGTH("?>");
-}
-
-void XmlReader::skipDocumentTypeDeclaration() {
- // Neither is it checked that the doctypedecl is at the correct position in
- // the document, nor that it is well-formed:
- for (;;) {
- char c = read();
- switch (c) {
- case '\0': // i.e., EOF
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within DTD) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- case '"':
- case '\'':
- {
- sal_Int32 i = rtl_str_indexOfChar_WithLength(
- pos_, end_ - pos_, c);
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within DTD) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- pos_ += i + 1;
- }
- break;
- case '>':
- return;
- case '[':
- for (;;) {
- c = read();
- switch (c) {
- case '\0': // i.e., EOF
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within DTD) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- case '"':
- case '\'':
- {
- sal_Int32 i = rtl_str_indexOfChar_WithLength(
- pos_, end_ - pos_, c);
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within DTD) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- pos_ += i + 1;
- }
- break;
- case '<':
- switch (read()) {
- case '\0': // i.e., EOF
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within DTD) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- case '!':
- skipComment();
- break;
- case '?':
- skipProcessingInstruction();
- break;
- default:
- break;
- }
- break;
- case ']':
- skipSpace();
- if (read() != '>') {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "missing \">\" of DTD in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- return;
- default:
- break;
- }
- }
- default:
- break;
- }
- }
-}
-
-Span XmlReader::scanCdataSection() {
- if (rtl_str_shortenedCompare_WithLength(
- pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("[CDATA["),
- RTL_CONSTASCII_LENGTH("[CDATA[")) !=
- 0)
- {
- return Span();
- }
- pos_ += RTL_CONSTASCII_LENGTH("[CDATA[");
- char const * begin = pos_;
- sal_Int32 i = rtl_str_indexOfStr_WithLength(
- pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("]]>"));
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "premature end (within CDATA section) of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- pos_ += i + RTL_CONSTASCII_LENGTH("]]>");
- return Span(begin, i);
-}
-
-bool XmlReader::scanName(char const ** nameColon) {
- OSL_ASSERT(nameColon != 0 && *nameColon == 0);
- for (char const * begin = pos_;; ++pos_) {
- switch (peek()) {
- case '\0': // i.e., EOF
- case '\x09':
- case '\x0A':
- case '\x0D':
- case ' ':
- case '/':
- case '=':
- case '>':
- return pos_ != begin;
- case ':':
- *nameColon = pos_;
- break;
- default:
- break;
- }
- }
-}
-
-XmlReader::Namespace XmlReader::scanNamespaceIri(
- char const * begin, char const * end)
-{
- OSL_ASSERT(begin != 0 && begin <= end);
- Span iri(handleAttributeValue(begin, end, false));
- struct Iri {
- char const * begin;
- sal_Int32 length;
- XmlReader::Namespace ns;
- };
- static Iri const iris[] = {
- { RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry"),
- XmlReader::NAMESPACE_OOR },
- { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema"),
- XmlReader::NAMESPACE_XS },
- { RTL_CONSTASCII_STRINGPARAM(
- "http://www.w3.org/2001/XMLSchema-instance"),
- XmlReader::NAMESPACE_XSI },
- { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/XML/1998/namespace"),
- XmlReader::NAMESPACE_XML } };
- for (std::size_t i = 0; i < sizeof iris / sizeof iris[0]; ++i) {
- if (rtl_str_compare_WithLength(
- iri.begin, iri.length, iris[i].begin, iris[i].length) ==
- 0)
- {
- return iris[i].ns;
- }
- }
- return XmlReader::NAMESPACE_OTHER;
-}
-
-char const * XmlReader::handleReference(char const * position, char const * end)
-{
- OSL_ASSERT(position != 0 && *position == '&' && position < end);
- ++position;
- if (*position == '#') {
- ++position;
- sal_Int32 val = 0;
- char const * p;
- if (*position == 'x') {
- ++position;
- p = position;
- for (;; ++position) {
- char c = *position;
- if (c >= '0' && c <= '9') {
- val = 16 * val + (c - '0');
- } else if (c >= 'A' && c <= 'F') {
- val = 16 * val + (c - 'A') + 10;
- } else if (c >= 'a' && c <= 'f') {
- val = 16 * val + (c - 'a') + 10;
- } else {
- break;
- }
- if (val > 0x10FFFF) { // avoid overflow
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "'&#x...' too large in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- }
- } else {
- p = position;
- for (;; ++position) {
- char c = *position;
- if (c >= '0' && c <= '9') {
- val = 10 * val + (c - '0');
- } else {
- break;
- }
- if (val > 0x10FFFF) { // avoid overflow
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "'&#...' too large in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- }
- }
- if (position == p || *position++ != ';') {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("'&#...' missing ';' in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- OSL_ASSERT(val >= 0 && val <= 0x10FFFF);
- if ((val < 0x20 && val != 0x9 && val != 0xA && val != 0xD) ||
- (val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF)
- {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "character reference denoting invalid character in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char buf[4];
- sal_Int32 len;
- if (val < 0x80) {
- buf[0] = static_cast< char >(val);
- len = 1;
- } else if (val < 0x800) {
- buf[0] = static_cast< char >((val >> 6) | 0xC0);
- buf[1] = static_cast< char >((val & 0x3F) | 0x80);
- len = 2;
- } else if (val < 0x10000) {
- buf[0] = static_cast< char >((val >> 12) | 0xE0);
- buf[1] = static_cast< char >(((val >> 6) & 0x3F) | 0x80);
- buf[2] = static_cast< char >((val & 0x3F) | 0x80);
- len = 3;
- } else {
- buf[0] = static_cast< char >((val >> 18) | 0xF0);
- buf[1] = static_cast< char >(((val >> 12) & 0x3F) | 0x80);
- buf[2] = static_cast< char >(((val >> 6) & 0x3F) | 0x80);
- buf[3] = static_cast< char >((val & 0x3F) | 0x80);
- len = 4;
- }
- pad_.addEphemeral(buf, len);
- return position;
- } else {
- struct EntityRef {
- char const * inBegin;
- sal_Int32 inLength;
- char const * outBegin;
- sal_Int32 outLength;
- };
- static EntityRef const refs[] = {
- { RTL_CONSTASCII_STRINGPARAM("amp;"),
- RTL_CONSTASCII_STRINGPARAM("&") },
- { RTL_CONSTASCII_STRINGPARAM("lt;"),
- RTL_CONSTASCII_STRINGPARAM("<") },
- { RTL_CONSTASCII_STRINGPARAM("gt;"),
- RTL_CONSTASCII_STRINGPARAM(">") },
- { RTL_CONSTASCII_STRINGPARAM("apos;"),
- RTL_CONSTASCII_STRINGPARAM("'") },
- { RTL_CONSTASCII_STRINGPARAM("quot;"),
- RTL_CONSTASCII_STRINGPARAM("\"") } };
- for (std::size_t i = 0; i < sizeof refs / sizeof refs[0]; ++i) {
- if (rtl_str_shortenedCompare_WithLength(
- position, end - position, refs[i].inBegin, refs[i].inLength,
- refs[i].inLength) ==
- 0)
- {
- position += refs[i].inLength;
- pad_.add(refs[i].outBegin, refs[i].outLength);
- return position;
- }
- }
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("unknown entity reference in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
-}
-
-Span XmlReader::handleAttributeValue(
- char const * begin, char const * end, bool fullyNormalize)
-{
- pad_.clear();
- if (fullyNormalize) {
- while (begin != end && isSpace(*begin)) {
- ++begin;
- }
- while (end != begin && isSpace(end[-1])) {
- --end;
- }
- char const * p = begin;
- enum Space { SPACE_NONE, SPACE_SPAN, SPACE_BREAK };
- // a single true space character can go into the current span,
- // everything else breaks the span
- Space space = SPACE_NONE;
- while (p != end) {
- switch (*p) {
- case '\x09':
- case '\x0A':
- case '\x0D':
- switch (space) {
- case SPACE_NONE:
- pad_.add(begin, p - begin);
- pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
- space = SPACE_BREAK;
- break;
- case SPACE_SPAN:
- pad_.add(begin, p - begin);
- space = SPACE_BREAK;
- break;
- case SPACE_BREAK:
- break;
- }
- begin = ++p;
- break;
- case ' ':
- switch (space) {
- case SPACE_NONE:
- ++p;
- space = SPACE_SPAN;
- break;
- case SPACE_SPAN:
- pad_.add(begin, p - begin);
- begin = ++p;
- space = SPACE_BREAK;
- break;
- case SPACE_BREAK:
- begin = ++p;
- break;
- }
- break;
- case '&':
- pad_.add(begin, p - begin);
- p = handleReference(p, end);
- begin = p;
- space = SPACE_NONE;
- break;
- default:
- ++p;
- space = SPACE_NONE;
- break;
- }
- }
- pad_.add(begin, p - begin);
- } else {
- char const * p = begin;
- while (p != end) {
- switch (*p) {
- case '\x09':
- case '\x0A':
- pad_.add(begin, p - begin);
- begin = ++p;
- pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
- break;
- case '\x0D':
- pad_.add(begin, p - begin);
- ++p;
- if (peek() == '\x0A') {
- ++p;
- }
- begin = p;
- pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
- break;
- case '&':
- pad_.add(begin, p - begin);
- p = handleReference(p, end);
- begin = p;
- break;
- default:
- ++p;
- break;
- }
- }
- pad_.add(begin, p - begin);
- }
- return pad_.get();
-}
-
-XmlReader::Result XmlReader::handleStartTag(Namespace * ns, Span * localName) {
- OSL_ASSERT(ns != 0 && localName);
- char const * nameBegin = pos_;
- char const * nameColon = 0;
- if (!scanName(&nameColon)) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad tag name in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char const * nameEnd = pos_;
- NamespaceList::size_type inheritedNamespaces = namespaces_.size();
- bool hasDefaultNs = false;
- Namespace defaultNs = NAMESPACE_NONE;
- attributes_.clear();
- for (;;) {
- char const * p = pos_;
- skipSpace();
- if (peek() == '/' || peek() == '>') {
- break;
- }
- if (pos_ == p) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "missing whitespace before attribute in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char const * attrNameBegin = pos_;
- char const * attrNameColon = 0;
- if (!scanName(&attrNameColon)) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("bad attribute name in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char const * attrNameEnd = pos_;
- skipSpace();
- if (read() != '=') {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '=' in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- skipSpace();
- char del = read();
- if (del != '\'' && del != '"') {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("bad attribute value in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char const * valueBegin = pos_;
- sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, del);
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "unterminated attribute value in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char const * valueEnd = pos_ + i;
- pos_ += i + 1;
- if (attrNameColon == 0 &&
- Span(attrNameBegin, attrNameEnd - attrNameBegin).equals(
- RTL_CONSTASCII_STRINGPARAM("xmlns")))
- {
- hasDefaultNs = true;
- defaultNs = scanNamespaceIri(valueBegin, valueEnd);
- } else if (attrNameColon != 0 &&
- Span(attrNameBegin, attrNameColon - attrNameBegin).equals(
- RTL_CONSTASCII_STRINGPARAM("xmlns")))
- {
- namespaces_.push_back(
- NamespaceData(
- Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)),
- scanNamespaceIri(valueBegin, valueEnd)));
- } else {
- attributes_.push_back(
- AttributeData(
- attrNameBegin, attrNameEnd, attrNameColon, valueBegin,
- valueEnd));
- }
- }
- if (!hasDefaultNs && !elements_.empty()) {
- defaultNs = elements_.top().defaultNamespace;
- }
- firstAttribute_ = true;
- if (peek() == '/') {
- state_ = STATE_EMPTY_ELEMENT_TAG;
- ++pos_;
- } else {
- state_ = STATE_CONTENT;
- }
- if (peek() != '>') {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- ++pos_;
- elements_.push(
- ElementData(
- Span(nameBegin, nameEnd - nameBegin), inheritedNamespaces,
- defaultNs));
- if (nameColon == 0) {
- *ns = defaultNs;
- *localName = Span(nameBegin, nameEnd - nameBegin);
- } else {
- *ns = getNamespace(Span(nameBegin, nameColon - nameBegin));
- *localName = Span(nameColon + 1, nameEnd - (nameColon + 1));
- }
- return RESULT_BEGIN;
-}
-
-XmlReader::Result XmlReader::handleEndTag() {
- if (elements_.empty()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("spurious end tag in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- char const * nameBegin = pos_;
- char const * nameColon = 0;
- if (!scanName(&nameColon) ||
- !elements_.top().name.equals(nameBegin, pos_ - nameBegin))
- {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- handleElementEnd();
- skipSpace();
- if (peek() != '>') {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- ++pos_;
- return RESULT_END;
-}
-
-void XmlReader::handleElementEnd() {
- OSL_ASSERT(!elements_.empty());
- namespaces_.resize(elements_.top().inheritedNamespaces);
- elements_.pop();
- state_ = elements_.empty() ? STATE_DONE : STATE_CONTENT;
-}
-
-XmlReader::Result XmlReader::handleSkippedText(Span * data, Namespace * ns) {
- for (;;) {
- sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, '<');
- if (i < 0) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- }
- pos_ += i + 1;
- switch (peek()) {
- case '!':
- ++pos_;
- if (!skipComment() && !scanCdataSection().is()) {
- skipDocumentTypeDeclaration();
- }
- break;
- case '/':
- ++pos_;
- return handleEndTag();
- case '?':
- ++pos_;
- skipProcessingInstruction();
- break;
- default:
- return handleStartTag(ns, data);
- }
- }
-}
-
-XmlReader::Result XmlReader::handleRawText(Span * text) {
- pad_.clear();
- for (char const * begin = pos_;;) {
- switch (peek()) {
- case '\0': // i.e., EOF
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- case '\x0D':
- pad_.add(begin, pos_ - begin);
- ++pos_;
- if (peek() != '\x0A') {
- pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A"));
- }
- begin = pos_;
- break;
- case '&':
- pad_.add(begin, pos_ - begin);
- pos_ = handleReference(pos_, end_);
- begin = pos_;
- break;
- case '<':
- pad_.add(begin, pos_ - begin);
- ++pos_;
- switch (peek()) {
- case '!':
- ++pos_;
- if (!skipComment()) {
- Span cdata(scanCdataSection());
- if (cdata.is()) {
- normalizeLineEnds(cdata);
- } else {
- skipDocumentTypeDeclaration();
- }
- }
- begin = pos_;
- break;
- case '/':
- *text = pad_.get();
- ++pos_;
- state_ = STATE_END_TAG;
- return RESULT_TEXT;
- case '?':
- ++pos_;
- skipProcessingInstruction();
- begin = pos_;
- break;
- default:
- *text = pad_.get();
- state_ = STATE_START_TAG;
- return RESULT_TEXT;
- }
- break;
- default:
- ++pos_;
- break;
- }
- }
-}
-
-XmlReader::Result XmlReader::handleNormalizedText(Span * text) {
- pad_.clear();
- char const * flowBegin = pos_;
- char const * flowEnd = pos_;
- enum Space { SPACE_START, SPACE_NONE, SPACE_SPAN, SPACE_BREAK };
- // a single true space character can go into the current flow,
- // everything else breaks the flow
- Space space = SPACE_START;
- for (;;) {
- switch (peek()) {
- case '\0': // i.e., EOF
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
- fileUrl_),
- css::uno::Reference< css::uno::XInterface >());
- case '\x09':
- case '\x0A':
- case '\x0D':
- switch (space) {
- case SPACE_START:
- case SPACE_BREAK:
- break;
- case SPACE_NONE:
- case SPACE_SPAN:
- space = SPACE_BREAK;
- break;
- }
- ++pos_;
- break;
- case ' ':
- switch (space) {
- case SPACE_START:
- case SPACE_BREAK:
- break;
- case SPACE_NONE:
- space = SPACE_SPAN;
- break;
- case SPACE_SPAN:
- space = SPACE_BREAK;
- break;
- }
- ++pos_;
- break;
- case '&':
- switch (space) {
- case SPACE_START:
- break;
- case SPACE_NONE:
- case SPACE_SPAN:
- pad_.add(flowBegin, pos_ - flowBegin);
- break;
- case SPACE_BREAK:
- pad_.add(flowBegin, flowEnd - flowBegin);
- pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
- break;
- }
- pos_ = handleReference(pos_, end_);
- flowBegin = pos_;
- flowEnd = pos_;
- space = SPACE_NONE;
- break;
- case '<':
- ++pos_;
- switch (peek()) {
- case '!':
- ++pos_;
- if (skipComment()) {
- space = SPACE_BREAK;
- } else {
- Span cdata(scanCdataSection());
- if (cdata.is()) {
- // CDATA is not normalized (similar to character
- // references; it keeps the code simple), but it might
- // arguably be better to normalize it:
- switch (space) {
- case SPACE_START:
- break;
- case SPACE_NONE:
- case SPACE_SPAN:
- pad_.add(flowBegin, pos_ - flowBegin);
- break;
- case SPACE_BREAK:
- pad_.add(flowBegin, flowEnd - flowBegin);
- pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
- break;
- }
- normalizeLineEnds(cdata);
- flowBegin = pos_;
- flowEnd = pos_;
- space = SPACE_NONE;
- } else {
- skipDocumentTypeDeclaration();
- }
- }
- break;
- case '/':
- ++pos_;
- pad_.add(flowBegin, flowEnd - flowBegin);
- *text = pad_.get();
- state_ = STATE_END_TAG;
- return RESULT_TEXT;
- case '?':
- ++pos_;
- skipProcessingInstruction();
- space = SPACE_BREAK;
- break;
- default:
- pad_.add(flowBegin, flowEnd - flowBegin);
- *text = pad_.get();
- state_ = STATE_START_TAG;
- return RESULT_TEXT;
- }
- break;
- default:
- switch (space) {
- case SPACE_START:
- flowBegin = pos_;
- break;
- case SPACE_NONE:
- case SPACE_SPAN:
- break;
- case SPACE_BREAK:
- pad_.add(flowBegin, flowEnd - flowBegin);
- pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
- flowBegin = pos_;
- break;
- }
- flowEnd = ++pos_;
- space = SPACE_NONE;
- break;
- }
- }
-}
-
-}
diff --git a/configmgr/source/xmlreader.hxx b/configmgr/source/xmlreader.hxx
deleted file mode 100644
index 83ccac148c..0000000000
--- a/configmgr/source/xmlreader.hxx
+++ /dev/null
@@ -1,186 +0,0 @@
-/*************************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* 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.
-*
-************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
-
-#include "sal/config.h"
-
-#include <stack>
-#include <vector>
-
-#include "boost/noncopyable.hpp"
-#include "com/sun/star/container/NoSuchElementException.hpp"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "osl/file.h"
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-#include "pad.hxx"
-#include "span.hxx"
-
-namespace configmgr {
-
-class XmlReader: private boost::noncopyable {
-public:
- explicit XmlReader(rtl::OUString const & fileUrl)
- SAL_THROW((
- com::sun::star::container::NoSuchElementException,
- com::sun::star::uno::RuntimeException));
-
- ~XmlReader();
-
- enum Namespace {
- NAMESPACE_NONE, NAMESPACE_XML, NAMESPACE_OOR, NAMESPACE_XS,
- NAMESPACE_XSI, NAMESPACE_OTHER };
-
- enum Text { TEXT_NONE, TEXT_RAW, TEXT_NORMALIZED };
-
- enum Result { RESULT_BEGIN, RESULT_END, RESULT_TEXT, RESULT_DONE };
-
- // RESULT_BEGIN: data = localName, ns = ns
- // RESULT_END: data, ns unused
- // RESULT_TEXT: data = text, ns unused
- Result nextItem(Text reportText, Span * data, Namespace * ns);
-
- bool nextAttribute(Namespace * ns, Span * localName);
-
- // the span returned by getAttributeValue is only valid until the next call
- // to nextItem or getAttributeValue
- Span getAttributeValue(bool fullyNormalize);
-
- Namespace getNamespace(Span const & prefix) const;
-
- rtl::OUString getUrl() const;
-
-private:
- inline char read() { return pos_ == end_ ? '\0' : *pos_++; }
-
- inline char peek() { return pos_ == end_ ? '\0' : *pos_; }
-
- void normalizeLineEnds(Span const & text);
-
- void skipSpace();
-
- bool skipComment();
-
- void skipProcessingInstruction();
-
- void skipDocumentTypeDeclaration();
-
- Span scanCdataSection();
-
- bool scanName(char const ** nameColon);
-
- Namespace scanNamespaceIri(char const * begin, char const * end);
-
- char const * handleReference(char const * position, char const * end);
-
- Span handleAttributeValue(
- char const * begin, char const * end, bool fullyNormalize);
-
- Result handleStartTag(Namespace * ns, Span * localName);
-
- Result handleEndTag();
-
- void handleElementEnd();
-
- Result handleSkippedText(Span * data, Namespace * ns);
-
- Result handleRawText(Span * text);
-
- Result handleNormalizedText(Span * text);
-
- struct NamespaceData {
- Span prefix;
- Namespace ns;
-
- NamespaceData() {}
-
- NamespaceData(Span const & thePrefix, Namespace theNs):
- prefix(thePrefix), ns(theNs) {}
- };
-
- typedef std::vector< NamespaceData > NamespaceList;
-
- struct ElementData {
- Span name;
- NamespaceList::size_type inheritedNamespaces;
- Namespace defaultNamespace;
-
- ElementData(
- Span const & theName,
- NamespaceList::size_type theInheritedNamespaces,
- Namespace theDefaultNamespace):
- name(theName), inheritedNamespaces(theInheritedNamespaces),
- defaultNamespace(theDefaultNamespace)
- {}
- };
-
- typedef std::stack< ElementData > ElementStack;
-
- struct AttributeData {
- char const * nameBegin;
- char const * nameEnd;
- char const * nameColon;
- char const * valueBegin;
- char const * valueEnd;
-
- AttributeData(
- char const * theNameBegin, char const * theNameEnd,
- char const * theNameColon, char const * theValueBegin,
- char const * theValueEnd):
- nameBegin(theNameBegin), nameEnd(theNameEnd),
- nameColon(theNameColon), valueBegin(theValueBegin),
- valueEnd(theValueEnd)
- {}
- };
-
- typedef std::vector< AttributeData > Attributes;
-
- enum State {
- STATE_CONTENT, STATE_START_TAG, STATE_END_TAG, STATE_EMPTY_ELEMENT_TAG,
- STATE_DONE };
-
- rtl::OUString fileUrl_;
- oslFileHandle fileHandle_;
- sal_uInt64 fileSize_;
- void * fileAddress_;
- NamespaceList namespaces_;
- ElementStack elements_;
- char const * pos_;
- char const * end_;
- State state_;
- Attributes attributes_;
- Attributes::iterator currentAttribute_;
- bool firstAttribute_;
- Pad pad_;
-};
-
-}
-
-#endif
diff --git a/connectivity/prj/d.lst b/connectivity/prj/d.lst
index e116ee5740..01d82ba917 100644
--- a/connectivity/prj/d.lst
+++ b/connectivity/prj/d.lst
@@ -31,3 +31,20 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\DataAccess
..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
+..\%__SRC%\misc\adabas.component %_DEST%\xml%_EXT%\adabas.component
+..\%__SRC%\misc\ado.component %_DEST%\xml%_EXT%\ado.component
+..\%__SRC%\misc\calc.component %_DEST%\xml%_EXT%\calc.component
+..\%__SRC%\misc\dbase.component %_DEST%\xml%_EXT%\dbase.component
+..\%__SRC%\misc\dbpool2.component %_DEST%\xml%_EXT%\dbpool2.component
+..\%__SRC%\misc\dbtools.component %_DEST%\xml%_EXT%\dbtools.component
+..\%__SRC%\misc\evoab.component %_DEST%\xml%_EXT%\evoab.component
+..\%__SRC%\misc\flat.component %_DEST%\xml%_EXT%\flat.component
+..\%__SRC%\misc\hsqldb.component %_DEST%\xml%_EXT%\hsqldb.component
+..\%__SRC%\misc\jdbc.component %_DEST%\xml%_EXT%\jdbc.component
+..\%__SRC%\misc\kab1.component %_DEST%\xml%_EXT%\kab1.component
+..\%__SRC%\misc\macab1.component %_DEST%\xml%_EXT%\macab1.component
+..\%__SRC%\misc\mozab.component %_DEST%\xml%_EXT%\mozab.component
+..\%__SRC%\misc\mozbootstrap.component %_DEST%\xml%_EXT%\mozbootstrap.component
+..\%__SRC%\misc\mysql.component %_DEST%\xml%_EXT%\mysql.component
+..\%__SRC%\misc\odbc.component %_DEST%\xml%_EXT%\odbc.component
+..\%__SRC%\misc\sdbc2.component %_DEST%\xml%_EXT%\sdbc2.component
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index a5f0797ac2..30c8e6c8a9 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -900,11 +900,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const
}
//---------------------------------------------------------------------------------------
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* serviceManager, com::sun::star::registry::XRegistryKey* registryKey)
-{
- return cppu::component_writeInfoHelper(serviceManager, registryKey, entries);
-}
-//---------------------------------------------------------------------------------------
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey)
{
return cppu::component_getFactoryHelper(implName, serviceManager, registryKey, entries);
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 9f1afe1e93..647ddaccde 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -258,6 +258,7 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType)
(*this) = getAny();
break;
default:
+ (*this) = getAny();
OSL_ENSURE(0,"ORowSetValue:operator==(): UNSPUPPORTED TYPE!");
}
}
@@ -344,6 +345,19 @@ void ORowSetValue::free()
TRACE_FREE( Any )
m_aValue.m_pValue = NULL;
break;
+ case DataType::BIT:
+ case DataType::TINYINT:
+ case DataType::SMALLINT:
+ case DataType::BOOLEAN:
+ break;
+ default:
+ if ( m_aValue.m_pValue )
+ {
+ delete (Any*)m_aValue.m_pValue;
+ TRACE_FREE( Any )
+ m_aValue.m_pValue = NULL;
+ }
+ break;
}
m_bNull = sal_True;
@@ -849,7 +863,9 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const
bRet = false;
break;
default:
+ bRet = false;
OSL_ENSURE(0,"ORowSetValue::operator==(): UNSPUPPORTED TYPE!");
+ break;
}
return bRet;
}
@@ -942,6 +958,8 @@ Any ORowSetValue::makeAny() const
break;
default:
OSL_ENSURE(0,"ORowSetValue::makeAny(): UNSPUPPORTED TYPE!");
+ rValue = getAny();
+ break;
}
}
return rValue;
@@ -1032,6 +1050,12 @@ Any ORowSetValue::makeAny() const
}
}
break;
+ default:
+ {
+ Any aValue = getAny();
+ aValue >>= aRet;
+ break;
+ }
}
}
return aRet;
@@ -1104,8 +1128,11 @@ sal_Bool ORowSetValue::getBool() const
bRet = m_bSigned ? (m_aValue.m_nInt32 != 0) : (*static_cast<sal_Int64*>(m_aValue.m_pValue) != sal_Int64(0));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= bRet;
+ break;
+ }
}
}
return bRet;
@@ -1174,8 +1201,11 @@ sal_Int8 ORowSetValue::getInt8() const
nRet = static_cast<sal_Int8>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1244,8 +1274,11 @@ sal_Int16 ORowSetValue::getInt16() const
nRet = static_cast<sal_Int16>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1314,8 +1347,11 @@ sal_Int32 ORowSetValue::getInt32() const
nRet = static_cast<sal_Int32>(*static_cast<sal_Int64*>(m_aValue.m_pValue));
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1384,8 +1420,11 @@ sal_Int64 ORowSetValue::getLong() const
nRet = *(sal_Int64*)m_aValue.m_pValue;
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1458,8 +1497,11 @@ float ORowSetValue::getFloat() const
nRet = float(*(sal_Int64*)m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1534,8 +1576,11 @@ double ORowSetValue::getDouble() const
nRet = double(*(sal_Int64*)m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aValue = getAny();
+ aValue >>= nRet;
+ break;
+ }
}
}
return nRet;
@@ -1626,6 +1671,11 @@ void ORowSetValue::setFromDouble(const double& _rVal,sal_Int32 _nDatatype)
TRACE_ALLOC( sal_Int64 )
}
break;
+ default:
+ {
+ m_aValue.m_pValue = new Any(_rVal);
+ break;
+ }
}
m_eTypeKind = _nDatatype;
}
@@ -1692,7 +1742,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aSeq = *static_cast< Sequence<sal_Int8>*>(m_aValue.m_pValue);
break;
default:
- ;
+ {
+ Any aValue = getAny();
+ aValue >>= aSeq;
+ break;
+ }
}
}
return aSeq;
@@ -1734,8 +1788,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
}
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aAnyValue = getAny();
+ aAnyValue >>= aValue;
+ break;
+ }
}
}
return aValue;
@@ -1776,8 +1833,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aValue = *static_cast< ::com::sun::star::util::Time*>(m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aAnyValue = getAny();
+ aAnyValue >>= aValue;
+ break;
+ }
}
}
return aValue;
@@ -1826,8 +1886,11 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const
aValue = *static_cast< ::com::sun::star::util::DateTime*>(m_aValue.m_pValue);
break;
default:
- OSL_ENSURE(0,"Illegal conversion!");
- break;
+ {
+ Any aAnyValue = getAny();
+ aAnyValue >>= aValue;
+ break;
+ }
}
}
return aValue;
@@ -2094,7 +2157,7 @@ void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const
break;
default:
OSL_ENSURE( false, "ORowSetValue::fill: unsupported type!" );
- bReadData = false;
+ (*this) = _rValueSource.getObject();
break;
}
if ( bReadData && _bNullable && _rValueSource.wasNull() )
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index 90bb97ac1d..1f39d6dbf7 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -326,9 +326,16 @@ namespace dbtools
::rtl::OUString sStringValue;
if ( m_pData->m_xColumn.is() )
{
- sStringValue = DBTypeConversion::getValue(
- m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType
- );
+ if ( m_pData->m_bNumericField )
+ {
+ sStringValue = DBTypeConversion::getValue(
+ m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType
+ );
+ }
+ else
+ {
+ sStringValue = m_pData->m_xColumn->getString();
+ }
}
return sStringValue;
}
diff --git a/connectivity/source/cpool/Zregistration.cxx b/connectivity/source/cpool/Zregistration.cxx
index efe1dc8a0d..43ae4a9caa 100644
--- a/connectivity/source/cpool/Zregistration.cxx
+++ b/connectivity/source/cpool/Zregistration.cxx
@@ -50,35 +50,6 @@ extern "C"
}
//---------------------------------------------------------------------------------------
-sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey)
-{
- ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/");
- sMainKeyName += OPoolCollection::getImplementationName_Static();
- sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES");
-
- try
- {
- Reference< XRegistryKey > xMainKey = _pRegistryKey->createKey(sMainKeyName);
- if (!xMainKey.is())
- return sal_False;
-
- Sequence< ::rtl::OUString > sServices = OPoolCollection::getSupportedServiceNames_Static();
- const ::rtl::OUString* pServices = sServices.getConstArray();
- for (sal_Int32 i=0; i<sServices.getLength(); ++i, ++pServices)
- xMainKey->createKey(*pServices);
- }
- catch(InvalidRegistryException&)
- {
- return sal_False;
- }
- catch(InvalidValueException&)
- {
- return sal_False;
- }
- return sal_True;
-}
-
-//---------------------------------------------------------------------------------------
void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
{
void* pRet = NULL;
diff --git a/connectivity/source/cpool/dbpool2.component b/connectivity/source/cpool/dbpool2.component
new file mode 100644
index 0000000000..2fa8a14495
--- /dev/null
+++ b/connectivity/source/cpool/dbpool2.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.sdbc.OConnectionPool">
+ <service name="com.sun.star.sdbc.ConnectionPool"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/cpool/exports.dxp b/connectivity/source/cpool/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/cpool/exports.dxp
+++ b/connectivity/source/cpool/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk
index 1f6e49c6cb..9908a6d242 100644
--- a/connectivity/source/cpool/makefile.mk
+++ b/connectivity/source/cpool/makefile.mk
@@ -78,4 +78,10 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : target.mk
+ALLTAR : $(MISC)/dbpool2.component
+$(MISC)/dbpool2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dbpool2.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dbpool2.component
diff --git a/connectivity/source/dbtools/dbtools.component b/connectivity/source/dbtools/dbtools.component
new file mode 100644
index 0000000000..08be953bb9
--- /dev/null
+++ b/connectivity/source/dbtools/dbtools.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.comp.helper.DatabaseMetaDataResultSet">
+ <service name="com.sun.star.sdbc.ResultSet"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.helper.ParameterSubstitution">
+ <service name="com.sun.star.sdb.ParameterSubstitution"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/dbtools/exports.dxp b/connectivity/source/dbtools/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/dbtools/exports.dxp
+++ b/connectivity/source/dbtools/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/dbtools/makefile.mk b/connectivity/source/dbtools/makefile.mk
index af4ac13e54..a73dae3d04 100644
--- a/connectivity/source/dbtools/makefile.mk
+++ b/connectivity/source/dbtools/makefile.mk
@@ -95,3 +95,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo _TI >$@
@echo _real >>$@
+
+ALLTAR : $(MISC)/dbtools.component
+
+$(MISC)/dbtools.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dbtools.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dbtools.component
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
index ddeb5b401c..b77109902a 100644
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ b/connectivity/source/drivers/adabas/BDriver.cxx
@@ -48,9 +48,7 @@
#include <memory>
#include <sys/stat.h>
-#if defined(MAC)
-const char sNewLine = '\015';
-#elif defined(UNX)
+#if defined(UNX)
const char sNewLine = '\012';
#else
const char sNewLine[] = "\015\012"; // \015\012 and not \n
@@ -856,7 +854,7 @@ void ODriver::createNeededDirs(const ::rtl::OUString& sDBName)
if(UCBContentHelper::Exists(sTemp))
UCBContentHelper::Kill(sTemp);
-#if !(defined(WIN) || defined(WNT))
+#if !(defined(WNT))
sTemp = sDBConfig;
sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diag"));
if(!UCBContentHelper::IsFolder(sTemp))
@@ -878,7 +876,7 @@ void ODriver::createNeededDirs(const ::rtl::OUString& sDBName)
void ODriver::clearDatabase(const ::rtl::OUString& sDBName)
{ // stop the database
::rtl::OUString sCommand;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
::rtl::OUString sStop = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("stop"));
OArgumentList aArgs(2,&sDBName,&sStop);
sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x_cons.exe"));
@@ -923,7 +921,7 @@ void ODriver::createDb( const TDatabaseStruct& _aInfo)
PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KERNELTRACESIZE")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("100")));
PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOG_QUEUE_PAGES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("10")));
-#if !(defined(WIN) || defined(WNT))
+#if !defined(WNT)
PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OPMSG1")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/dev/null")));
#endif
@@ -991,7 +989,7 @@ int ODriver::X_PARAM(const ::rtl::OUString& _DBNAME,
::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
pFileStream->Seek(STREAM_SEEK_TO_END);
(*pFileStream) << "x_param"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
<< ".exe"
#endif
<< " -d "
@@ -1002,7 +1000,7 @@ int ODriver::X_PARAM(const ::rtl::OUString& _DBNAME,
<< ::rtl::OString(_PWD,_PWD.getLength(),gsl_getSystemTextEncoding())
<< " "
<< ::rtl::OString(_CMD,_CMD.getLength(),gsl_getSystemTextEncoding())
-#if (defined(WIN) || defined(WNT))
+#if defined(WNT)
#if (OSL_DEBUG_LEVEL > 1) || defined(DBG_UTIL)
<< " >> %DBWORK%\\create.log 2>&1"
#endif
@@ -1052,7 +1050,7 @@ void ODriver::PutParam(const ::rtl::OUString& sDBName,
{
OArgumentList aArgs(3,&sDBName,&rWhat,&rHow);
::rtl::OUString sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("putparam"));
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
sCommand += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".exe"));
#endif
@@ -1114,7 +1112,7 @@ OSL_TRACE("CreateFile %d",_nSize);
int ODriver::X_START(const ::rtl::OUString& sDBName)
{
::rtl::OUString sCommand;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
::rtl::OUString sArg1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-d"));
::rtl::OUString sArg3 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBService"));
@@ -1152,7 +1150,7 @@ int ODriver::X_START(const ::rtl::OUString& sDBName)
int ODriver::X_STOP(const ::rtl::OUString& sDBName)
{
::rtl::OUString sCommand;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
::rtl::OUString sArg1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-d"));
::rtl::OUString sArg2 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBService"));
@@ -1197,7 +1195,7 @@ void ODriver::XUTIL(const ::rtl::OUString& _rParam,
::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
pFileStream->Seek(STREAM_SEEK_TO_END);
(*pFileStream) <<
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
"xutil.exe"
#else
"utility"
@@ -1250,7 +1248,7 @@ void ODriver::LoadBatch(const ::rtl::OUString& sDBName,
::std::auto_ptr<SvStream> pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE));
pFileStream->Seek(STREAM_SEEK_TO_END);
(*pFileStream) << "xload"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
<< ".exe"
#endif
<< " -d "
@@ -1319,7 +1317,7 @@ void ODriver::fillEnvironmentVariables()
::rtl::OUString ODriver::generateInitFile() const
{
String sExt;
-#if !(defined(WIN) || defined(WNT))
+#if !defined(WNT)
sExt = String::CreateFromAscii(".sh");
#else
sExt = String::CreateFromAscii(".bat");
@@ -1327,13 +1325,13 @@ void ODriver::fillEnvironmentVariables()
String sWorkUrl(m_sDbWorkURL);
::utl::TempFile aCmdFile(String::CreateFromAscii("Init"),&sExt,&sWorkUrl);
-#if !(defined(WIN) || defined(WNT))
+#if !defined(WNT)
String sPhysicalPath;
LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath);
chmod(ByteString(sPhysicalPath,gsl_getSystemTextEncoding()).GetBuffer(),S_IRUSR|S_IWUSR|S_IXUSR);
#endif
-#if !(defined(WIN) || defined(WNT))
+#if !defined(WNT)
SvStream* pFileStream = aCmdFile.GetStream(STREAM_WRITE);
(*pFileStream) << "#!/bin/sh"
<< sNewLine
@@ -1443,7 +1441,7 @@ void ODriver::X_CONS(const ::rtl::OUString& sDBName,const ::rtl::OString& _ACTIO
pFileStream->Seek(STREAM_SEEK_TO_END);
(*pFileStream) << "x_cons"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
<< ".exe"
#endif
<< " "
@@ -1526,7 +1524,7 @@ sal_Bool ODriver::isVersion(const ::rtl::OUString& sDBName, const char* _pVersio
pFileStream->Seek(STREAM_SEEK_TO_END);
(*pFileStream) << "getparam"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
<< ".exe"
#endif
<< " "
@@ -1576,7 +1574,7 @@ void ODriver::checkAndInsertNewDevSpace(const ::rtl::OUString& sDBName,
pFileStream->Seek(STREAM_SEEK_TO_END);
(*pFileStream) << "getparam"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
<< ".exe"
#endif
<< " "
@@ -1656,7 +1654,7 @@ sal_Bool ODriver::isKernelVersion(const char* _pVersion)
// -----------------------------------------------------------------------------
void ODriver::installSystemTables( const TDatabaseStruct& _aInfo)
{
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
// xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% -b %m_sDbRoot%\env\TERMCHAR.ind
::rtl::OUString aBatch = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-b "));
::rtl::OUString sTemp2 = m_sDbRootURL + m_sDelimit
diff --git a/connectivity/source/drivers/adabas/BFunctions.cxx b/connectivity/source/drivers/adabas/BFunctions.cxx
index 5c65e4e477..22761bf44a 100644
--- a/connectivity/source/drivers/adabas/BFunctions.cxx
+++ b/connectivity/source/drivers/adabas/BFunctions.cxx
@@ -129,7 +129,7 @@ sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath)
}
const sal_Char* pLibraryAsciiName = NULL;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
pLibraryAsciiName = "SQLOD32.DLL";
#elif ( defined(SOLARIS) && defined(SPARC)) || defined(LINUX)
pLibraryAsciiName = "odbclib.so";
diff --git a/connectivity/source/drivers/adabas/Bservices.cxx b/connectivity/source/drivers/adabas/Bservices.cxx
index 3b974687f3..f2fc7517f7 100644
--- a/connectivity/source/drivers/adabas/Bservices.cxx
+++ b/connectivity/source/drivers/adabas/Bservices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "adabas/BDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::adabas;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/adabas/adabas.component b/connectivity/source/drivers/adabas/adabas.component
new file mode 100644
index 0000000000..3c359c3d02
--- /dev/null
+++ b/connectivity/source/drivers/adabas/adabas.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbcx.adabas.ODriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/adabas/adabas.mxp.map b/connectivity/source/drivers/adabas/adabas.mxp.map
index 2ce9f11141..f64c44c13f 100644
--- a/connectivity/source/drivers/adabas/adabas.mxp.map
+++ b/connectivity/source/drivers/adabas/adabas.mxp.map
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
__mh_dylib_header
___builtin_delete
diff --git a/connectivity/source/drivers/adabas/exports.dxp b/connectivity/source/drivers/adabas/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/adabas/exports.dxp
+++ b/connectivity/source/drivers/adabas/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index 9268f02a3b..ffc3960391 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -104,3 +104,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/adabas.component
+
+$(MISC)/adabas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ adabas.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt adabas.component
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx
index b71601cd65..6b989a3505 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -692,6 +692,10 @@ void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeExcept
void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException)
{
+ // ::osl::MutexGuard aGuard( m_aMutex );
+ //checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+ // if ( getResultSetConcurrency() == ResultSetConcurrency::READ_ONLY )
+ // throw SQLException();
}
// -------------------------------------------------------------------------
@@ -977,7 +981,7 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& ro
sal_Int32 OResultSet::getResultSetConcurrency() const
throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
- sal_Int32 nValue=0;
+ sal_Int32 nValue=ResultSetConcurrency::READ_ONLY;
LockTypeEnum eRet;
if(!SUCCEEDED(m_pRecordSet->get_LockType(&eRet)))
{
diff --git a/connectivity/source/drivers/ado/Aservices.cxx b/connectivity/source/drivers/ado/Aservices.cxx
index 00254201fc..5feeb925ee 100644
--- a/connectivity/source/drivers/ado/Aservices.cxx
+++ b/connectivity/source/drivers/ado/Aservices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "ado/ADriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::ado;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "ADO::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -122,31 +95,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "ADO::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/ado/ado.component b/connectivity/source/drivers/ado/ado.component
new file mode 100644
index 0000000000..1962a6b710
--- /dev/null
+++ b/connectivity/source/drivers/ado/ado.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.ado.ODriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/ado/exports.dxp b/connectivity/source/drivers/ado/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/ado/exports.dxp
+++ b/connectivity/source/drivers/ado/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/ado/makefile.mk b/connectivity/source/drivers/ado/makefile.mk
index 33e4706482..2b3c91a201 100644
--- a/connectivity/source/drivers/ado/makefile.mk
+++ b/connectivity/source/drivers/ado/makefile.mk
@@ -112,3 +112,11 @@ dummy:
# --- Targets ----------------------------------
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/ado.component
+
+$(MISC)/ado.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ado.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ado.component
diff --git a/connectivity/source/drivers/calc/Cservices.cxx b/connectivity/source/drivers/calc/Cservices.cxx
index 75f69d0d21..6524ea68e4 100644
--- a/connectivity/source/drivers/calc/Cservices.cxx
+++ b/connectivity/source/drivers/calc/Cservices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "calc/CDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::calc;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/calc/calc.component b/connectivity/source/drivers/calc/calc.component
new file mode 100644
index 0000000000..be949f70de
--- /dev/null
+++ b/connectivity/source/drivers/calc/calc.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.calc.ODriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/calc/exports.dxp b/connectivity/source/drivers/calc/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/calc/exports.dxp
+++ b/connectivity/source/drivers/calc/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
index 8e193524aa..a7393b3c8e 100644
--- a/connectivity/source/drivers/calc/makefile.mk
+++ b/connectivity/source/drivers/calc/makefile.mk
@@ -94,3 +94,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/calc.component
+
+$(MISC)/calc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ calc.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt calc.component
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 2982f484a3..590663488e 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1432,16 +1432,8 @@ BOOL ODbaseTable::CreateMemoFile(const INetURLObject& aFile)
char aBuffer[512]; // write buffer
memset(aBuffer,0,sizeof(aBuffer));
-#ifdef WIN
- m_pMemoStream->Seek(0L);
- for (UINT16 i = 0; i < 512; i++)
- {
- (*m_pMemoStream) << BYTE(0);
- }
-#else
m_pMemoStream->SetFiller('\0');
m_pMemoStream->SetStreamSize(512);
-#endif
m_pMemoStream->Seek(0L);
(*m_pMemoStream) << long(1); // Zeiger auf ersten freien Block
@@ -2607,7 +2599,7 @@ void ODbaseTable::throwInvalidDbaseFormat()
// no dbase file
const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution(
- STR_SQL_NAME_ERROR,
+ STR_INVALID_DBASE_FILE,
"$filename$", getEntry(m_pConnection,m_Name)
) );
::dbtools::throwGenericSQLException( sError, *this );
diff --git a/connectivity/source/drivers/dbase/Dservices.cxx b/connectivity/source/drivers/dbase/Dservices.cxx
index e3a295452c..e557f8c8bb 100644
--- a/connectivity/source/drivers/dbase/Dservices.cxx
+++ b/connectivity/source/drivers/dbase/Dservices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "dbase/DDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::dbase;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/dbase/dbase.component b/connectivity/source/drivers/dbase/dbase.component
new file mode 100644
index 0000000000..7f913f0836
--- /dev/null
+++ b/connectivity/source/drivers/dbase/dbase.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.dbase.ODriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/dbase/dbase.mxp.map b/connectivity/source/drivers/dbase/dbase.mxp.map
index c5b4377b04..87eccc45b6 100644
--- a/connectivity/source/drivers/dbase/dbase.mxp.map
+++ b/connectivity/source/drivers/dbase/dbase.mxp.map
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
__mh_dylib_header
___builtin_delete
diff --git a/connectivity/source/drivers/dbase/exports.dxp b/connectivity/source/drivers/dbase/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/dbase/exports.dxp
+++ b/connectivity/source/drivers/dbase/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk
index f855cf1f45..62b7ae96f8 100644
--- a/connectivity/source/drivers/dbase/makefile.mk
+++ b/connectivity/source/drivers/dbase/makefile.mk
@@ -127,3 +127,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/dbase.component
+
+$(MISC)/dbase.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dbase.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dbase.component
diff --git a/connectivity/source/drivers/evoab/LServices.cxx b/connectivity/source/drivers/evoab/LServices.cxx
index 08a3c5fae8..6abf81acc9 100644
--- a/connectivity/source/drivers/evoab/LServices.cxx
+++ b/connectivity/source/drivers/evoab/LServices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "LDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::evoab;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- OEvoabDriver::getImplementationName_Static(),
- OEvoabDriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/evoab/exports.dxp b/connectivity/source/drivers/evoab/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/evoab/exports.dxp
+++ b/connectivity/source/drivers/evoab/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/evoab2/NServices.cxx b/connectivity/source/drivers/evoab2/NServices.cxx
index b898b3e626..a749dd9e63 100644
--- a/connectivity/source/drivers/evoab2/NServices.cxx
+++ b/connectivity/source/drivers/evoab2/NServices.cxx
@@ -35,7 +35,6 @@ using namespace connectivity::evoab;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "EVOAB::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +97,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- OEvoabDriver::getImplementationName_Static(),
- OEvoabDriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/evoab2/evoab.component b/connectivity/source/drivers/evoab2/evoab.component
new file mode 100644
index 0000000000..a99719388d
--- /dev/null
+++ b/connectivity/source/drivers/evoab2/evoab.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.evoab.OEvoabDriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
index e8a1cf96cd..3f5b62903b 100644
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ b/connectivity/source/drivers/evoab2/makefile.mk
@@ -110,3 +110,11 @@ DEF1NAME= $(SHL1TARGET)
# --- Targets ----------------------------------
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/evoab.component
+
+$(MISC)/evoab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ evoab.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt evoab.component
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index ef0ae138a2..11877004c5 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -75,12 +75,7 @@ using namespace com::sun::star::sdbcx;
using namespace com::sun::star::container;
// Maximale Anzahl von Rows, die mit ORDER BY sortiert durchlaufen werden koennen:
-#if defined (WIN)
-#define MAX_KEYSET_SIZE 0x3ff0 // Etwas weniger als ein Segment, damit
- // noch Platz fuer Memory Debug-Informationen
-#else
#define MAX_KEYSET_SIZE 0x40000 // 256K
-#endif
namespace
{
@@ -1049,7 +1044,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset,
//
INT32 nTempPos = m_nRowPos;
// exclusiver zugriff auf die Tabelle
- // NAMESPACE_VOS(OGuard)* pGuard = m_pTable->Lock();
+ // vos::OGuard* pGuard = m_pTable->Lock();
if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT &&
!isCount())
@@ -1200,7 +1195,9 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset,
break;
}
- if (m_nRowPos == 0)
+ if ( m_nRowPos < 0 )
+ goto Error;
+ else if (m_nRowPos == 0)
{
// COUNT(*) in Ergebnisrow packen
// (muss die erste und einzige Variable in der Row sein)
@@ -1407,7 +1404,7 @@ BOOL OResultSet::OpenImpl()
m_nRowCountResult = -1;
// exclusiver zugriff auf die Tabelle
- // NAMESPACE_VOS(OGuard)* pGuard = pTable->Lock();
+ // vos::OGuard* pGuard = pTable->Lock();
m_nLastVisitedPos = m_pTable->getCurrentLastPos();
switch(m_aSQLIterator.getStatementType())
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index d3d8f2d6a3..6ec9b7cf2b 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -159,7 +159,10 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
(m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
{
bNumeric = FALSE;
- nStartPosFirstLine2 = nStartPosFirstLine;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ nStartPosFirstLine2 = nStartPosFirstLine;
}
else
{
diff --git a/connectivity/source/drivers/flat/Eservices.cxx b/connectivity/source/drivers/flat/Eservices.cxx
index 57a923667f..a2cb13c168 100644
--- a/connectivity/source/drivers/flat/Eservices.cxx
+++ b/connectivity/source/drivers/flat/Eservices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "flat/EDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::flat;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriver::getImplementationName_Static(),
- ODriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/flat/exports.dxp b/connectivity/source/drivers/flat/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/flat/exports.dxp
+++ b/connectivity/source/drivers/flat/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/flat/flat.component b/connectivity/source/drivers/flat/flat.component
new file mode 100644
index 0000000000..fe8b79ee73
--- /dev/null
+++ b/connectivity/source/drivers/flat/flat.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.flat.ODriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/flat/flat.mxp.map b/connectivity/source/drivers/flat/flat.mxp.map
index 54a8532f78..2737c61b5a 100644
--- a/connectivity/source/drivers/flat/flat.mxp.map
+++ b/connectivity/source/drivers/flat/flat.mxp.map
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
__mh_dylib_header
___builtin_delete
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index 2d1f99f759..23920f91c2 100644
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -105,3 +105,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/flat.component
+
+$(MISC)/flat.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ flat.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt flat.component
diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
index 1849a40078..428f922148 100644
--- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
@@ -234,7 +234,7 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,js
if ( xIn.is() )
{
jsize nLen = env->GetArrayLength(buffer);
- if ( nLen < len )
+ if ( nLen < len || len <= 0 )
{
ThrowException( env,
"java/io/IOException",
@@ -439,21 +439,17 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst
if ( xOut.is() )
{
jbyte *buf = env->GetByteArrayElements(buffer,NULL);
-#ifdef HSQLDB_DBG
- OSL_ENSURE(len <= env->GetArrayLength(buffer),"Length is greater than the buffer!");
-#endif
-
if (JNI_FALSE != env->ExceptionCheck())
{
env->ExceptionClear();
OSL_ENSURE(0,"ExceptionClear");
}
OSL_ENSURE(buf,"buf is NULL");
- if ( buf )
+ if ( buf && len > 0 && len <= env->GetArrayLength(buffer))
{
Sequence< ::sal_Int8 > aData(buf + off,len);
- xOut->writeBytes(aData);
env->ReleaseByteArrayElements(buffer, buf, JNI_ABORT);
+ xOut->writeBytes(aData);
#ifdef HSQLDB_DBG
if ( logger )
logger->write( aData.getConstArray(), len );
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index c6af914682..cd96e62ca3 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -61,14 +61,15 @@ namespace connectivity
{
try
{
- m_xStream.clear();
- m_xSeek.clear();
+ m_xStream.clear();
+ m_xSeek.clear();
if ( m_xInputStream.is() )
{
m_xInputStream->closeInput();
- m_xInputStream.clear();
+ m_xInputStream.clear();
}
- if ( m_xOutputStream.is() )
+ // this is done implicity by the closing of the input stream
+ else if ( m_xOutputStream.is() )
{
m_xOutputStream->closeOutput();
try
@@ -83,11 +84,12 @@ namespace connectivity
OSL_UNUSED( e );
OSL_ENSURE(0,"Could not dispose OutputStream");
}
- m_xOutputStream.clear();
+ m_xOutputStream.clear();
}
}
- catch(Exception& )
+ catch(Exception& ex)
{
+ OSL_UNUSED( ex );
OSL_ENSURE(0,"Exception catched!");
}
}
@@ -133,7 +135,7 @@ namespace connectivity
::rtl::OUString StorageContainer::removeOldURLPrefix(const ::rtl::OUString& _sURL)
{
::rtl::OUString sRet = _sURL;
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
sal_Int32 nIndex = sRet.lastIndexOf('\\');
#else
sal_Int32 nIndex = sRet.lastIndexOf('/');
diff --git a/connectivity/source/drivers/hsqldb/Hservices.cxx b/connectivity/source/drivers/hsqldb/Hservices.cxx
index 5f98d0da5b..e2fb61c927 100644
--- a/connectivity/source/drivers/hsqldb/Hservices.cxx
+++ b/connectivity/source/drivers/hsqldb/Hservices.cxx
@@ -30,13 +30,11 @@
#include "hsqldb/HDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::hsqldb;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -124,31 +97,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriverDelegator::getImplementationName_Static(),
- ODriverDelegator::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/hsqldb/exports.dxp b/connectivity/source/drivers/hsqldb/exports.dxp
index 7ff56f4f99..3efc73741d 100644
--- a/connectivity/source/drivers/hsqldb/exports.dxp
+++ b/connectivity/source/drivers/hsqldb/exports.dxp
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.component b/connectivity/source/drivers/hsqldb/hsqldb.component
new file mode 100644
index 0000000000..eb8ae477e7
--- /dev/null
+++ b/connectivity/source/drivers/hsqldb/hsqldb.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.sdbcx.comp.hsqldb.Driver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/hsqldb/hsqldb.map b/connectivity/source/drivers/hsqldb/hsqldb.map
index a13f907752..c1d8320d19 100644
--- a/connectivity/source/drivers/hsqldb/hsqldb.map
+++ b/connectivity/source/drivers/hsqldb/hsqldb.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
component_getImplementationEnvironment;
- component_writeInfo;
component_getFactory;
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream;
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII;
diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk
index e1a953055c..5be6fa08cd 100644
--- a/connectivity/source/drivers/hsqldb/makefile.mk
+++ b/connectivity/source/drivers/hsqldb/makefile.mk
@@ -115,3 +115,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/hsqldb.component
+
+$(MISC)/hsqldb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ hsqldb.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt hsqldb.component
diff --git a/connectivity/source/drivers/jdbc/Boolean.cxx b/connectivity/source/drivers/jdbc/Boolean.cxx
index 5018770aab..fdb276a333 100644
--- a/connectivity/source/drivers/jdbc/Boolean.cxx
+++ b/connectivity/source/drivers/jdbc/Boolean.cxx
@@ -49,20 +49,3 @@ jclass java_lang_Boolean::getMyClass() const
{
return st_getMyClass();
}
-
-java_lang_Boolean::java_lang_Boolean( sal_Bool _par0 ): java_lang_Object( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- // Java-Call fuer den Konstruktor absetzen
- // temporaere Variable initialisieren
- static const char * cSignature = "(Z)V";
- jobject tempObj;
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, "<init>",cSignature, mID);
- tempObj = t.pEnv->NewObject( getMyClass(), mID, _par0 );
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- // und aufraeumen
-}
-
-
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx
index d2e88e8397..ea25e8983f 100644
--- a/connectivity/source/drivers/jdbc/Object.cxx
+++ b/connectivity/source/drivers/jdbc/Object.cxx
@@ -166,14 +166,6 @@ void java_lang_Object::saveRef( JNIEnv * pXEnv, jobject myObj )
}
-java_lang_Class * java_lang_Object::getClass()
-{
- SDBThreadAttach t;
- static jmethodID mID(NULL);
- jobject out = callObjectMethod(t.pEnv,"getClass","()Ljava/lang/Class;", mID);
- return out ? new java_lang_Class( t.pEnv, out ) : NULL;
-}
-
::rtl::OUString java_lang_Object::toString() const
{
static jmethodID mID(NULL);
diff --git a/connectivity/source/drivers/jdbc/String.cxx b/connectivity/source/drivers/jdbc/String.cxx
index edae1d78ee..62b77859d9 100644
--- a/connectivity/source/drivers/jdbc/String.cxx
+++ b/connectivity/source/drivers/jdbc/String.cxx
@@ -52,26 +52,6 @@ jclass java_lang_String::st_getMyClass()
}
//--------------------------------------------------------------------------
-java_lang_String::java_lang_String( const ::rtl::OUString& _par0 ): java_lang_Object( NULL, (jobject)NULL )
-{
- SDBThreadAttach t;
- if( !t.pEnv )
- return;
- jvalue args[1];
- // Parameter konvertieren
- args[0].l = convertwchar_tToJavaString(t.pEnv,_par0);
- // Java-Call fuer den Konstruktor absetzen
- // temporaere Variable initialisieren
- static const char * cSignature = "(Ljava/lang/String;)V";
- jobject tempObj;
- static jmethodID mID(NULL);
- obtainMethodId(t.pEnv, "<init>",cSignature, mID);
- tempObj = t.pEnv->NewObjectA( getMyClass(), mID, args );
- saveRef( t.pEnv, tempObj );
- t.pEnv->DeleteLocalRef( tempObj );
- t.pEnv->DeleteLocalRef((jstring)args[0].l);
-}
-//--------------------------------------------------------------------------
java_lang_String::operator ::rtl::OUString()
{
SDBThreadAttach t;
diff --git a/connectivity/source/drivers/jdbc/exports.dxp b/connectivity/source/drivers/jdbc/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/jdbc/exports.dxp
+++ b/connectivity/source/drivers/jdbc/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/jdbc/jdbc.component b/connectivity/source/drivers/jdbc/jdbc.component
new file mode 100644
index 0000000000..5d7db4690b
--- /dev/null
+++ b/connectivity/source/drivers/jdbc/jdbc.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.JDBCDriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/jdbc/jdbc.mxp.map b/connectivity/source/drivers/jdbc/jdbc.mxp.map
index a4457e2478..e02823e8c4 100644
--- a/connectivity/source/drivers/jdbc/jdbc.mxp.map
+++ b/connectivity/source/drivers/jdbc/jdbc.mxp.map
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
__mh_dylib_header
___builtin_delete
diff --git a/connectivity/source/drivers/jdbc/jservices.cxx b/connectivity/source/drivers/jdbc/jservices.cxx
index 28506fc34c..cfe3b69ab5 100644
--- a/connectivity/source/drivers/jdbc/jservices.cxx
+++ b/connectivity/source/drivers/jdbc/jservices.cxx
@@ -34,7 +34,6 @@ using namespace connectivity;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -47,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pModCount
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "SBA::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -122,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- java_sql_Driver::getImplementationName_Static(),
- java_sql_Driver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "SBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk
index 4661995216..510daeac4a 100644
--- a/connectivity/source/drivers/jdbc/makefile.mk
+++ b/connectivity/source/drivers/jdbc/makefile.mk
@@ -110,3 +110,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/jdbc.component
+
+$(MISC)/jdbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ jdbc.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt jdbc.component
diff --git a/connectivity/source/drivers/kab/KServices.cxx b/connectivity/source/drivers/kab/KServices.cxx
index 8bb3b96ad7..230b6d1ddc 100644
--- a/connectivity/source/drivers/kab/KServices.cxx
+++ b/connectivity/source/drivers/kab/KServices.cxx
@@ -30,13 +30,11 @@
#include "KDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::kab;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pTemp
);
-//***************************************************************************************
-//
-// The following C Api must be provided!
-// It consists in three functions that must be exported by the module
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "KAB::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void*,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- KabDriver::getImplementationName_Static(),
- KabDriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "KAB::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/kab/exports.dxp b/connectivity/source/drivers/kab/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/kab/exports.dxp
+++ b/connectivity/source/drivers/kab/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/kab/kab1.component b/connectivity/source/drivers/kab/kab1.component
new file mode 100644
index 0000000000..77227501d3
--- /dev/null
+++ b/connectivity/source/drivers/kab/kab1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.kab.Driver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk
index 2a0dc5cd89..c085cddb2d 100644
--- a/connectivity/source/drivers/kab/makefile.mk
+++ b/connectivity/source/drivers/kab/makefile.mk
@@ -46,6 +46,9 @@ CFLAGS+=$(KDE_CFLAGS)
.IF "$(KDE_ROOT)"!=""
EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib
+.IF "$(OS)$(CPU)" == "LINUXX"
+EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64
+.ENDIF
.ENDIF
# === KAB base library ==========================
@@ -135,3 +138,11 @@ dummy:
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/kab1.component
+
+$(MISC)/kab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ kab1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt kab1.component
diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx
index 6fc29f4736..1cd88c9082 100755
--- a/connectivity/source/drivers/macab/MacabServices.cxx
+++ b/connectivity/source/drivers/macab/MacabServices.cxx
@@ -30,13 +30,11 @@
#include "MacabDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::macab;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pTemp
);
-//***************************************************************************************
-//
-// The following C Api must be provided!
-// It consists in three functions that must be exported by the module
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "MACAB::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void*,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- MacabDriver::getImplementationName_Static(),
- MacabDriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "MACAB::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/macab/exports.dxp b/connectivity/source/drivers/macab/exports.dxp
index 9630d7e067..f0e1c69934 100755
--- a/connectivity/source/drivers/macab/exports.dxp
+++ b/connectivity/source/drivers/macab/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/macab/macab1.component b/connectivity/source/drivers/macab/macab1.component
new file mode 100644
index 0000000000..0a120c0418
--- /dev/null
+++ b/connectivity/source/drivers/macab/macab1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.macab.Driver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk
index 35532b15ec..0565d31713 100755
--- a/connectivity/source/drivers/macab/makefile.mk
+++ b/connectivity/source/drivers/macab/makefile.mk
@@ -127,3 +127,11 @@ dummy:
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/macab1.component
+
+$(MISC)/macab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ macab1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt macab1.component
diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx
index ac4e3be969..f1cbc63188 100644
--- a/connectivity/source/drivers/mozab/MDriver.cxx
+++ b/connectivity/source/drivers/mozab/MDriver.cxx
@@ -249,7 +249,7 @@ EDriverType MozabDriver::impl_classifyURL( const ::rtl::OUString& url )
const sal_Char* pScheme;
} aSchemeMap[] =
{
-#if defined(WNT) || defined(WIN)
+#if defined(WNT)
{ Outlook, "outlook" },
{ OutlookExpress, "outlookexp" },
#endif
diff --git a/connectivity/source/drivers/mozab/MServices.cxx b/connectivity/source/drivers/mozab/MServices.cxx
index 7845c79e4b..2ae4ec8371 100644
--- a/connectivity/source/drivers/mozab/MServices.cxx
+++ b/connectivity/source/drivers/mozab/MServices.cxx
@@ -39,7 +39,6 @@ using namespace connectivity::mozab;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::mozilla::XMozillaBootstrap;
@@ -53,31 +52,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pTemp
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "MOZAB::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -127,37 +101,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
-
- REGISTER_PROVIDER(
- MozabDriver::getImplementationName_Static(),
- MozabDriver::getSupportedServiceNames_Static(), xKey);
-
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap"));
- REGISTER_PROVIDER(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")),
- aSNS, xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "Mozab::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
typedef void* (SAL_CALL * OMozillaBootstrap_CreateInstanceFunction)(const Reference< XMultiServiceFactory >& _rxFactory );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createMozillaBootstrap(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
{
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
index c07547ebef..6bfc68f3e0 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
@@ -238,7 +238,6 @@ Sequence< ::rtl::OUString > SAL_CALL MozillaBootstrap::getSupportedServiceNames(
#include <cppuhelper/factory.hxx>
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -251,50 +250,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const ::rtl::OUString& aServiceImplName,
- const Sequence< ::rtl::OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- ::rtl::OUString aMainKeyName;
- aMainKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
- aMainKeyName += aServiceImplName;
- aMainKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "MOZAB::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap"));
- REGISTER_PROVIDER(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")),
- aSNS, xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "Mozab::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
{
MozillaBootstrap * pBootstrap = reinterpret_cast<MozillaBootstrap*>(OMozillaBootstrap_CreateInstance(rServiceManager));
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 6a4172da20..b44436e488 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -78,6 +78,14 @@ SHL1STDLIBS=\
$(SALLIB) \
$(COMPHELPERLIB)
+ALLTAR : $(MISC)/mozbootstrap.component
+
+$(MISC)/mozbootstrap.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component
+
.ELSE
SLOFILES += \
$(SLO)$/MNSInit.obj \
@@ -90,4 +98,3 @@ SLOFILES += \
# --- Targets ----------------------------------
.INCLUDE : target.mk
-
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component
new file mode 100644
index 0000000000..5da158924a
--- /dev/null
+++ b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.mozilla.MozillaBootstrap">
+ <service name="com.sun.star.mozilla.MozillaBootstrap"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/mozab/exports.dxp b/connectivity/source/drivers/mozab/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/mozab/exports.dxp
+++ b/connectivity/source/drivers/mozab/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index b1e12fde6f..852560f1c9 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -184,3 +184,11 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk
@echo _TI >$@
@echo _real >>$@
+
+ALLTAR : $(MISC)/mozab.component
+
+$(MISC)/mozab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ mozab.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mozab.component
diff --git a/connectivity/source/drivers/mozab/mozab.component b/connectivity/source/drivers/mozab/mozab.component
new file mode 100644
index 0000000000..70f5da3bfe
--- /dev/null
+++ b/connectivity/source/drivers/mozab/mozab.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.mozilla.MozillaBootstrap">
+ <service name="com.sun.star.mozilla.MozillaBootstrap"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sdbc.MozabDriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/mysql/Yservices.cxx b/connectivity/source/drivers/mysql/Yservices.cxx
index 5262fa400a..7dd8616126 100644
--- a/connectivity/source/drivers/mysql/Yservices.cxx
+++ b/connectivity/source/drivers/mysql/Yservices.cxx
@@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx"
#include "mysql/YDriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::mysql;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -123,31 +96,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODriverDelegator::getImplementationName_Static(),
- ODriverDelegator::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/mysql/exports.dxp b/connectivity/source/drivers/mysql/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/drivers/mysql/exports.dxp
+++ b/connectivity/source/drivers/mysql/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
index fbb68321cb..453f4b652f 100644
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ b/connectivity/source/drivers/mysql/makefile.mk
@@ -82,3 +82,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/mysql.component
+
+$(MISC)/mysql.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ mysql.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mysql.component
diff --git a/connectivity/source/drivers/mysql/mysql.component b/connectivity/source/drivers/mysql/mysql.component
new file mode 100644
index 0000000000..ced2297fa0
--- /dev/null
+++ b/connectivity/source/drivers/mysql/mysql.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.comp.drivers.MySQL.Driver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ <service name="com.sun.star.sdbcx.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/odbc/OFunctions.cxx b/connectivity/source/drivers/odbc/OFunctions.cxx
index d693a9a298..292ed6ef1d 100644
--- a/connectivity/source/drivers/odbc/OFunctions.cxx
+++ b/connectivity/source/drivers/odbc/OFunctions.cxx
@@ -109,10 +109,6 @@ sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath)
if (bLoaded)
return sal_True;
-#ifdef WIN
- _rPath = ::rtl::OUString::createFromAscii("ODBC.DLL");
-
-#endif
#ifdef WNT
_rPath = ::rtl::OUString::createFromAscii("ODBC32.DLL");
#endif
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
index 508cbfb6df..426c75bf01 100644
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ b/connectivity/source/drivers/odbc/makefile.mk
@@ -76,3 +76,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Targets ----------------------------------
.INCLUDE : $(PRJ)$/target.pmk
+
+ALLTAR : $(MISC)/odbc.component
+
+$(MISC)/odbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ odbc.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt odbc.component
diff --git a/connectivity/source/drivers/odbc/odbc.component b/connectivity/source/drivers/odbc/odbc.component
new file mode 100644
index 0000000000..d4e6bc127d
--- /dev/null
+++ b/connectivity/source/drivers/odbc/odbc.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.ODBCDriver">
+ <service name="com.sun.star.sdbc.Driver"/>
+ </implementation>
+</component>
diff --git a/connectivity/source/drivers/odbc/oservices.cxx b/connectivity/source/drivers/odbc/oservices.cxx
index 2d2b468bb2..c8acc78ffb 100644
--- a/connectivity/source/drivers/odbc/oservices.cxx
+++ b/connectivity/source/drivers/odbc/oservices.cxx
@@ -30,13 +30,11 @@
#include "ORealDriver.hxx"
#include "odbc/ODriver.hxx"
#include <cppuhelper/factory.hxx>
-#include <osl/diagnose.h>
using namespace connectivity::odbc;
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pTemp
);
-//***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
- const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
-{
- OUString aMainKeyName;
- aMainKeyName = OUString::createFromAscii("/");
- aMainKeyName += aServiceImplName;
- aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
- OSL_ENSURE(xNewKey.is(), "ODBC::component_writeInfo : could not create a registry key !");
-
- for (sal_Int32 i=0; i<Services.getLength(); ++i)
- xNewKey->createKey(Services[i]);
-}
-
-
//---------------------------------------------------------------------------------------
struct ProviderRequest
{
@@ -124,31 +97,6 @@ component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /*pServiceManager*/,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- REGISTER_PROVIDER(
- ODBCDriver::getImplementationName_Static(),
- ODBCDriver::getSupportedServiceNames_Static(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index f84f8e7101..50900426fe 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -578,7 +578,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
// StarView zu lang ist oder der Treiber kann die Laenge der
// Daten nicht im voraus bestimmen - also als MemoryStream
// speichern.
- while ((pcbValue == SQL_NO_TOTAL ) || pcbValue > nMaxLen)
+ while ((pcbValue == SQL_NO_TOTAL ) || nLen > nMaxLen)
{
// Bei Strings wird der Puffer nie ganz ausgenutzt
// (das letzte Byte ist immer ein NULL-Byte, das
diff --git a/connectivity/source/inc/java/lang/Boolean.hxx b/connectivity/source/inc/java/lang/Boolean.hxx
index a63b1ed72e..fe237fb2fd 100644
--- a/connectivity/source/inc/java/lang/Boolean.hxx
+++ b/connectivity/source/inc/java/lang/Boolean.hxx
@@ -44,7 +44,6 @@ namespace connectivity
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
java_lang_Boolean( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- java_lang_Boolean( sal_Bool _par0 );
static jclass st_getMyClass();
};
}
diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx
index 95e464e592..f60099e43c 100644
--- a/connectivity/source/inc/java/lang/Object.hxx
+++ b/connectivity/source/inc/java/lang/Object.hxx
@@ -118,8 +118,6 @@ namespace connectivity
void clearObject(JNIEnv& rEnv);
void clearObject();
- java_lang_Class * getClass();
-
virtual ::rtl::OUString toString() const;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xFactory; }
diff --git a/connectivity/source/inc/java/lang/String.hxx b/connectivity/source/inc/java/lang/String.hxx
index 157a4d474e..3bc3631bd7 100644
--- a/connectivity/source/inc/java/lang/String.hxx
+++ b/connectivity/source/inc/java/lang/String.hxx
@@ -42,7 +42,6 @@ namespace connectivity
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
java_lang_String( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- java_lang_String( const ::rtl::OUString& _par0 );
operator ::rtl::OUString();
static jclass st_getMyClass();
diff --git a/connectivity/source/inc/odbc/OFunctiondefs.hxx b/connectivity/source/inc/odbc/OFunctiondefs.hxx
index 0cff012b5e..274e9cb55a 100644
--- a/connectivity/source/inc/odbc/OFunctiondefs.hxx
+++ b/connectivity/source/inc/odbc/OFunctiondefs.hxx
@@ -29,7 +29,7 @@
#ifndef _CONNECTIVITY_OFUNCTIONDEFS_HXX_
#define _CONNECTIVITY_OFUNCTIONDEFS_HXX_
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
#ifdef _MSC_VER
#pragma warning(push)
diff --git a/connectivity/source/manager/exports.dxp b/connectivity/source/manager/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/connectivity/source/manager/exports.dxp
+++ b/connectivity/source/manager/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk
index 52ec191ec8..4880407952 100644
--- a/connectivity/source/manager/makefile.mk
+++ b/connectivity/source/manager/makefile.mk
@@ -76,4 +76,10 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : target.mk
+ALLTAR : $(MISC)/sdbc2.component
+$(MISC)/sdbc2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sdbc2.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sdbc2.component
diff --git a/connectivity/source/manager/mregistration.cxx b/connectivity/source/manager/mregistration.cxx
index 464015f937..07ef27892f 100644
--- a/connectivity/source/manager/mregistration.cxx
+++ b/connectivity/source/manager/mregistration.cxx
@@ -36,7 +36,6 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
//==========================================================================
//= registration
@@ -51,38 +50,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const
}
//---------------------------------------------------------------------------------------
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey)
-{
-
-
- sal_Bool bReturn = sal_False;
-
- try
- {
- ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/");
- sMainKeyName += ::drivermanager::OSDBCDriverManager::getImplementationName_static();
- sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES");
- Reference< XRegistryKey > xMainKey = _pRegistryKey->createKey(sMainKeyName);
- if (xMainKey.is())
- {
- Sequence< ::rtl::OUString > sServices(::drivermanager::OSDBCDriverManager::getSupportedServiceNames_static());
- const ::rtl::OUString* pBegin = sServices.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + sServices.getLength();
- for (;pBegin != pEnd ; ++pBegin)
- xMainKey->createKey(*pBegin);
- bReturn = sal_True;
- }
- }
- catch(InvalidRegistryException&)
- {
- }
- catch(InvalidValueException&)
- {
- }
- return bReturn;
-}
-
-//---------------------------------------------------------------------------------------
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
{
void* pRet = NULL;
diff --git a/connectivity/source/manager/sdbc.mxp.map b/connectivity/source/manager/sdbc.mxp.map
index 14e33ebafb..431725adbb 100644
--- a/connectivity/source/manager/sdbc.mxp.map
+++ b/connectivity/source/manager/sdbc.mxp.map
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
__mh_dylib_header
___builtin_delete
diff --git a/connectivity/source/manager/sdbc2.component b/connectivity/source/manager/sdbc2.component
new file mode 100644
index 0000000000..6cce2b1d9f
--- /dev/null
+++ b/connectivity/source/manager/sdbc2.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.sdbc.OSDBCDriverManager">
+ <service name="com.sun.star.sdbc.DriverManager"/>
+ </implementation>
+</component>
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 1c13317c3b..510b16d8e0 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -134,6 +134,9 @@ class Desktop : public Application
static sal_Bool IsFirstStartWizardNeeded();
static sal_Bool CheckExtensionDependencies();
+ static void DoRestartActionsIfNecessary( sal_Bool bQuickStart );
+ static void SetRestartState();
+
void SynchronizeExtensionRepositories();
void SetSplashScreenText( const ::rtl::OUString& rText );
void SetSplashScreenProgress( sal_Int32 );
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index 92a4853c2b..b6e14a5ce7 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -143,3 +143,11 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs
..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar
..\%__SRC%\misc\registry\spool\org\openoffice\Office\Jobs\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs
+..\%__SRC%\misc\deployment.component %_DEST%\xml%_EXT%\deployment.component
+..\%__SRC%\misc\deploymentgui.component %_DEST%\xml%_EXT%\deploymentgui.component
+..\%__SRC%\misc\migrationoo2.component %_DEST%\xml%_EXT%\migrationoo2.component
+..\%__SRC%\misc\migrationoo3.component %_DEST%\xml%_EXT%\migrationoo3.component
+..\%__SRC%\misc\offacc.component %_DEST%\xml%_EXT%\offacc.component
+..\%__SRC%\misc\productregistration.jar.component %_DEST%\xml%_EXT%\productregistration.jar.component
+..\%__SRC%\misc\socomp.component %_DEST%\xml%_EXT%\socomp.component
+..\%__SRC%\misc\spl.component %_DEST%\xml%_EXT%\spl.component
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index e2031c2f82..6ac6c0ca68 100644
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -43,15 +43,14 @@ export SAL_ENABLE_FILE_LOCKING
#@# export JITC_PROCESSOR_TYPE=6
# resolve installation directory
-sd_cwd="`pwd`"
-if [ -h "$0" ] ; then
- sd_basename=`basename "$0"`
- sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
- cd "`dirname "$0"`"
- cd "`dirname "$sd_script"`"
-else
- cd "`dirname "$0"`"
-fi
+sd_cwd=`pwd`
+sd_res=$0
+while [ -h "$sd_res" ] ; do
+ cd "`dirname "$sd_res"`"
+ sd_basename=`basename "$sd_res"`
+ sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
+done
+cd "`dirname "$sd_res"`"
sd_prog=`pwd`
cd "$sd_cwd"
diff --git a/desktop/scripts/unoinfo.sh b/desktop/scripts/unoinfo.sh
index 3af17625a6..9fc80b5f32 100644
--- a/desktop/scripts/unoinfo.sh
+++ b/desktop/scripts/unoinfo.sh
@@ -29,14 +29,13 @@
set -e
# resolve installation directory
-if [ -h "$0" ] ; then
- sd_basename=`basename "$0"`
- sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
- cd "`dirname "$0"`"
- cd "`dirname "$sd_script"`"
-else
- cd "`dirname "$0"`"
-fi
+sd_res=$0
+while [ -h "$sd_res" ] ; do
+ cd "`dirname "$sd_res"`"
+ sd_basename=`basename "$sd_res"`
+ sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
+done
+cd "`dirname "$sd_res"`"
sd_prog=`pwd`
case $1 in
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 5a8ee262ae..8a9f638df0 100644
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -31,15 +31,14 @@ SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING
# resolve installation directory
-sd_cwd="`pwd`"
-if [ -h "$0" ] ; then
- sd_basename=`basename "$0"`
- sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
- cd "`dirname "$0"`"
- cd "`dirname "$sd_script"`"
-else
- cd "`dirname "$0"`"
-fi
+sd_cwd=`pwd`
+sd_res=$0
+while [ -h "$sd_res" ] ; do
+ cd "`dirname "$sd_res"`"
+ sd_basename=`basename "$sd_res"`
+ sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
+done
+cd "`dirname "$sd_res"`"
sd_prog=`pwd`
cd "$sd_cwd"
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index b5406fc127..741ec83988 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -28,6 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include <cstdlib>
+#include <vector>
+
#include <memory>
#include <unistd.h>
#include "app.hxx"
@@ -119,6 +122,7 @@
#include <osl/file.hxx>
#include <osl/signal.h>
#include <rtl/uuid.h>
+#include <rtl/uri.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/languageoptions.hxx>
#include <unotools/internaloptions.hxx>
@@ -155,6 +159,11 @@
#include "langselect.hxx"
+#if defined MACOSX
+#include <errno.h>
+#include <sys/wait.h>
+#endif
+
#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
#define U2S(STRING) ::rtl::OUStringToOString(STRING, RTL_TEXTENCODING_UTF8)
@@ -460,6 +469,194 @@ void ReplaceStringHookProc( UniString& rStr )
}
}
+static const char pLastSyncFileName[] = "lastsynchronized";
+static const sal_Int32 nStrLenLastSync = 16;
+
+static bool needsSynchronization(
+ ::rtl::OUString const & baseSynchronizedURL, ::rtl::OUString const & userSynchronizedURL )
+{
+ bool bNeedsSync( false );
+
+ ::osl::DirectoryItem itemUserFile;
+ ::osl::File::RC err1 =
+ ::osl::DirectoryItem::get(userSynchronizedURL, itemUserFile);
+
+ //If it does not exist, then there is nothing to be done
+ if (err1 == ::osl::File::E_NOENT)
+ {
+ return true;
+ }
+ else if (err1 != ::osl::File::E_None)
+ {
+ OSL_ENSURE(0, "Cannot access lastsynchronized in user layer");
+ return true; //sync just in case
+ }
+
+ //If last synchronized does not exist in base layer, then do nothing
+ ::osl::DirectoryItem itemBaseFile;
+ ::osl::File::RC err2 = ::osl::DirectoryItem::get(baseSynchronizedURL, itemBaseFile);
+ if (err2 == ::osl::File::E_NOENT)
+ {
+ return true;
+
+ }
+ else if (err2 != ::osl::File::E_None)
+ {
+ OSL_ENSURE(0, "Cannot access file lastsynchronized in base layer");
+ return true; //sync just in case
+ }
+
+ //compare the modification time of the extension folder and the last
+ //modified file
+ ::osl::FileStatus statUser(FileStatusMask_ModifyTime);
+ ::osl::FileStatus statBase(FileStatusMask_ModifyTime);
+ if (itemUserFile.getFileStatus(statUser) == ::osl::File::E_None)
+ {
+ if (itemBaseFile.getFileStatus(statBase) == ::osl::File::E_None)
+ {
+ TimeValue timeUser = statUser.getModifyTime();
+ TimeValue timeBase = statBase.getModifyTime();
+
+ if (timeUser.Seconds < timeBase.Seconds)
+ bNeedsSync = true;
+ }
+ else
+ {
+ OSL_ASSERT(0);
+ bNeedsSync = true;
+ }
+ }
+ else
+ {
+ OSL_ASSERT(0);
+ bNeedsSync = true;
+ }
+
+ return bNeedsSync;
+}
+
+static ::rtl::OUString getBrandSharePreregBundledPathURL()
+{
+ ::rtl::OUString url(
+ RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/share/prereg/bundled"));
+
+ ::rtl::Bootstrap::expandMacros(url);
+ return url;
+}
+
+static ::rtl::OUString getUserBundledExtPathURL()
+{
+ ::rtl::OUString folder( RTL_CONSTASCII_USTRINGPARAM( "$BUNDLED_EXTENSIONS_USER" ));
+ ::rtl::Bootstrap::expandMacros(folder);
+
+ return folder;
+}
+
+static ::rtl::OUString getLastSyncFileURLFromBrandInstallation()
+{
+ ::rtl::OUString aURL = getBrandSharePreregBundledPathURL();
+ ::sal_Int32 nLastIndex = aURL.lastIndexOf('/');
+
+ ::rtl::OUStringBuffer aTmp( aURL );
+
+ if ( nLastIndex != aURL.getLength()-1 )
+ aTmp.appendAscii( "/" );
+ aTmp.appendAscii( pLastSyncFileName );
+
+ return aTmp.makeStringAndClear();
+}
+
+static ::rtl::OUString getLastSyncFileURLFromUserInstallation()
+{
+ ::rtl::OUString aUserBundledPathURL = getUserBundledExtPathURL();
+ ::sal_Int32 nLastIndex = aUserBundledPathURL.lastIndexOf('/');
+
+ ::rtl::OUStringBuffer aTmp( aUserBundledPathURL );
+
+ if ( nLastIndex != aUserBundledPathURL.getLength()-1 )
+ aTmp.appendAscii( "/" );
+ aTmp.appendAscii( pLastSyncFileName );
+
+ return aTmp.makeStringAndClear();
+}
+
+static osl::FileBase::RC copy_bundled_recursive(
+ const rtl::OUString& srcUnqPath,
+ const rtl::OUString& dstUnqPath,
+ sal_Int32 TypeToCopy )
+throw()
+{
+ osl::FileBase::RC err = osl::FileBase::E_None;
+
+ if( TypeToCopy == -1 ) // Document
+ {
+ err = osl::File::copy( srcUnqPath,dstUnqPath );
+ }
+ else if( TypeToCopy == +1 ) // Folder
+ {
+ osl::Directory aDir( srcUnqPath );
+ aDir.open();
+
+ err = osl::Directory::create( dstUnqPath );
+ osl::FileBase::RC next = err;
+ if( err == osl::FileBase::E_None ||
+ err == osl::FileBase::E_EXIST )
+ {
+ err = osl::FileBase::E_None;
+ sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type;
+
+ osl::DirectoryItem aDirItem;
+
+ while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
+ {
+ sal_Bool IsDoc = false;
+ sal_Bool bFilter = false;
+ osl::FileStatus aFileStatus( n_Mask );
+ aDirItem.getFileStatus( aFileStatus );
+ if( aFileStatus.isValid( FileStatusMask_Type ) )
+ IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular;
+
+ // Getting the information for the next recursive copy
+ sal_Int32 newTypeToCopy = IsDoc ? -1 : +1;
+
+ rtl::OUString newSrcUnqPath;
+ if( aFileStatus.isValid( FileStatusMask_FileURL ) )
+ newSrcUnqPath = aFileStatus.getFileURL();
+
+ rtl::OUString newDstUnqPath = dstUnqPath;
+ rtl::OUString tit;
+ if( aFileStatus.isValid( FileStatusMask_FileName ) )
+ {
+ ::rtl::OUString aFileName = aFileStatus.getFileName();
+ tit = rtl::Uri::encode( aFileName,
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+
+ // Special treatment for "lastsychronized" file. Must not be
+ // copied from the bundled folder!
+ if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName ))
+ bFilter = true;
+ }
+
+ if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 )
+ newDstUnqPath += rtl::OUString::createFromAscii( "/" );
+
+ newDstUnqPath += tit;
+
+ if (( newSrcUnqPath != dstUnqPath ) && !bFilter )
+ err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy );
+ }
+
+ if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT )
+ err = next;
+ }
+ aDir.close();
+ }
+
+ return err;
+}
+
Desktop::Desktop()
: m_bServicesRegistered( false )
, m_aBootstrapError( BE_OK )
@@ -477,6 +674,24 @@ void Desktop::Init()
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" );
SetBootstrapStatus(BS_OK);
+ // Check for lastsynchronized file for bundled extensions in the user directory
+ // and test if synchronzation is necessary!
+ {
+ ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation();
+ ::rtl::OUString aPreregSyncFilePathURL = getLastSyncFileURLFromBrandInstallation();
+
+ if ( needsSynchronization( aPreregSyncFilePathURL, aUserLastSyncFilePathURL ))
+ {
+ rtl::OUString aUserPath = getUserBundledExtPathURL();
+ rtl::OUString aPreregBundledPath = getBrandSharePreregBundledPathURL();
+
+ // copy bundled folder to the user directory
+ osl::FileBase::RC rc = osl::Directory::createPath(aUserPath);
+ (void) rc;
+ copy_bundled_recursive( aPreregBundledPath, aUserPath, +1 );
+ }
+ }
+
// create service factory...
Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager();
if( rSMgr.is() )
@@ -1117,28 +1332,79 @@ sal_Bool Desktop::SaveTasks()
sal_False);
}
-#ifdef MACOSX
-static void DoRestart()
-{
- oslProcess process;
- oslProcessError error;
- OUString sExecutableFile;
-
- osl_getExecutableFile( &sExecutableFile.pData );
-
- error = osl_executeProcess(
- sExecutableFile.pData,
- NULL,
- 0,
- 0,
- NULL,
- NULL,
- NULL,
- 0,
- &process
- );
-}
+namespace {
+
+void restartOnMac(bool passArguments) {
+#if defined MACOSX
+ OfficeIPCThread::DisableOfficeIPCThread();
+ rtl::OUString execUrl;
+ OSL_VERIFY(osl_getExecutableFile(&execUrl.pData) == osl_Process_E_None);
+ rtl::OUString execPath;
+ rtl::OString execPath8;
+ if ((osl::FileBase::getSystemPathFromFileURL(execUrl, execPath)
+ != osl::FileBase::E_None) ||
+ !execPath.convertToString(
+ &execPath8, osl_getThreadTextEncoding(),
+ (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+ {
+ std::abort();
+ }
+ std::vector< rtl::OString > args;
+ args.push_back(execPath8);
+ bool wait = false;
+ if (passArguments) {
+ sal_uInt32 n = osl_getCommandArgCount();
+ for (sal_uInt32 i = 0; i < n; ++i) {
+ rtl::OUString arg;
+ OSL_VERIFY(osl_getCommandArg(i, &arg.pData) == osl_Process_E_None);
+ if (arg.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("-accept="))) {
+ wait = true;
+ }
+ rtl::OString arg8;
+ if (!arg.convertToString(
+ &arg8, osl_getThreadTextEncoding(),
+ (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+ {
+ std::abort();
+ }
+ args.push_back(arg8);
+ }
+ }
+ std::vector< char const * > argPtrs;
+ for (std::vector< rtl::OString >::iterator i(args.begin()); i != args.end();
+ ++i)
+ {
+ argPtrs.push_back(i->getStr());
+ }
+ argPtrs.push_back(0);
+ execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0]));
+ if (errno == ENOTSUP) { // happens when multithreaded on OS X < 10.6
+ pid_t pid = fork();
+ if (pid == 0) {
+ execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0]));
+ } else if (pid > 0) {
+ // Two simultaneously running soffice processes lead to two dock
+ // icons, so avoid waiting here unless it must be assumed that the
+ // process invoking soffice itself wants to wait for soffice to
+ // finish:
+ if (!wait) {
+ return;
+ }
+ int stat;
+ if (waitpid(pid, &stat, 0) == pid && WIFEXITED(stat)) {
+ _exit(WEXITSTATUS(stat));
+ }
+ }
+ }
+ std::abort();
+#else
+ (void) passArguments; // avoid warnings
#endif
+}
+
+}
USHORT Desktop::Exception(USHORT nError)
{
@@ -1209,9 +1475,7 @@ USHORT Desktop::Exception(USHORT nError)
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
DELETEZ( pSignalHandler );
-#ifdef MACOSX
- DoRestart();
-#endif
+ restartOnMac(false);
_exit( ExitHelper::E_CRASH_WITH_RESTART );
}
else
@@ -1294,6 +1558,10 @@ void Desktop::Main()
std::auto_ptr<SvtLanguageOptions> pLanguageOptions;
std::auto_ptr<SvtPathOptions> pPathOptions;
+ Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
+ sal_Bool bRestartRequested( sal_False );
+ sal_Bool bUseSystemFileDialog(sal_True);
+ int nAcquireCount( 0 );
Reference < css::document::XEventListener > xGlobalBroadcaster;
try
{
@@ -1423,6 +1691,13 @@ void Desktop::Main()
( xSMgr->createInstance(
DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY );
+ /* ensure existance of a default window that messages can be dispatched to
+ This is for the benefit of testtool which uses PostUserEvent extensively
+ and else can deadlock while creating this window from another tread while
+ the main thread is not yet in the event loop.
+ */
+ Application::GetDefaultDevice();
+
// initialize test-tool library (if available)
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ tools::InitTestToolLib" );
tools::InitTestToolLib();
@@ -1487,58 +1762,79 @@ void Desktop::Main()
impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" );
- if (
- (pCmdLineArgs->IsEmptyOrAcceptOnly() ) &&
- (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
- (!bExistsRecoveryData ) &&
- (!bExistsSessionData ) &&
- (!Application::AnyInput( INPUT_APPEVENT ) )
- )
{
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" );
- Reference< XFrame > xDesktopFrame( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
- if (xDesktopFrame.is())
+ ::comphelper::ComponentContext aContext( xSMgr );
+ xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY );
+ }
+
+ // check whether the shutdown is caused by restart
+ bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+
+ if ( pCmdLineArgs->IsHeadless() )
+ {
+ // Ensure that we use not the system file dialogs as
+ // headless mode relies on Application::EnableHeadlessMode()
+ // which does only work for VCL dialogs!!
+ SvtMiscOptions aMiscOptions;
+ bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog();
+ aMiscOptions.SetUseSystemFileDialog( sal_False );
+ }
+
+ if ( !bRestartRequested )
+ {
+ if (
+ (pCmdLineArgs->IsEmptyOrAcceptOnly() ) &&
+ (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) &&
+ (!bExistsRecoveryData ) &&
+ (!bExistsSessionData ) &&
+ (!Application::AnyInput( INPUT_APPEVENT ) )
+ )
{
-// SetSplashScreenProgress(60);
- Reference< XFrame > xBackingFrame;
- Reference< ::com::sun::star::awt::XWindow > xContainerWindow;
-
- xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0);
- if (xBackingFrame.is())
- xContainerWindow = xBackingFrame->getContainerWindow();
- if (xContainerWindow.is())
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" );
+ Reference< XFrame > xDesktopFrame( xSMgr->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
+ if (xDesktopFrame.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;
-
- Reference< XController > xBackingComp(
- xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs),
- UNO_QUERY);
-// SetSplashScreenProgress(80);
- if (xBackingComp.is())
+ // SetSplashScreenProgress(60);
+ Reference< XFrame > xBackingFrame;
+ Reference< ::com::sun::star::awt::XWindow > xContainerWindow;
+
+ xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0);
+ if (xBackingFrame.is())
+ xContainerWindow = xBackingFrame->getContainerWindow();
+ if (xContainerWindow.is())
{
- Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY);
- // Attention: You MUST(!) call setComponent() before you call attachFrame().
- // Because the backing component set the property "IsBackingMode" of the frame
- // to true inside attachFrame(). But setComponent() reset this state everytimes ...
- xBackingFrame->setComponent(xBackingWin, xBackingComp);
- SetSplashScreenProgress(100);
- xBackingComp->attachFrame(xBackingFrame);
- CloseSplashScreen();
- xContainerWindow->setVisible(sal_True);
+ // 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;
+
+ Reference< XController > xBackingComp(
+ xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs),
+ UNO_QUERY);
+ // SetSplashScreenProgress(80);
+ if (xBackingComp.is())
+ {
+ Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY);
+ // Attention: You MUST(!) call setComponent() before you call attachFrame().
+ // Because the backing component set the property "IsBackingMode" of the frame
+ // to true inside attachFrame(). But setComponent() reset this state everytimes ...
+ xBackingFrame->setComponent(xBackingWin, xBackingComp);
+ SetSplashScreenProgress(100);
+ xBackingComp->attachFrame(xBackingFrame);
+ CloseSplashScreen();
+ xContainerWindow->setVisible(sal_True);
+ }
}
}
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" );
}
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" );
}
}
catch ( com::sun::star::lang::WrappedTargetException& wte )
@@ -1573,107 +1869,98 @@ void Desktop::Main()
aOptions.SetVCLSettings();
// SetSplashScreenProgress(60);
- Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) );
+ if ( !bRestartRequested )
+ {
+ Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) );
- sal_Bool bTerminateRequested = sal_False;
+ sal_Bool bTerminateRequested = sal_False;
- // Preload function depends on an initialized sfx application!
- SetSplashScreenProgress(75);
+ // Preload function depends on an initialized sfx application!
+ SetSplashScreenProgress(75);
- sal_Bool bUseSystemFileDialog(sal_True);
- if ( pCmdLineArgs->IsHeadless() )
- {
- // Ensure that we use not the system file dialogs as
- // headless mode relies on Application::EnableHeadlessMode()
- // which does only work for VCL dialogs!!
- SvtMiscOptions aMiscOptions;
- bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog();
- aMiscOptions.SetUseSystemFileDialog( sal_False );
- }
+ // use system window dialogs
+ Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG );
- // use system window dialogs
- Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG );
+ // SetSplashScreenProgress(80);
-// SetSplashScreenProgress(80);
+ if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() &&
+ !pCmdLineArgs->IsNoQuickstart() )
+ InitializeQuickstartMode( xSMgr );
- if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() &&
- !pCmdLineArgs->IsNoQuickstart() )
- InitializeQuickstartMode( xSMgr );
+ RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" );
+ try
+ {
+ Reference< XDesktop > xDesktop( xSMgr->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
+ if ( xDesktop.is() )
+ xDesktop->addTerminateListener( new OfficeIPCThreadController );
+ SetSplashScreenProgress(100);
+ }
+ catch ( com::sun::star::uno::Exception& e )
+ {
+ FatalError( MakeStartupErrorMessage(e.Message) );
+ return;
+ }
+ /*
+ catch ( ... )
+ {
+ FatalError( MakeStartupErrorMessage(
+ OUString::createFromAscii(
+ "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged.")));
+ return;
+ }
+ */
- RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" );
- try
- {
- Reference< XDesktop > xDesktop( xSMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
- if ( xDesktop.is() )
- xDesktop->addTerminateListener( new OfficeIPCThreadController );
- SetSplashScreenProgress(100);
- }
- catch ( com::sun::star::uno::Exception& e )
- {
- FatalError( MakeStartupErrorMessage(e.Message) );
- return;
- }
- /*
- catch ( ... )
- {
- FatalError( MakeStartupErrorMessage(
- OUString::createFromAscii(
- "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged.")));
- return;
- }
- */
+ // Post user event to startup first application component window
+ // We have to send this OpenClients message short before execute() to
+ // minimize the risk that this message overtakes type detection contruction!!
+ Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) );
- // Release solar mutex just before we wait for our client to connect
- int nAcquireCount = 0;
- ::vos::IMutex& rMutex = Application::GetSolarMutex();
- if ( rMutex.tryToAcquire() )
- nAcquireCount = Application::ReleaseSolarMutex() - 1;
+ // Post event to enable acceptors
+ Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) );
- // Post user event to startup first application component window
- // We have to send this OpenClients message short before execute() to
- // minimize the risk that this message overtakes type detection contruction!!
- Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) );
+ // The configuration error handler currently is only for startup
+ aConfigErrHandler.deactivate();
- // Post event to enable acceptors
- Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) );
+ // Acquire solar mutex just before we enter our message loop
+ if ( nAcquireCount )
+ Application::AcquireSolarMutex( nAcquireCount );
- // The configuration error handler currently is only for startup
- aConfigErrHandler.deactivate();
+ // call Application::Execute to process messages in vcl message loop
+ RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" );
- // Acquire solar mutex just before we enter our message loop
- if ( nAcquireCount )
- Application::AcquireSolarMutex( nAcquireCount );
+ try
+ {
+ // The JavaContext contains an interaction handler which is used when
+ // the creation of a Java Virtual Machine fails
+ com::sun::star::uno::ContextLayer layer2(
+ new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) );
- // call Application::Execute to process messages in vcl message loop
- RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" );
+ // check whether the shutdown is caused by restart just before entering the Execute
+ bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
- Reference< ::com::sun::star::task::XRestartManager > xRestartManager;
- try
- {
- // The JavaContext contains an interaction handler which is used when
- // the creation of a Java Virtual Machine fails
- com::sun::star::uno::ContextLayer layer2(
- new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) );
+ if ( !bRestartRequested )
+ {
+ // if this run of the office is triggered by restart, some additional actions should be done
+ DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() );
- ::comphelper::ComponentContext aContext( xSMgr );
- xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY );
- if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) )
- Execute();
- }
- catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg)
- {
- OfficeIPCThread::SetDowning();
- FatalError( MakeStartupErrorMessage(exFilterCfg.Message) );
- }
- catch(const com::sun::star::configuration::CorruptedConfigurationException& exAnyCfg)
- {
- OfficeIPCThread::SetDowning();
- FatalError( MakeStartupErrorMessage(exAnyCfg.Message) );
+ Execute();
+ }
+ }
+ catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg)
+ {
+ OfficeIPCThread::SetDowning();
+ FatalError( MakeStartupErrorMessage(exFilterCfg.Message) );
+ }
+ catch(const com::sun::star::configuration::CorruptedConfigurationException& exAnyCfg)
+ {
+ OfficeIPCThread::SetDowning();
+ FatalError( MakeStartupErrorMessage(exAnyCfg.Message) );
+ }
}
-
- // check whether the shutdown is caused by restart
- sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) );
+
+ if ( bRestartRequested )
+ SetRestartState();
if (xGlobalBroadcaster.is())
{
@@ -1709,9 +1996,7 @@ void Desktop::Main()
RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" );
if ( bRestartRequested )
{
-#ifdef MACOSX
- DoRestart();
-#endif
+ restartOnMac(true);
// wouldn't the solution be more clean if SalMain returns the exit code to the system?
_exit( ExitHelper::E_NORMAL_RESTART );
}
@@ -2368,8 +2653,6 @@ void Desktop::OpenClients()
aHelpURLBuffer.appendAscii("&System=UNX");
#elif defined WNT
aHelpURLBuffer.appendAscii("&System=WIN");
-#elif defined MAC
- aHelpURLBuffer.appendAscii("&System=MAC");
#elif defined OS2
aHelpURLBuffer.appendAscii("&System=OS2");
#endif
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index 9e2d865184..943f45de2b 100644
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -36,12 +36,14 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/util/XChangesBatch.hpp>
#include "app.hxx"
-using rtl::OUString;
-using namespace desktop;
-using namespace com::sun::star::beans;
+using ::rtl::OUString;
+using namespace ::desktop;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::beans;
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
@@ -128,24 +130,29 @@ sal_Bool Desktop::LicenseNeedsAcceptance()
*/
}
-/* Local function - was the wizard completed already? */
-static sal_Bool impl_isFirstStart()
+/* Local function - get access to the configuration */
+static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath )
{
- try {
- Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
- // get configuration provider
- Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
- xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+ // get configuration provider
+ Reference< XMultiServiceFactory > xConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance( sConfigSrvc ), UNO_QUERY_THROW );
- Sequence< Any > theArgs(1);
- NamedValue v(OUString::createFromAscii("NodePath"), makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
- theArgs[0] <<= v;
+ Sequence< Any > aArgs( 1 );
+ NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NodePath" ) ), makeAny( rPath ) );
+ aArgs[0] <<= aValue;
+ return Reference< XPropertySet >(
+ xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW );
+}
- Reference< XPropertySet > pset = Reference< XPropertySet >(
- theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
+/* Local function - was the wizard completed already? */
+static sal_Bool impl_isFirstStart()
+{
+ try {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
- Any result = pset->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"));
+ Any result = xPSet->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"));
sal_Bool bCompleted = sal_False;
if ((result >>= bCompleted) && bCompleted)
return sal_False; // wizard was already completed
@@ -219,20 +226,9 @@ static sal_Bool impl_isLicenseAccepted()
try
{
- Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
-
- // get configuration provider
- Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
- xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
- Sequence< Any > theArgs(1);
- NamedValue v(OUString::createFromAscii("NodePath"),
- makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
- theArgs[0] <<= v;
- Reference< XPropertySet > pset = Reference< XPropertySet >(
- theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
-
- Any result = pset->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate"));
+ Any result = xPSet->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate"));
OUString aAcceptDate;
if (result >>= aAcceptDate)
@@ -272,3 +268,51 @@ sal_Bool Desktop::IsFirstStartWizardNeeded()
return impl_isFirstStart() || !impl_isLicenseAccepted();
}
+void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
+{
+ if ( bQuickStart )
+ {
+ try
+ {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
+
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
+ Any aRestart = xPSet->getPropertyValue( sPropName );
+ sal_Bool bRestart = sal_False;
+ if ( ( aRestart >>= bRestart ) && bRestart )
+ {
+ xPSet->setPropertyValue( sPropName, makeAny( sal_False ) );
+ Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
+
+ Sequence< Any > aSeq( 2 );
+ aSeq[0] <<= sal_True;
+ aSeq[1] <<= sal_True;
+
+ Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW );
+ xQuickstart->initialize( aSeq );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ // this is no critical operation so it should not prevent office from starting
+ }
+ }
+}
+
+void Desktop::SetRestartState()
+{
+ try
+ {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
+ xPSet->setPropertyValue( sPropName, makeAny( sal_True ) );
+ Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
+ }
+ catch( uno::Exception& )
+ {
+ // this is no critical operation, ignore the exception
+ }
+
+}
+
diff --git a/desktop/source/app/exports.dxp b/desktop/source/app/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/desktop/source/app/exports.dxp
+++ b/desktop/source/app/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 0bd9db40de..5f7e4be8c7 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -847,8 +847,6 @@ void SAL_CALL OfficeIPCThread::run()
aHelpURLBuffer.appendAscii("&System=UNX");
#elif defined WNT
aHelpURLBuffer.appendAscii("&System=WIN");
-#elif defined MAC
- aHelpURLBuffer.appendAscii("&System=MAC");
#elif defined OS2
aHelpURLBuffer.appendAscii("&System=OS2");
#endif
diff --git a/desktop/source/deployment/deployment.component b/desktop/source/deployment/deployment.component
new file mode 100644
index 0000000000..11385c7aa8
--- /dev/null
+++ b/desktop/source/deployment/deployment.component
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.deployment.ExtensionManager">
+ <service name="com.sun.star.comp.deployment.ExtensionManager"/>
+ <singleton name="com.sun.star.deployment.ExtensionManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.PackageInformationProvider">
+ <service name="com.sun.star.comp.deployment.PackageInformationProvider"/>
+ <singleton name="com.sun.star.deployment.PackageInformationProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.PackageManagerFactory">
+ <service name="com.sun.star.comp.deployment.PackageManagerFactory"/>
+ <singleton name="com.sun.star.deployment.thePackageManagerFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.ProgressLog">
+ <service name="com.sun.star.comp.deployment.ProgressLog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.component.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.configuration.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.executable.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.help.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.script.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.sfwk.PackageRegistryBackend">
+ <service name="com.sun.star.deployment.PackageRegistryBackend"/>
+ </implementation>
+</component>
diff --git a/desktop/source/deployment/dp_services.cxx b/desktop/source/deployment/dp_services.cxx
index 4e5277ea11..db42a215e7 100644
--- a/desktop/source/deployment/dp_services.cxx
+++ b/desktop/source/deployment/dp_services.cxx
@@ -92,27 +92,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return component_writeInfoHelper(
- pServiceManager, pRegistryKey,
- dp_registry::backend::configuration::serviceDecl,
- dp_registry::backend::component::serviceDecl,
- dp_registry::backend::help::serviceDecl,
- dp_registry::backend::script::serviceDecl,
- dp_registry::backend::sfwk::serviceDecl,
- dp_registry::backend::executable::serviceDecl,
- dp_manager::factory::serviceDecl,
- dp_log::serviceDecl,
- dp_info::serviceDecl,
- dp_manager::serviceDecl) &&
- dp_manager::factory::singleton_entries( pRegistryKey ) &&
- dp_info::singleton_entries( pRegistryKey ) &&
- dp_manager::singleton_entries( pRegistryKey);
-}
-
void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/desktop/source/deployment/gui/deploymentgui.component b/desktop/source/deployment/gui/deploymentgui.component
new file mode 100644
index 0000000000..d613f482e7
--- /dev/null
+++ b/desktop/source/deployment/gui/deploymentgui.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.deployment.ui.LicenseDialog">
+ <service name="com.sun.star.deployment.ui.LicenseDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.ui.PackageManagerDialog">
+ <service name="com.sun.star.deployment.ui.PackageManagerDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.deployment.ui.UpdateRequiredDialog">
+ <service name="com.sun.star.deployment.ui.UpdateRequiredDialog"/>
+ </implementation>
+</component>
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index ed5db4cb11..5f1b35932b 100755..100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -363,24 +363,28 @@ bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse )
// -----------------------------------------------------------------------
MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
{
- if ( nPos >= (long) getItemCount() )
- return CMD_NONE;
+ if ( ( nPos >= 0 ) && ( nPos < (long) getItemCount() ) )
+ {
+ if ( ! GetEntryData( nPos )->m_bLocked )
+ {
+ PopupMenu aPopup;
- PopupMenu aPopup;
+ aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
- aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
+ if ( GetEntryData( nPos )->m_bUser )
+ {
+ if ( GetEntryData( nPos )->m_eState == REGISTERED )
+ aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
+ aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
+ }
- if ( ! GetEntryData( nPos )->m_bLocked )
- {
- if ( GetEntryData( nPos )->m_eState == REGISTERED )
- aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
- else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
- aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
-
- aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
- }
+ aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) );
- return (MENU_COMMAND) aPopup.Execute( this, rPos );
+ return (MENU_COMMAND) aPopup.Execute( this, rPos );
+ }
+ }
+ return CMD_NONE;
}
//------------------------------------------------------------------------------
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index aaa6e6f64b..b8daa7668d 100755..100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -356,14 +356,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return component_writeInfoHelper(
- pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl );
-}
-
void * SAL_CALL component_getFactory(
sal_Char const * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index 52092a077a..fe3921bf50 100644
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -107,3 +107,11 @@ RESLIB1IMAGES= $(PRJ)$/res
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/deploymentgui.component
+
+$(MISC)/deploymentgui.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt deploymentgui.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt deploymentgui.component
diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk
index 6d83a5c100..991ba7026d 100644
--- a/desktop/source/deployment/makefile.mk
+++ b/desktop/source/deployment/makefile.mk
@@ -110,3 +110,11 @@ RESLIB1SRSFILES += $(SRS)$/deployment_misc.srs
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/deployment.component
+
+$(MISC)/deployment.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ deployment.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt deployment.component
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 3cf6e48595..ab0baa78e3 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -1136,6 +1136,14 @@ sal_Bool ExtensionManager::synchronize(
bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv);
progressBundled.update(OUSTR("\n\n"));
+ //Always determine the active extension. This is necessary for the
+ //first-start optimization. The setup creates the registration data for the
+ //bundled extensions (brand_layer/share/prereg/bundled), which is copied to the user
+ //installation (user_installation/extension/bundled) when a user starts OOo
+ //for the first time after running setup. All bundled extensions are registered
+ //at that moment. However, extensions with the same identifier can be in the
+ //shared or user repository, in which case the respective bundled extensions must
+ //be revoked.
try
{
const uno::Sequence<uno::Sequence<Reference<deploy::XPackage> > >
diff --git a/desktop/source/deployment/manager/dp_properties.cxx b/desktop/source/deployment/manager/dp_properties.cxx
index 65f3d14c75..317ad3da78 100644
--- a/desktop/source/deployment/manager/dp_properties.cxx
+++ b/desktop/source/deployment/manager/dp_properties.cxx
@@ -2,7 +2,7 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
diff --git a/desktop/source/deployment/manager/dp_properties.hxx b/desktop/source/deployment/manager/dp_properties.hxx
index f135ff9977..45a0583d54 100644
--- a/desktop/source/deployment/manager/dp_properties.hxx
+++ b/desktop/source/deployment/manager/dp_properties.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_manager.h,v $
- * $Revision: 1.17 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 689e8cfd0d..c988e6494b 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -589,6 +589,11 @@ void TRACE(::rtl::OString const & sText)
void syncRepositories(Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
+ OUString sDisable;
+ ::rtl::Bootstrap::get( OUSTR( "DISABLE_EXTENSION_SYNCHRONIZATION" ), sDisable, OUString() );
+ if (sDisable.getLength() > 0)
+ return;
+
Reference<deployment::XExtensionManager> xExtensionManager;
//synchronize shared before bundled otherewise there are
//more revoke and registration calls.
diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
index 112eb5917b..43571483bf 100755..100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -90,8 +90,6 @@ getUpdateInformation( Reference<deployment::XUpdateInformationProvider > const &
Sequence<Reference< xml::dom::XElement > >();
}
-//Put in anonymous namespace
-
void getOwnUpdateInfos(
Reference<uno::XComponentContext> const & xContext,
Reference<deployment::XUpdateInformationProvider > const & updateInformation,
@@ -185,6 +183,56 @@ void getDefaultUpdateInfos(
}
}
+bool containsBundledOnly(Sequence<Reference<deployment::XPackage> > const & sameIdExtensions)
+{
+ OSL_ASSERT(sameIdExtensions.getLength() == 3);
+ if (!sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is())
+ return true;
+ else
+ return false;
+}
+/** Returns true if the list of extensions are bundled extensions and there are no
+ other extensions with the same identifier in the shared or user repository.
+ If extensionList is NULL, then it is checked if there are only bundled extensions.
+*/
+bool onlyBundledExtensions(
+ Reference<deployment::XExtensionManager> const & xExtMgr,
+ std::vector< Reference<deployment::XPackage > > const * extensionList)
+{
+ OSL_ASSERT(xExtMgr.is());
+ bool onlyBundled = true;
+ if (extensionList)
+ {
+ typedef std::vector<Reference<deployment::XPackage > >::const_iterator CIT;
+ for (CIT i = extensionList->begin(); i != extensionList->end(); i++)
+ {
+ Sequence<Reference<deployment::XPackage> > seqExt = xExtMgr->getExtensionsWithSameIdentifier(
+ dp_misc::getIdentifier(*i), (*i)->getName(), Reference<ucb::XCommandEnvironment>());
+
+ if (!containsBundledOnly(seqExt))
+ {
+ onlyBundled = false;
+ break;
+ }
+
+ }
+ }
+ else
+ {
+ const uno::Sequence< uno::Sequence< Reference<deployment::XPackage > > > seqAllExt =
+ xExtMgr->getAllExtensions(Reference<task::XAbortChannel>(), Reference<ucb::XCommandEnvironment>());
+
+ for (int pos = seqAllExt.getLength(); pos --; )
+ {
+ if (!containsBundledOnly(seqAllExt[pos]))
+ {
+ onlyBundled = false;
+ break;
+ }
+ }
+ }
+ return onlyBundled;
+}
} // anon namespace
@@ -233,13 +281,14 @@ UPDATE_SOURCE isUpdateUserExtension(
retVal = UPDATE_SOURCE_ONLINE;
}
- else if (bundledVersion.getLength())
- {
- int index = determineHighestVersion(
- OUString(), OUString(), bundledVersion, onlineVersion);
- if (index == 3)
- retVal = UPDATE_SOURCE_ONLINE;
- }
+ //No update for bundled extensions, they are updated only by the setup
+ //else if (bundledVersion.getLength())
+ //{
+ // int index = determineHighestVersion(
+ // OUString(), OUString(), bundledVersion, onlineVersion);
+ // if (index == 3)
+ // retVal = UPDATE_SOURCE_ONLINE;
+ //}
}
else
{
@@ -278,13 +327,14 @@ UPDATE_SOURCE isUpdateSharedExtension(
else if (index == 3)
retVal = UPDATE_SOURCE_ONLINE;
}
- else if (bundledVersion.getLength())
- {
- int index = determineHighestVersion(
- OUString(), OUString(), bundledVersion, onlineVersion);
- if (index == 3)
- retVal = UPDATE_SOURCE_ONLINE;
- }
+ //No update for bundled extensions, they are updated only by the setup
+ //else if (bundledVersion.getLength())
+ //{
+ // int index = determineHighestVersion(
+ // OUString(), OUString(), bundledVersion, onlineVersion);
+ // if (index == 3)
+ // retVal = UPDATE_SOURCE_ONLINE;
+ //}
return retVal;
}
@@ -332,7 +382,7 @@ UpdateInfoMap getOnlineUpdateInfos(
{
OSL_ASSERT(xExtMgr.is());
UpdateInfoMap infoMap;
- if (!xExtMgr.is())
+ if (!xExtMgr.is() || onlyBundledExtensions(xExtMgr, extensionList))
return infoMap;
if (!extensionList)
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index c50e6bdf42..bb94b5f559 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -139,7 +139,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data);
::boost::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url);
- void deleteDataFromDb(OUString const & url);
+ OUString deleteDataFromDb(OUString const & url);
::std::list<OUString> getAllIniEntries();
public:
@@ -240,10 +240,18 @@ void BackendImpl::addDataToDb(
return data;
}
-void BackendImpl::deleteDataFromDb(OUString const & url)
+OUString BackendImpl::deleteDataFromDb(OUString const & url)
{
- if (m_backendDb.get())
+ OUString url2(url);
+ if (m_backendDb.get()) {
+ boost::optional< ConfigurationBackendDb::Data > data(
+ m_backendDb->getEntry(url));
+ if (data) {
+ url2 = expandUnoRcTerm(data->iniEntry);
+ }
m_backendDb->removeEntry(url);
+ }
+ return url2;
}
::std::list<OUString> BackendImpl::getAllIniEntries()
@@ -359,16 +367,11 @@ void BackendImpl::configmgrini_verify_init(
do {
OUString token( line.getToken( 0, ' ', index ).trim() );
if (token.getLength() > 0) {
- // cleanup, check if existing:
- if (create_ucb_content(
- 0, expandUnoRcTerm(token), xCmdEnv,
- false /* no throw */ )) {
- //The file may not exist anymore if a shared or bundled
- //extension was removed, but it can still be in the configmgrini.
- //After running XExtensionManager::synchronize, the configmgrini is
- //cleaned up
- m_xcs_files.push_back( token );
- }
+ //The file may not exist anymore if a shared or bundled
+ //extension was removed, but it can still be in the configmgrini.
+ //After running XExtensionManager::synchronize, the configmgrini is
+ //cleaned up
+ m_xcs_files.push_back( token );
}
}
while (index >= 0);
@@ -378,31 +381,15 @@ void BackendImpl::configmgrini_verify_init(
sal_Int32 index = sizeof ("DATA=") - 1;
do {
OUString token( line.getToken( 0, ' ', index ).trim() );
- if (token.getLength() > 0) {
+ if (token.getLength() > 0)
+ {
if (token[ 0 ] == '?')
token = token.copy( 1 );
- // cleanup, check if existing:
- if (create_ucb_content(
- 0, expandUnoRcTerm(token),
- xCmdEnv, false /* no throw */ )) {
- //The file may not exist anymore if a shared or bundled
- //extension was removed, but it can still be in the configmgrini.
- //After running XExtensionManager::synchronize, the configmgrini is
- //cleaned up
- m_xcu_files.push_back( token );
- }
- else
- {
- //Check if it was removed. Only when the file contained %origin, so that
- //a new file was writen in the user installation (e.g. $BUNDLED_EXTENSIONS_USER)
- //See also ConfigurationBackendDb.iniEntry
- ::std::list<OUString> iniEntries = getAllIniEntries();
- if (::std::find(iniEntries.begin(), iniEntries.end(), token)
- != iniEntries.end())
- m_xcu_files.push_back( token );
- else
- OSL_ENSURE(0, "Extension manager: Invalid configmgr.ini entry.");
- }
+ //The file may not exist anymore if a shared or bundled
+ //extension was removed, but it can still be in the configmgrini.
+ //After running XExtensionManager::synchronize, the configmgrini is
+ //cleaned up
+ m_xcu_files.push_back( token );
}
}
while (index >= 0);
@@ -502,6 +489,8 @@ bool BackendImpl::removeFromConfigmgrIni(
{
//in case the xcu contained %origin% then the configmr.ini contains the
//url to the file in the user installation (e.g. $BUNDLED_EXTENSIONS_USER)
+ //However, m_url (getURL()) contains the URL for the file in the actual
+ //extension installatation.
::boost::optional<ConfigurationBackendDb::Data> data = readDataFromDb(url_);
if (data)
i = std::find(rSet.begin(), rSet.end(), data->iniEntry);
@@ -736,11 +725,11 @@ void BackendImpl::PackageImpl::processPackage_(
//rebuilding the directory structure.
rtl::OUString url2(
rtl::OStringToOUString(i->first, RTL_TEXTENCODING_UTF8));
- ConfigurationBackendDb::Data data;
if (url2 != url) {
bool schema = i->second.equalsIgnoreAsciiCase(
"vnd.sun.star.configuration-schema");
OUString url_replaced(url2);
+ ConfigurationBackendDb::Data data;
if (!schema)
{
const OUString sModFolder = that->createFolder(OUString(), xCmdEnv);
@@ -753,18 +742,29 @@ void BackendImpl::PackageImpl::processPackage_(
deleteTempFolder(sModFolder);
}
that->addToConfigmgrIni(schema, url_replaced, xCmdEnv);
+ data.iniEntry = dp_misc::makeRcTerm(url_replaced);
that->addDataToDb(url2, data);
}
that->m_registeredPackages->erase(i->first);
}
- ::ucbhelper::Content(
- makeURL( that->getCachePath(), OUSTR("registry") ),
- xCmdEnv ).executeCommand(
- OUSTR("delete"), Any( true /* delete physically */ ) );
+ try
+ {
+ ::ucbhelper::Content(
+ makeURL( that->getCachePath(), OUSTR("registry") ),
+ xCmdEnv ).executeCommand(
+ OUSTR("delete"), Any( true /* delete physically */ ) );
+ }
+ catch(Exception&)
+ {
+ OSL_ASSERT(0);
+ }
+ }
+ url = that->deleteDataFromDb(url);
+ if (!m_isSchema) {
+ com::sun::star::configuration::Update::get(
+ that->m_xComponentContext)->removeExtensionXcuFile(
+ expandUnoRcUrl(url));
}
- that->deleteDataFromDb(getURL());
-
- //TODO: revoking at runtime, possible, sensible?
}
}
diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
index 8665ef16a2..3dc4528972 100644
--- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_package.cxx,v $
- * $Revision: 1.34.16.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
index 8e685660ca..6d6d3a2d0b 100644
--- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
+++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_backend.h,v $
- * $Revision: 1.18 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index 643553ad92..92c0a912db 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -129,7 +129,9 @@ public:
virtual Reference<deployment::XPackage> SAL_CALL bindPackage(
OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
- throw (deployment::DeploymentException, CommandFailedException,
+ throw (deployment::DeploymentException,
+ deployment::InvalidRemovedParameterException,
+ CommandFailedException,
lang::IllegalArgumentException, RuntimeException);
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
@@ -461,7 +463,8 @@ void PackageRegistryImpl::update() throw (RuntimeException)
Reference<deployment::XPackage> PackageRegistryImpl::bindPackage(
OUString const & url, OUString const & mediaType_, sal_Bool bRemoved,
OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
- throw (deployment::DeploymentException, CommandFailedException,
+ throw (deployment::DeploymentException, deployment::InvalidRemovedParameterException,
+ CommandFailedException,
lang::IllegalArgumentException, RuntimeException)
{
check();
diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx
index 90f0384067..67ffc0f719 100644
--- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_package.cxx,v $
- * $Revision: 1.34.16.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx
index 29f8f89dd6..ddb3a29447 100644
--- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx
+++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_backend.h,v $
- * $Revision: 1.18 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 60dd5c414e..b267c34bb8 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -80,6 +80,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
+ bool extensionContainsCompiledHelp();
public:
PackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -100,7 +101,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<XCommandEnvironment> const & xCmdEnv );
void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage,
- Reference<ucb::XCommandEnvironment> const & xCmdEnv);
+ bool compiledHelp, Reference<ucb::XCommandEnvironment> const & xCmdEnv);
void implCollectXhpFiles( const rtl::OUString& aDir,
std::vector< rtl::OUString >& o_rXhpFileVector );
@@ -259,6 +260,57 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
return pBackend;
}
+
+bool BackendImpl::PackageImpl::extensionContainsCompiledHelp()
+{
+ bool bCompiled = true;
+ rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl(getURL());
+
+ ::osl::Directory helpFolder(aExpandedHelpURL);
+ if ( helpFolder.open() == ::osl::File::E_None)
+ {
+ //iterate over the contents of the help folder
+ //We assume that all folders withing the help folder contain language specific
+ //help files. If just one of them does not contain compiled help then this
+ //function returns false.
+ ::osl::DirectoryItem item;
+ ::osl::File::RC errorNext = ::osl::File::E_None;
+ while ((errorNext = helpFolder.getNextItem(item)) == ::osl::File::E_None)
+ {
+ //No find the language folders
+ ::osl::FileStatus stat(FileStatusMask_Type | FileStatusMask_FileName |FileStatusMask_FileURL);
+ if (item.getFileStatus(stat) == ::osl::File::E_None)
+ {
+ if (stat.getFileType() != ::osl::FileStatus::Directory)
+ continue;
+
+ //look if there is the folder help.idxl in the language folder
+ OUString compUrl(stat.getFileURL() + OUSTR("/help.idxl"));
+ ::osl::Directory compiledFolder(compUrl);
+ if (compiledFolder.open() != ::osl::File::E_None)
+ {
+ bCompiled = false;
+ break;
+ }
+ }
+ else
+ {
+ //Error
+ OSL_ASSERT(0);
+ bCompiled = false;
+ break;
+ }
+ }
+ if (errorNext != ::osl::File::E_NOENT
+ && errorNext != ::osl::File::E_None)
+ {
+ //Error
+ OSL_ASSERT(0);
+ bCompiled = false;
+ }
+ }
+ return bCompiled;
+}
//______________________________________________________________________________
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
@@ -289,7 +341,8 @@ void BackendImpl::PackageImpl::processPackage_(
BackendImpl* that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
- that->implProcessHelp( xThisPackage, doRegisterPackage, xCmdEnv);
+ that->implProcessHelp( xThisPackage, doRegisterPackage,
+ extensionContainsCompiledHelp(), xCmdEnv);
}
beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL()
@@ -316,213 +369,220 @@ static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) );
void BackendImpl::implProcessHelp
-( Reference< deployment::XPackage > xPackage, bool doRegisterPackage,
+( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, bool compiledHelp,
Reference<ucb::XCommandEnvironment> const & xCmdEnv)
{
OSL_ASSERT(xPackage.is());
if (doRegisterPackage)
{
HelpBackendDb::Data data;
- const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
- data.dataUrl = sHelpFolder;
-
- Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
- rtl::OUString aHelpURL = xPackage->getURL();
- rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
- rtl::OUString aName = xPackage->getName();
- if( !xSFA->isFolder( aExpandedHelpURL ) )
+
+ if (compiledHelp)
{
- rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR );
- aErrStr += rtl::OUString::createFromAscii( "No help folder" );
- OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
- throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ data.dataUrl = xPackage->getURL();
}
-
- Reference<XComponentContext> const & xContext = getComponentContext();
- Reference< script::XInvocation > xInvocation;
- if( xContext.is() )
+ else
{
- try
+ const OUString sHelpFolder = createFolder(OUString(), xCmdEnv);
+ data.dataUrl = sHelpFolder;
+
+ Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess();
+ rtl::OUString aHelpURL = xPackage->getURL();
+ rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL );
+ rtl::OUString aName = xPackage->getName();
+ if( !xSFA->isFolder( aExpandedHelpURL ) )
{
- xInvocation = Reference< script::XInvocation >(
- xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
- "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
+ rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR );
+ aErrStr += rtl::OUString::createFromAscii( "No help folder" );
+ OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
+ throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
}
- catch (Exception &)
+
+ Reference<XComponentContext> const & xContext = getComponentContext();
+ Reference< script::XInvocation > xInvocation;
+ if( xContext.is() )
{
- // i98680: Survive missing lucene
+ try
+ {
+ xInvocation = Reference< script::XInvocation >(
+ xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii(
+ "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY );
+ }
+ catch (Exception &)
+ {
+ // i98680: Survive missing lucene
+ }
}
- }
- // Scan languages
- Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true );
- sal_Int32 nLangCount = aLanguageFolderSeq.getLength();
- const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray();
- for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang )
- {
- rtl::OUString aLangURL = pSeq[iLang];
- if( xSFA->isFolder( aLangURL ) )
+ // Scan languages
+ Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true );
+ sal_Int32 nLangCount = aLanguageFolderSeq.getLength();
+ const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray();
+ for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang )
{
- std::vector< rtl::OUString > aXhpFileVector;
-
- // calculate jar file URL
- sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/');
- // for example "/en"
- OUString langFolderURLSegment(
- aLangURL.copy(
- indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1));
-
- //create the folder in the "temporary folder"
- ::ucbhelper::Content langFolderContent;
- const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment);
- const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest);
- ::dp_misc::create_folder(
- &langFolderContent,
- langFolderDest, xCmdEnv);
+ rtl::OUString aLangURL = pSeq[iLang];
+ if( xSFA->isFolder( aLangURL ) )
+ {
+ std::vector< rtl::OUString > aXhpFileVector;
+
+ // calculate jar file URL
+ sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/');
+ // for example "/en"
+ OUString langFolderURLSegment(
+ aLangURL.copy(
+ indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1));
+
+ //create the folder in the "temporary folder"
+ ::ucbhelper::Content langFolderContent;
+ const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment);
+ const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest);
+ ::dp_misc::create_folder(
+ &langFolderContent,
+ langFolderDest, xCmdEnv);
- rtl::OUString aJarFile(
- makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr +
- OUSTR(".jar")));
- aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile);
+ rtl::OUString aJarFile(
+ makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr +
+ OUSTR(".jar")));
+ aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile);
- rtl::OUString aEncodedJarFilePath = rtl::Uri::encode(
- aJarFile, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 );
- rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" );
- aDestBasePath += aEncodedJarFilePath;
- aDestBasePath += rtl::OUString::createFromAscii( "/" );
-
- sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1;
-
- Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true );
- sal_Int32 nSubLangCount = aSubLangSeq.getLength();
- const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray();
- for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang )
- {
- rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang];
- if( !xSFA->isFolder( aSubFolderURL ) )
- continue;
+ rtl::OUString aEncodedJarFilePath = rtl::Uri::encode(
+ aJarFile, rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" );
+ aDestBasePath += aEncodedJarFilePath;
+ aDestBasePath += rtl::OUString::createFromAscii( "/" );
+
+ sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1;
+
+ Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true );
+ sal_Int32 nSubLangCount = aSubLangSeq.getLength();
+ const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray();
+ for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang )
+ {
+ rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang];
+ if( !xSFA->isFolder( aSubFolderURL ) )
+ continue;
- implCollectXhpFiles( aSubFolderURL, aXhpFileVector );
+ implCollectXhpFiles( aSubFolderURL, aXhpFileVector );
- // Copy to package (later: move?)
- rtl::OUString aDestPath = aDestBasePath;
- rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL );
- aDestPath += aPureFolderName;
- xSFA->copy( aSubFolderURL, aDestPath );
- }
-
- // Call compiler
- sal_Int32 nXhpFileCount = aXhpFileVector.size();
- rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount];
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
- {
- rtl::OUString aXhpFile = aXhpFileVector[iXhp];
- rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
- pXhpFiles[iXhp] = aXhpRelFile;
- }
+ // Copy to package (later: move?)
+ rtl::OUString aDestPath = aDestBasePath;
+ rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL );
+ aDestPath += aPureFolderName;
+ xSFA->copy( aSubFolderURL, aDestPath );
+ }
- rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
- rtl::OUString aOfficeHelpPathFileURL;
- ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
+ // Call compiler
+ sal_Int32 nXhpFileCount = aXhpFileVector.size();
+ rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount];
+ for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
+ {
+ rtl::OUString aXhpFile = aXhpFileVector[iXhp];
+ rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL );
+ pXhpFiles[iXhp] = aXhpRelFile;
+ }
- HelpProcessingErrorInfo aErrorInfo;
- bool bSuccess = compileExtensionHelp(
- aOfficeHelpPathFileURL, aHelpStr, aLangURL,
- nXhpFileCount, pXhpFiles,
- langFolderDestExpanded, aErrorInfo );
+ rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() );
+ rtl::OUString aOfficeHelpPathFileURL;
+ ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL );
- if( bSuccess && xInvocation.is() )
- {
- Sequence<uno::Any> aParamsSeq( 6 );
-
- aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) );
-
- rtl::OUString aLang;
- sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
- if( nLastSlash != -1 )
- aLang = aLangURL.copy( nLastSlash + 1 );
- else
- aLang = rtl::OUString::createFromAscii( "en" );
- aParamsSeq[1] = uno::makeAny( aLang );
-
- aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) );
- aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) );
-
- aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) );
- rtl::OUString aSystemPath;
- osl::FileBase::getSystemPathFromFileURL(
- langFolderDestExpanded, aSystemPath );
- aParamsSeq[5] = uno::makeAny( aSystemPath );
-
- Sequence< sal_Int16 > aOutParamIndex;
- Sequence< uno::Any > aOutParam;
- uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ),
- aParamsSeq, aOutParamIndex, aOutParam );
- }
+ HelpProcessingErrorInfo aErrorInfo;
+ bool bSuccess = compileExtensionHelp(
+ aOfficeHelpPathFileURL, aHelpStr, aLangURL,
+ nXhpFileCount, pXhpFiles,
+ langFolderDestExpanded, aErrorInfo );
- if( !bSuccess )
- {
- USHORT nErrStrId = 0;
- switch( aErrorInfo.m_eErrorClass )
+ if( bSuccess && xInvocation.is() )
{
- case HELPPROCESSING_GENERAL_ERROR:
- case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
- case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
- default: ;
- };
-
- rtl::OUString aErrStr;
- if( nErrStrId != 0 )
+ Sequence<uno::Any> aParamsSeq( 6 );
+
+ aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) );
+
+ rtl::OUString aLang;
+ sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' );
+ if( nLastSlash != -1 )
+ aLang = aLangURL.copy( nLastSlash + 1 );
+ else
+ aLang = rtl::OUString::createFromAscii( "en" );
+ aParamsSeq[1] = uno::makeAny( aLang );
+
+ aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) );
+ aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) );
+
+ aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) );
+ rtl::OUString aSystemPath;
+ osl::FileBase::getSystemPathFromFileURL(
+ langFolderDestExpanded, aSystemPath );
+ aParamsSeq[5] = uno::makeAny( aSystemPath );
+
+ Sequence< sal_Int16 > aOutParamIndex;
+ Sequence< uno::Any > aOutParam;
+ uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ),
+ aParamsSeq, aOutParamIndex, aOutParam );
+ }
+
+ if( !bSuccess )
{
- aErrStr = getResourceString( nErrStrId );
-
- // Remoce CR/LF
- rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg );
- sal_Unicode nCR = 13, nLF = 10;
- sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
- sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
- sal_Int32 nCopy;
- if( nSearchCR != -1 || nSearchLF != -1 )
+ USHORT nErrStrId = 0;
+ switch( aErrorInfo.m_eErrorClass )
{
- if( nSearchCR == -1 )
- nCopy = nSearchLF;
- else if( nSearchLF == -1 )
- nCopy = nSearchCR;
- else
- nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF;
-
- aErrMsg = aErrMsg.copy( 0, nCopy );
- }
- aErrStr += aErrMsg;
- if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() )
+ case HELPPROCESSING_GENERAL_ERROR:
+ case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break;
+ case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break;
+ default: ;
+ };
+
+ rtl::OUString aErrStr;
+ if( nErrStrId != 0 )
{
- aErrStr += rtl::OUString::createFromAscii( " in " );
-
- rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
- rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- aErrStr += aDecodedFile;
- if( aErrorInfo.m_nXMLParsingLine != -1 )
+ aErrStr = getResourceString( nErrStrId );
+
+ // Remoce CR/LF
+ rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg );
+ sal_Unicode nCR = 13, nLF = 10;
+ sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
+ sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
+ sal_Int32 nCopy;
+ if( nSearchCR != -1 || nSearchLF != -1 )
{
- aErrStr += rtl::OUString::createFromAscii( ", line " );
- aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine );
+ if( nSearchCR == -1 )
+ nCopy = nSearchLF;
+ else if( nSearchLF == -1 )
+ nCopy = nSearchCR;
+ else
+ nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF;
+
+ aErrMsg = aErrMsg.copy( 0, nCopy );
+ }
+ aErrStr += aErrMsg;
+ if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() )
+ {
+ aErrStr += rtl::OUString::createFromAscii( " in " );
+
+ rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile,
+ rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ aErrStr += aDecodedFile;
+ if( aErrorInfo.m_nXMLParsingLine != -1 )
+ {
+ aErrStr += rtl::OUString::createFromAscii( ", line " );
+ aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine );
+ }
}
}
- }
- OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
- throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
- makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ OWeakObject* oWeakThis = static_cast<OWeakObject *>(this);
+ throw deployment::DeploymentException( rtl::OUString(), oWeakThis,
+ makeAny( uno::Exception( aErrStr, oWeakThis ) ) );
+ }
}
}
}
-
//Writing the data entry replaces writing the flag file. If we got to this
//point the registration was successful.
addDataToDb(xPackage->getURL(), data);
- }
+ } //if (doRegisterPackage)
else
{
deleteDataFromDb(xPackage->getURL());
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
index cadddf82ec..c6a4fe91cb 100644
--- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_package.cxx,v $
- * $Revision: 1.34.16.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
index a0468767fe..4fe99bd93b 100644
--- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
+++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_backend.h,v $
- * $Revision: 1.18 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 649f85c8db..6209aad0d0 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -866,14 +866,10 @@ void BackendImpl::PackageImpl::processPackage_(
try {
xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv );
}
- catch (RuntimeException &) {
- throw;
- }
- catch (ucb::CommandAbortedException &) {
- throw;
- }
- catch (Exception &) {
- // CommandFailedException, DeploymentException:
+ catch (Exception &)
+ {
+ //We even try a rollback if the user cancelled the action (CommandAbortedException)
+ //in order to prevent invalid database entries.
Any exc( ::cppu::getCaughtException() );
// try to handle exception, notify:
bool approve = false, abort = false;
@@ -904,14 +900,8 @@ void BackendImpl::PackageImpl::processPackage_(
bundle[ pos ]->revokePackage(
xSubAbortChannel, xCmdEnv );
}
- catch (RuntimeException &) {
- throw;
- }
- catch (ucb::CommandAbortedException &) {
- throw;
- }
- catch (Exception &) {
- // bundle rollback error:
+ catch (Exception &)
+ {
OSL_ENSURE( 0, ::rtl::OUStringToOString(
::comphelper::anyToString(
::cppu::getCaughtException() ),
diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx
index d8e47eecb4..6e732ccd58 100644
--- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx
+++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_package.cxx,v $
- * $Revision: 1.34.16.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
index 6b6d4d364c..e09e721b27 100644
--- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
+++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: dp_backend.h,v $
- * $Revision: 1.18 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/migration/services/cexports.cxx b/desktop/source/migration/services/cexports.cxx
index a5b9bc8aab..8424917d7a 100644
--- a/desktop/source/migration/services/cexports.cxx
+++ b/desktop/source/migration/services/cexports.cxx
@@ -63,13 +63,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, entries );
-}
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/desktop/source/migration/services/cexportsoo3.cxx b/desktop/source/migration/services/cexportsoo3.cxx
index b33d78966f..10ab816900 100755..100644
--- a/desktop/source/migration/services/cexportsoo3.cxx
+++ b/desktop/source/migration/services/cexportsoo3.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: cexports.cxx,v $
- * $Revision: 1.9 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -54,13 +51,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, entries );
-}
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk
index 2f3eb9308e..38f97084b3 100644
--- a/desktop/source/migration/services/makefile.mk
+++ b/desktop/source/migration/services/makefile.mk
@@ -87,7 +87,7 @@ DEF1NAME=$(SHL1TARGET)
COMP2TYPELIST = migrationoo3
SHL2TARGET=migrationoo3.uno
-SHL2VERSIONMAP = migrationoo3.map
+SHL2VERSIONMAP = $(SOLARENV)/src/component.map
SHL2OBJS= \
$(SLO)$/cexportsoo3.obj \
@@ -117,3 +117,18 @@ DEF2NAME=$(SHL2TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/migrationoo3.component
+
+$(MISC)/migrationoo3.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt migrationoo3.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt migrationoo3.component
+
+ALLTAR : $(MISC)/migrationoo2.component
+
+$(MISC)/migrationoo2.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt migrationoo2.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt migrationoo2.component
diff --git a/desktop/source/migration/services/migrationoo2.component b/desktop/source/migration/services/migrationoo2.component
new file mode 100644
index 0000000000..2b21ab123b
--- /dev/null
+++ b/desktop/source/migration/services/migrationoo2.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.desktop.migration.Basic">
+ <service name="com.sun.star.migration.Basic"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.desktop.migration.Wordbooks">
+ <service name="com.sun.star.migration.Wordbooks"/>
+ </implementation>
+</component>
diff --git a/desktop/source/migration/services/migrationoo3.component b/desktop/source/migration/services/migrationoo3.component
new file mode 100644
index 0000000000..380c389ab7
--- /dev/null
+++ b/desktop/source/migration/services/migrationoo3.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.desktop.migration.OOo3Extensions">
+ <service name="com.sun.star.migration.Extensions"/>
+ </implementation>
+</component>
diff --git a/desktop/source/migration/services/migrationoo3.map b/desktop/source/migration/services/migrationoo3.map
deleted file mode 100755
index ac2c3750bf..0000000000
--- a/desktop/source/migration/services/migrationoo3.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 578dda0c1b..a481857f91 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -1,14 +1,11 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: extensionmigration.cxx,v $
- * $Revision: 1.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx
index 124bc1b250..721a1bd704 100644
--- a/desktop/source/migration/services/oo3extensionmigration.hxx
+++ b/desktop/source/migration/services/oo3extensionmigration.hxx
@@ -1,14 +1,11 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: extensionmigration.hxx,v $
- * $Revision: 1.2 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx
index 17d445a1ad..4275de98b8 100644
--- a/desktop/source/offacc/acceptor.cxx
+++ b/desktop/source/offacc/acceptor.cxx
@@ -317,23 +317,6 @@ component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, u
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-sal_Bool SAL_CALL
-component_writeInfo(void *pServiceManager, void *pRegistryKey)
-{
- Reference< XMultiServiceFactory > xMan(reinterpret_cast< XMultiServiceFactory* >(pServiceManager));
- Reference< XRegistryKey > xKey(reinterpret_cast< XRegistryKey* >(pRegistryKey));
-
- // register service
- ::rtl::OUString aTempStr;
- ::rtl::OUString aImpl(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += Acceptor::impl_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- Reference< XRegistryKey > xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(Acceptor::impl_getSupportedServiceNames()[0]);
-
- return sal_True;
-}
-
void * SAL_CALL
component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void *)
{
diff --git a/desktop/source/offacc/makefile.mk b/desktop/source/offacc/makefile.mk
index c2d53930b5..809c28414b 100644
--- a/desktop/source/offacc/makefile.mk
+++ b/desktop/source/offacc/makefile.mk
@@ -60,3 +60,11 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/offacc.component
+
+$(MISC)/offacc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ offacc.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt offacc.component
diff --git a/desktop/source/offacc/offacc.component b/desktop/source/offacc/offacc.component
new file mode 100644
index 0000000000..6f0d4a97a2
--- /dev/null
+++ b/desktop/source/offacc/offacc.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.office.comp.Acceptor">
+ <service name="com.sun.star.office.Acceptor"/>
+ </implementation>
+</component>
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 4b7b112e53..278a07b8c8 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -39,6 +39,7 @@
#include "osl/thread.h"
#include "osl/process.h"
#include "osl/conditn.hxx"
+#include "osl/file.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "comphelper/anytostring.hxx"
@@ -377,6 +378,29 @@ extern "C" int unopkg_main()
if (e != osl_File_E_None && e != osl_File_E_NOENT)
throw Exception(OUSTR("Could not delete ") + extensionUnorc, 0);
}
+ else if (subCommand.equals(OUSTR("sync")))
+ {
+ //sync is private!!!! Only for bundled extensions!!!
+ //For performance reasons unopkg sync is called during the setup and
+ //creates the registration data for the repository of the bundled
+ //extensions. It is then copied to the user installation during
+ //startup of OOo (userdata/extensions/bundled). The registration
+ //data is in the brand installation and must be removed when
+ //uninstalling OOo. We do this here, before UNO is
+ //bootstrapped. Otherwies files could be locked by this process.
+
+ //If there is no folder left in
+ //$BRAND_BASE_DIR/share/extensions
+ //then we can delete the registration data at
+ //$BUNDLED_EXTENSIONS_USER
+ if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions")))
+ {
+ removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER"));
+ //return otherwise we create the registration data again
+ return 0;
+ }
+
+ }
xComponentContext = getUNO(
disposeGuard, option_verbose, option_shared, subcmd_gui,
@@ -587,6 +611,15 @@ extern "C" int unopkg_main()
xDialog->startExecuteModal(xListener);
dialogEnded.wait();
}
+ else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("sync")))
+ {
+ //This sub command may be removed later and is only there to have a
+ //possibility to start extension synching without any output.
+ //This is just here so we do not get an error, because of an unknown
+ //sub-command. We do synching before
+ //the sub-commands are processed.
+
+ }
else
{
dp_misc::writeConsoleError(
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 5ecf18d651..ec4bab433a 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -528,5 +528,110 @@ Reference<XComponentContext> getUNO(
return xComponentContext;
}
+//Determines if a folder does not contains a folder.
+//Return false may also mean that the status could not be determined
+//because some error occurred.
+bool hasNoFolder(OUString const & folderUrl)
+{
+ bool ret = false;
+ OUString url = folderUrl;
+ ::rtl::Bootstrap::expandMacros(url);
+ ::osl::Directory dir(url);
+ osl::File::RC rc = dir.open();
+ if (rc == osl::File::E_None)
+ {
+ bool bFolderExist = false;
+ osl::DirectoryItem i;
+ osl::File::RC rcNext = osl::File::E_None;
+ while ( (rcNext = dir.getNextItem(i)) == osl::File::E_None)
+ {
+ osl::FileStatus stat(FileStatusMask_Type);
+ if (i.getFileStatus(stat) == osl::File::E_None)
+ {
+ if (stat.getFileType() == osl::FileStatus::Directory)
+ {
+ bFolderExist = true;
+ break;
+ }
+ }
+ else
+ {
+ dp_misc::writeConsole(
+ OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n"));
+ break;
+ }
+ i = osl::DirectoryItem();
+ }
+
+ if (rcNext == osl::File::E_NOENT ||
+ rcNext == osl::File::E_None)
+ {
+ if (!bFolderExist)
+ ret = true;
+ }
+ else
+ {
+ dp_misc::writeConsole(
+ OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n"));
+ }
+
+ dir.close();
+ }
+ else
+ {
+ dp_misc::writeConsole(
+ OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n"));
+ }
+ return ret;
}
+void removeFolder(OUString const & folderUrl)
+{
+ OUString url = folderUrl;
+ ::rtl::Bootstrap::expandMacros(url);
+ ::osl::Directory dir(url);
+ ::osl::File::RC rc = dir.open();
+ if (rc == osl::File::E_None)
+ {
+ ::osl::DirectoryItem i;
+ ::osl::File::RC rcNext = ::osl::File::E_None;
+ while ( (rcNext = dir.getNextItem(i)) == ::osl::File::E_None)
+ {
+ ::osl::FileStatus stat(FileStatusMask_Type | FileStatusMask_FileURL);
+ if (i.getFileStatus(stat) == ::osl::File::E_None)
+ {
+ ::osl::FileStatus::Type t = stat.getFileType();
+ if (t == ::osl::FileStatus::Directory)
+ {
+ //remove folder
+ removeFolder(stat.getFileURL());
+ }
+ else if (t == ::osl::FileStatus::Regular)
+ {
+ //remove file
+ ::osl::File::remove(stat.getFileURL());
+ }
+ else
+ {
+ OSL_ASSERT(0);
+ }
+ }
+ else
+ {
+ dp_misc::writeConsole(
+ OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n"));
+ break;
+ }
+ i = ::osl::DirectoryItem();
+ }
+ dir.close();
+ ::osl::Directory::remove(url);
+ }
+ else
+ {
+ dp_misc::writeConsole(
+ OUSTR("unopkg: Error while removing ") + url + OUSTR("\n"));
+ }
+}
+
+}
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 8898e42d27..5af217ef41 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -178,5 +178,11 @@ css::uno::Reference<css::uno::XComponentContext> getUNO(
DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui,
css::uno::Reference<css::uno::XComponentContext> & out_LocalComponentContext);
+bool hasNoFolder(::rtl::OUString const & folderUrl);
+
+void removeFolder(::rtl::OUString const & folderUrl);
+
}
+
+
diff --git a/desktop/source/registration/com/sun/star/registration/Registration.java b/desktop/source/registration/com/sun/star/registration/Registration.java
index 6ac22c7c39..cb64b3de64 100644
--- a/desktop/source/registration/com/sun/star/registration/Registration.java
+++ b/desktop/source/registration/com/sun/star/registration/Registration.java
@@ -63,10 +63,6 @@ public class Registration {
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return FactoryHelper.writeRegistryServiceInfo(Registration.class.getName(), _serviceName, regKey);
- }
-
static final String _serviceName = "com.sun.star.comp.framework.DoRegistrationJob";
static public class _Registration implements XJob {
diff --git a/desktop/source/registration/com/sun/star/registration/makefile.mk b/desktop/source/registration/com/sun/star/registration/makefile.mk
index 9784166eb9..8598022562 100644
--- a/desktop/source/registration/com/sun/star/registration/makefile.mk
+++ b/desktop/source/registration/com/sun/star/registration/makefile.mk
@@ -53,3 +53,10 @@ CUSTOMMANIFESTFILE = manifest
.INCLUDE : target.mk
+ALLTAR : $(MISC)/productregistration.jar.component
+
+$(MISC)/productregistration.jar.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt productregistration.jar.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)productregistration.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt productregistration.jar.component
diff --git a/desktop/source/registration/com/sun/star/registration/productregistration.jar.component b/desktop/source/registration/com/sun/star/registration/productregistration.jar.component
new file mode 100644
index 0000000000..c022a98ae0
--- /dev/null
+++ b/desktop/source/registration/com/sun/star/registration/productregistration.jar.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.registration.Registration">
+ <service name="com.sun.star.comp.framework.DoRegistrationJob"/>
+ </implementation>
+</component>
diff --git a/desktop/source/so_comp/makefile.mk b/desktop/source/so_comp/makefile.mk
index 590f99518c..7f9ceb4b64 100644
--- a/desktop/source/so_comp/makefile.mk
+++ b/desktop/source/so_comp/makefile.mk
@@ -75,3 +75,10 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
+ALLTAR : $(MISC)/socomp.component
+
+$(MISC)/socomp.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ socomp.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt socomp.component
diff --git a/desktop/source/so_comp/services.cxx b/desktop/source/so_comp/services.cxx
index 8955b4f0e8..8a5e561444 100644
--- a/desktop/source/so_comp/services.cxx
+++ b/desktop/source/so_comp/services.cxx
@@ -100,32 +100,6 @@ component_getImplementationEnvironment(
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-sal_Bool SAL_CALL
-component_writeInfo(
- void* pServiceManager,
- void* pRegistryKey)
-{
- Reference<XMultiServiceFactory> xMan(
- reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
- Reference<XRegistryKey> xKey(
- reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ;
-
- // iterate over service names and register them...
- OUString aImpl;
- const char* pServiceName = NULL;
- const char* pImplName = NULL;
- for (int i = 0; (pServices[i]!=NULL)&&(pImplementations[i]!=NULL); i++) {
- pServiceName= pServices[i];
- pImplName = pImplementations[i];
- aImpl = OUString::createFromAscii("/")
- + OUString::createFromAscii(pImplName)
- + OUString::createFromAscii("/UNO/SERVICES");
- Reference<XRegistryKey> xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(OUString::createFromAscii(pServiceName));
- }
- return sal_True;
-}
-
void* SAL_CALL
component_getFactory(
const sal_Char* pImplementationName,
diff --git a/desktop/source/so_comp/socomp.component b/desktop/source/so_comp/socomp.component
new file mode 100644
index 0000000000..a53035223c
--- /dev/null
+++ b/desktop/source/so_comp/socomp.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.desktop.Evaluation">
+ <service name="com.sun.star.office.Evaluation"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.desktop.OEMPreloadJob">
+ <service name="com.sun.star.office.OEMPreloadJob"/>
+ </implementation>
+</component>
diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk
index 8960968743..02483aae83 100644
--- a/desktop/source/splash/makefile.mk
+++ b/desktop/source/splash/makefile.mk
@@ -87,3 +87,11 @@ DO_PHONY=.PHONY
$(INCCOM)$/introbmpnames.hxx $(DO_PHONY):
echo const char INTRO_BITMAP_STRINGLIST[]=$(EMQ)"$(INTRO_BITMAPS:f:t",")$(EMQ)"$(EMQ); > $@
echo LASTTIME_INTRO_BITMAPS=$(INTRO_BITMAPS:f) > $(MISC)$/intro_bmp_names.mk
+
+ALLTAR : $(MISC)/spl.component
+
+$(MISC)/spl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ spl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt spl.component
diff --git a/desktop/source/splash/services_spl.cxx b/desktop/source/splash/services_spl.cxx
index fb96ec83e9..ff5469ac30 100755
--- a/desktop/source/splash/services_spl.cxx
+++ b/desktop/source/splash/services_spl.cxx
@@ -97,32 +97,6 @@ component_getImplementationEnvironment(
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-sal_Bool SAL_CALL
-component_writeInfo(
- void* pServiceManager,
- void* pRegistryKey)
-{
- Reference<XMultiServiceFactory> xMan(
- reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
- Reference<XRegistryKey> xKey(
- reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ;
-
- // iterate over service names and register them...
- OUString aImpl;
- const char* pServiceName = NULL;
- const char* pImplName = NULL;
- for (int i = 0; (pServices[i]!=NULL)&&(pImplementations[i]!=NULL); i++) {
- pServiceName= pServices[i];
- pImplName = pImplementations[i];
- aImpl = OUString::createFromAscii("/")
- + OUString::createFromAscii(pImplName)
- + OUString::createFromAscii("/UNO/SERVICES");
- Reference<XRegistryKey> xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(OUString::createFromAscii(pServiceName));
- }
- return sal_True;
-}
-
void* SAL_CALL
component_getFactory(
const sal_Char* pImplementationName,
diff --git a/desktop/source/splash/spl.component b/desktop/source/splash/spl.component
new file mode 100644
index 0000000000..2caecf5c0e
--- /dev/null
+++ b/desktop/source/splash/spl.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.desktop.FirstStart">
+ <service name="com.sun.star.task.Job"/>
+ </implementation>
+ <implementation name="com.sun.star.office.comp.SplashScreen">
+ <service name="com.sun.star.office.SplashScreen"/>
+ </implementation>
+</component>
diff --git a/desktop/test/deployment/boxt/makefile.mk b/desktop/test/deployment/boxt/makefile.mk
index 63f123fcc6..11d736448d 100644
--- a/desktop/test/deployment/boxt/makefile.mk
+++ b/desktop/test/deployment/boxt/makefile.mk
@@ -33,11 +33,9 @@ ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
.INCLUDE: rtlbootstrap.mk
+.INCLUDE: versionlist.mk
-#TODO: The underlying OOo base version needed here is currently only available
-# as instsetoo_native/util/openoffice.lst OOOBASEVERSION, so hard-coding it here
-# for now (see issue 110653):
-my_version = 3.3
+my_version = $(OOOBASEVERSIONMAJOR).$(OOOBASEVERSIONMINOR)
DLLPRE =
diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc
index f149ec6474..8bc39767f0 100644
--- a/desktop/util/ooverinfo2.rc
+++ b/desktop/util/ooverinfo2.rc
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -25,26 +25,26 @@
*
*************************************************************************/
-#define VERSION 3
-#define SUBVERSION 2
-//#define VERVARIANT 0
+#define VERSION 3
+#define SUBVERSION 3
+//#define VERVARIANT 0
// .0 + VER_CONCEPT
// .100 + VER_ALPHA
// .200 + VER_BETA
// .300 + VER_GAMMA
// .500 + VER_FINAL
-//#define VER_CONCEPT 0
-//#define VER_BETA 6
-#define VER_FINAL 0
+//#define VER_CONCEPT 0
+//#define VER_BETA 6
+#define VER_FINAL 0
-#define VER_DAY 1
-#define VER_MONTH 9
-#define VER_YEAR 2009
+#define VER_DAY 1
+#define VER_MONTH 1
+#define VER_YEAR 2010
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
-// language/character set specification table
+// language/character set specification table
// -----------------------------------------------------------------------
diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc
index 038953f2aa..7d589956ec 100644..100755
--- a/desktop/util/verinfo.rc
+++ b/desktop/util/verinfo.rc
@@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo
block "040704E4"
{
// German StringTable
- value "CompanyName", "Oracle, Inc.\0"
+ value "CompanyName", "Oracle\0"
value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0"
value "FileVersion", PPS(VER_LEVEL) "\0"
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", "SOFFICE.EXE\0"
value "InternalName", "SOFFICE\0"
- value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0"
}
#else
block "040904E4"
{
// International StringTable
- value "CompanyName", "Oracle, Inc.\0"
+ value "CompanyName", "Oracle\0"
value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0"
value "FileVersion", PPS(VER_LEVEL) "\0"
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", "SOFFICE.EXE\0"
value "InternalName", "SOFFICE\0"
- value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0"
}
#endif
}
diff --git a/desktop/win32/source/applauncher/ooo/verinfo.rc b/desktop/win32/source/applauncher/ooo/verinfo.rc
index ce698ba803..c13e723527 100644..100755
--- a/desktop/win32/source/applauncher/ooo/verinfo.rc
+++ b/desktop/win32/source/applauncher/ooo/verinfo.rc
@@ -69,7 +69,7 @@ VS_VERSION_INFO versioninfo
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0"
value "InternalName", PPS(RES_APP_NAME) "\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0"
}
#else
block "040904E4"
@@ -81,7 +81,7 @@ VS_VERSION_INFO versioninfo
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0"
value "InternalName", PPS(RES_APP_NAME) "\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0"
}
#endif
}
diff --git a/desktop/win32/source/applauncher/verinfo.rc b/desktop/win32/source/applauncher/verinfo.rc
index 0db55c58c4..c0ff714940 100644..100755
--- a/desktop/win32/source/applauncher/verinfo.rc
+++ b/desktop/win32/source/applauncher/verinfo.rc
@@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo
block "040704E4"
{
// German StringTable
- value "CompanyName", "Sun Microsystems, Inc.\0"
+ value "CompanyName", "Oracle\0"
value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0"
value "FileVersion", PPS(VER_LEVEL) "\0"
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0"
value "InternalName", PPS(RES_APP_NAME) "\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0"
}
#else
block "040904E4"
{
// International StringTable
- value "CompanyName", "Sun Microsystems, Inc.\0"
+ value "CompanyName", "Oracle\0"
value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0"
value "FileVersion", PPS(VER_LEVEL) "\0"
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0"
value "InternalName", PPS(RES_APP_NAME) "\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0"
}
#endif
}
diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx
index a1a352ecb9..42a152e6c4 100644
--- a/desktop/win32/source/officeloader/officeloader.cxx
+++ b/desktop/win32/source/officeloader/officeloader.cxx
@@ -339,6 +339,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
p = desktop_win32::commandLineAppend(p, argv[i]);
}
}
+
p = desktop_win32::commandLineAppend(
p, MY_STRING(L"\" \"-env:OOO_CWD="));
if (cwdLen == 0) {
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
new file mode 100644
index 0000000000..19646d4822
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// DiscreteShadowPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** DiscreteShadow data class
+
+ */
+ class DiscreteShadow
+ {
+ private:
+ /// the original shadow BitmapEx in a special form
+ BitmapEx maBitmapEx;
+
+ /// buffered extracted parts of CombinedShadow for easier usage
+ BitmapEx maTopLeft;
+ BitmapEx maTop;
+ BitmapEx maTopRight;
+ BitmapEx maRight;
+ BitmapEx maBottomRight;
+ BitmapEx maBottom;
+ BitmapEx maBottomLeft;
+ BitmapEx maLeft;
+
+ public:
+ /// constructor
+ DiscreteShadow(const BitmapEx& rBitmapEx);
+
+ /// data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+
+ /// compare operator
+ bool operator==(const DiscreteShadow& rCompare) const
+ {
+ return getBitmapEx() == rCompare.getBitmapEx();
+ }
+
+ /// helper accesses which create on-demand needed segments
+ const BitmapEx& getTopLeft() const;
+ const BitmapEx& getTop() const;
+ const BitmapEx& getTopRight() const;
+ const BitmapEx& getRight() const;
+ const BitmapEx& getBottomRight() const;
+ const BitmapEx& getBottom() const;
+ const BitmapEx& getBottomLeft() const;
+ const BitmapEx& getLeft() const;
+ };
+
+ /** DiscreteShadowPrimitive2D class
+
+ */
+ class DiscreteShadowPrimitive2D : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ // the object transformation of the rectangular object
+ basegfx::B2DHomMatrix maTransform;
+
+ // the bitmap shadow data
+ DiscreteShadow maDiscreteShadow;
+
+ protected:
+ /// create local decomposition
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ DiscreteShadowPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const DiscreteShadow& rDiscreteShadow);
+
+ /// data read access
+ const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
+ const DiscreteShadow& getDiscreteShadow() const { return maDiscreteShadow; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ 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_QUADRATICSHADOWPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index a0ef94d02d..7f1c929a6e 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -93,14 +93,16 @@
#define PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
-#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
-#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
-#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
-#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
-#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
-#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
-#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
-#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
+#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)
+#define PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 61)
+#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 62)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index e863e47a3b..54f087d317 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -16,6 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\borderlineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\borderlineprimitive2d.hxx
..\inc\drawinglayer\primitive2d\chartprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\chartprimitive2d.hxx
..\inc\drawinglayer\primitive2d\controlprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\controlprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\discretebitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\discretebitmapprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\discreteshadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\discreteshadowprimitive2d.hxx
..\inc\drawinglayer\primitive2d\embedded3dprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\embedded3dprimitive2d.hxx
..\inc\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx
..\inc\drawinglayer\primitive2d\fillgradientprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillgradientprimitive2d.hxx
diff --git a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
new file mode 100644
index 0000000000..17578b5e52
--- /dev/null
+++ b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
@@ -0,0 +1,339 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ DiscreteShadow::DiscreteShadow(const BitmapEx& rBitmapEx)
+ : maBitmapEx(rBitmapEx),
+ maTopLeft(),
+ maTop(),
+ maTopRight(),
+ maRight(),
+ maBottomRight(),
+ maBottom(),
+ maBottomLeft(),
+ maLeft()
+ {
+ const Size& rBitmapSize = getBitmapEx().GetSizePixel();
+
+ if(rBitmapSize.Width() != rBitmapSize.Height() || rBitmapSize.Width() < 7)
+ {
+ OSL_ENSURE(false, "DiscreteShadowPrimitive2D: wrong bitmap format (!)");
+ maBitmapEx = BitmapEx();
+ }
+ }
+
+ const BitmapEx& DiscreteShadow::getTopLeft() const
+ {
+ if(maTopLeft.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maTopLeft.Crop(
+ Rectangle(Point(0,0),Size(nQuarter*2+1,nQuarter*2+1)));
+ }
+
+ return maTopLeft;
+ }
+
+ const BitmapEx& DiscreteShadow::getTop() const
+ {
+ if(maTop.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maTop = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maTop.Crop(
+ Rectangle(Point(nQuarter*2+1,0),Size(1,nQuarter+1)));
+ }
+
+ return maTop;
+ }
+
+ const BitmapEx& DiscreteShadow::getTopRight() const
+ {
+ if(maTopRight.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maTopRight = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maTopRight.Crop(
+ Rectangle(Point(nQuarter*2+2,0),Size(nQuarter*2+1,nQuarter*2+1)));
+ }
+
+ return maTopRight;
+ }
+
+ const BitmapEx& DiscreteShadow::getRight() const
+ {
+ if(maRight.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maRight = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maRight.Crop(
+ Rectangle(Point(nQuarter*3+2,nQuarter*2+1),Size(nQuarter+1,1)));
+ }
+
+ return maRight;
+ }
+
+ const BitmapEx& DiscreteShadow::getBottomRight() const
+ {
+ if(maBottomRight.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maBottomRight.Crop(
+ Rectangle(Point(nQuarter*2+2,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1)));
+ }
+
+ return maBottomRight;
+ }
+
+ const BitmapEx& DiscreteShadow::getBottom() const
+ {
+ if(maBottom.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maBottom = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maBottom.Crop(
+ Rectangle(Point(nQuarter*2+1,nQuarter*3+2),Size(1,nQuarter+1)));
+ }
+
+ return maBottom;
+ }
+
+ const BitmapEx& DiscreteShadow::getBottomLeft() const
+ {
+ if(maBottomLeft.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maBottomLeft.Crop(
+ Rectangle(Point(0,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1)));
+ }
+
+ return maBottomLeft;
+ }
+
+ const BitmapEx& DiscreteShadow::getLeft() const
+ {
+ if(maLeft.IsEmpty())
+ {
+ const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const_cast< DiscreteShadow* >(this)->maLeft = getBitmapEx();
+ const_cast< DiscreteShadow* >(this)->maLeft.Crop(
+ Rectangle(Point(0,nQuarter*2+1),Size(nQuarter+1,1)));
+ }
+
+ return maLeft;
+ }
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DSequence DiscreteShadowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ Primitive2DSequence xRetval;
+
+ if(!getDiscreteShadow().getBitmapEx().IsEmpty())
+ {
+ const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const basegfx::B2DVector aScale(getTransform() * basegfx::B2DVector(1.0, 1.0));
+ const double fSingleX(getDiscreteUnit() / aScale.getX());
+ const double fSingleY(getDiscreteUnit() / aScale.getY());
+ const double fBorderX(fSingleX * nQuarter);
+ const double fBorderY(fSingleY * nQuarter);
+ const double fBigLenX((fBorderX * 2.0) + fSingleX);
+ const double fBigLenY((fBorderY * 2.0) + fSingleY);
+
+ xRetval.realloc(8);
+
+ // TopLeft
+ xRetval[0] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getTopLeft(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ fBigLenX,
+ fBigLenY,
+ -fBorderX,
+ -fBorderY)));
+
+ // Top
+ xRetval[1] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getTop(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ 1.0 - (2.0 * fBorderX) - fSingleX,
+ fBorderY + fSingleY,
+ fBorderX + fSingleX,
+ -fBorderY)));
+
+ // TopRight
+ xRetval[2] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getTopRight(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ fBigLenX,
+ fBigLenY,
+ 1.0 - fBorderX,
+ -fBorderY)));
+
+ // Right
+ xRetval[3] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getRight(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ fBorderX + fSingleX,
+ 1.0 - (2.0 * fBorderY) - fSingleY,
+ 1.0,
+ fBorderY + fSingleY)));
+
+ // BottomRight
+ xRetval[4] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getBottomRight(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ fBigLenX,
+ fBigLenY,
+ 1.0 - fBorderX,
+ 1.0 - fBorderY)));
+
+ // Bottom
+ xRetval[5] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getBottom(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ 1.0 - (2.0 * fBorderX) - fSingleX,
+ fBorderY + fSingleY,
+ fBorderX + fSingleX,
+ 1.0)));
+
+ // BottomLeft
+ xRetval[6] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getBottomLeft(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ fBigLenX,
+ fBigLenY,
+ -fBorderX,
+ 1.0 - fBorderY)));
+
+ // Left
+ xRetval[7] = Primitive2DReference(
+ new BitmapPrimitive2D(
+ getDiscreteShadow().getLeft(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ fBorderX + fSingleX,
+ 1.0 - (2.0 * fBorderY) - fSingleY,
+ -fBorderX,
+ fBorderY + fSingleY)));
+
+ // put all in object transformation to get to target positions
+ const Primitive2DReference xTransformed(
+ new TransformPrimitive2D(
+ getTransform(),
+ xRetval));
+
+ xRetval = Primitive2DSequence(&xTransformed, 1);
+ }
+
+ return xRetval;
+ }
+
+ DiscreteShadowPrimitive2D::DiscreteShadowPrimitive2D(
+ const basegfx::B2DHomMatrix& rTransform,
+ const DiscreteShadow& rDiscreteShadow)
+ : DiscreteMetricDependentPrimitive2D(),
+ maTransform(rTransform),
+ maDiscreteShadow(rDiscreteShadow)
+ {
+ }
+
+ bool DiscreteShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
+ {
+ const DiscreteShadowPrimitive2D& rCompare = (DiscreteShadowPrimitive2D&)rPrimitive;
+
+ return (getTransform() == rCompare.getTransform()
+ && getDiscreteShadow() == rCompare.getDiscreteShadow());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange DiscreteShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(getDiscreteShadow().getBitmapEx().IsEmpty())
+ {
+ // no graphics without valid bitmap definition
+ return basegfx::B2DRange();
+ }
+ else
+ {
+ // prepare normal objectrange
+ basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ aRetval.transform(getTransform());
+
+ // extract discrete shadow size and grow
+ const basegfx::B2DVector aScale(rViewInformation.getViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+ const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2);
+ const double fGrowX((1.0 / aScale.getX()) * nQuarter);
+ const double fGrowY((1.0 / aScale.getY()) * nQuarter);
+ aRetval.grow(std::max(fGrowX, fGrowY));
+
+ return aRetval;
+ }
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(DiscreteShadowPrimitive2D, PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk
index bca5805ae6..720769a0ef 100644
--- a/drawinglayer/source/primitive2d/makefile.mk
+++ b/drawinglayer/source/primitive2d/makefile.mk
@@ -46,6 +46,7 @@ SLOFILES= \
$(SLO)$/chartprimitive2d.obj \
$(SLO)$/controlprimitive2d.obj \
$(SLO)$/discretebitmapprimitive2d.obj \
+ $(SLO)$/discreteshadowprimitive2d.obj \
$(SLO)$/embedded3dprimitive2d.obj \
$(SLO)$/epsprimitive2d.obj \
$(SLO)$/fillbitmapprimitive2d.obj \
diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
index 48a26413df..13c0c17070 100644
--- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
@@ -85,9 +85,13 @@ namespace drawinglayer
}
// prepare dest coor
+ const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
+ const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectPixel(
- basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
- basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()),
+ nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
+ nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
// paint it using GraphicManager
Graphic aGraphic(rBitmapEx);
@@ -106,9 +110,13 @@ namespace drawinglayer
// prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less
basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
aOutlineRange.transform(rTransform);
+ const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
+ const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectPixel(
- basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
- basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()),
+ nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
+ nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
// decompose matrix to check for shear, rotate and mirroring
basegfx::B2DVector aScale, aTranslate;
@@ -145,9 +153,13 @@ namespace drawinglayer
// process self with free transformation (containing shear and rotate). Get dest rect in pixels.
basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
aOutlineRange.transform(rTransform);
+ const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
+ const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectLogic(
- basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()),
- basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY()));
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()),
+ nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
+ nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic));
// #i96708# check if Metafile is recorded
@@ -161,18 +173,19 @@ namespace drawinglayer
if(!aCroppedRectPixel.IsEmpty())
{
- // as maximum for destination, orientate at SourceSizePixel, but
+ // as maximum for destination, orientate at aOutputRectPixel, but
// take a rotation of 45 degrees (sqrt(2)) as maximum expansion into account
const Size aSourceSizePixel(rBitmapEx.GetSizePixel());
const double fMaximumArea(
- (double)aSourceSizePixel.getWidth() *
- (double)aSourceSizePixel.getHeight() *
+ (double)aOutputRectPixel.getWidth() *
+ (double)aOutputRectPixel.getHeight() *
1.4142136); // 1.4142136 taken as sqrt(2.0)
// test if discrete view size (pixel) maybe too big and limit it
const double fArea(aCroppedRectPixel.getWidth() * aCroppedRectPixel.getHeight());
const bool bNeedToReduce(fArea > fMaximumArea);
double fReduceFactor(1.0);
+ const Size aDestSizePixel(aCroppedRectPixel.GetSize());
if(bNeedToReduce)
{
@@ -219,11 +232,6 @@ namespace drawinglayer
if(bNeedToReduce)
{
// paint in target size
- const double fFactor(1.0 / fReduceFactor);
- const Size aDestSizePixel(
- basegfx::fround(aCroppedRectPixel.getWidth() * fFactor),
- basegfx::fround(aCroppedRectPixel.getHeight() * fFactor));
-
if(bRecordToMetaFile)
{
rOutDev.DrawBitmapEx(
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 01cfe2ff8b..27e9c40335 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1206,7 +1206,12 @@ namespace drawinglayer
mpOutputDevice->SetLineColor(Color(aHairlineColor));
mpOutputDevice->SetFillColor();
aHairLinePolyPolygon.transform(maCurrentTransformation);
- LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth()));
+
+ // #i113922# LineWidth needs to be transformed, too
+ const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(rLine.getWidth(), 0.0));
+ const double fDiscreteLineWidth(aDiscreteUnit.getLength());
+
+ LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fDiscreteLineWidth));
aLineInfo.SetLineJoin(rLine.getLineJoin());
for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
diff --git a/editeng/inc/editeng/unoipset.hxx b/editeng/inc/editeng/unoipset.hxx
index 22789ed959..3875ba82e0 100644
--- a/editeng/inc/editeng/unoipset.hxx
+++ b/editeng/inc/editeng/unoipset.hxx
@@ -64,6 +64,7 @@ public:
sal_Bool AreThereOwnUsrAnys() const { return (pCombiList ? sal_True : sal_False); }
::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const;
void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID);
+ void ClearAllUsrAny();
com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;}
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx
index 0e6ae868af..ca7d461114 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -266,10 +266,6 @@ EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAt
DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Kein Escapementattribut!" );
}
-#if defined( WIN ) && !defined( WNT )
-#pragma optimize ("", off)
-#endif
-
void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* )
{
USHORT nProp = ((const SvxEscapementItem*)GetItem())->GetProp();
@@ -283,11 +279,6 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* )
rFont.SetEscapement( nEsc );
}
-#if defined( WIN ) && !defined( WNT )
-#pragma optimize ("", on)
-#endif
-
-
// -------------------------------------------------------------------------
// class EditCharAttribOutline
// -------------------------------------------------------------------------
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index c892117d0b..decb2dda5a 100755
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1044,7 +1044,8 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
{
PopupMenu aPopupMenu( EditResId( RID_MENU_SPELL ) );
PopupMenu *pAutoMenu = aPopupMenu.GetPopupMenu( MN_AUTOCORR );
- PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT );
+ PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT ); // add word to user-dictionaries
+ pInsertMenu->SetMenuFlags( MENU_FLAG_NOAUTOMNEMONICS ); //! necessary to retrieve the correct dictionary names later
EditPaM aPaM2( aPaM );
aPaM2.GetIndex()++;
@@ -1261,7 +1262,12 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
}
else if ( nId >= MN_DICTSTART )
{
- Reference< XDictionary > xDic( pDic[nId - MN_DICTSTART], UNO_QUERY );
+ String aDicName ( pInsertMenu->GetItemText(nId) );
+
+ uno::Reference< linguistic2::XDictionary > xDic;
+ if (xDicList.is())
+ xDic = xDicList->getDictionaryByName( aDicName );
+
if (xDic.is())
xDic->add( aSelected, sal_False, String() );
// save modified user-dictionary if it is persistent
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 87bf077bb2..651b232848 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -43,7 +43,7 @@
#include <editeng/wghtitem.hxx>
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
-
+#include <tools/tenccvt.hxx>
#define ACTION_INSERTTEXT 1
#define ACTION_INSERTPARABRK 2
@@ -66,6 +66,16 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu
nNumberingLevel = 0;
bFieldsInserted = FALSE;
+ DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ), "EditHTMLParser::EditHTMLParser: Where does the encoding come from?" );
+ DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParser::::EditHTMLParser: Switch to UCS2?" );
+
+ // Altough the real default encoding is ISO8859-1, we use MS-1252
+ // als default encoding.
+ SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) );
+
+ // If the file starts with a BOM, switch to UCS2.
+ SetSwitchToUCS2( TRUE );
+
if ( pHTTPHeaderAttrs )
SetEncodingByHTTPHeader( pHTTPHeaderAttrs );
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 9c425bc07c..709475a219 100755
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -51,6 +51,7 @@
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
#include <i18npool/lang.h>
#include <vos/ref.hxx>
@@ -1002,6 +1003,8 @@ public:
void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow );
EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
+ short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets );
+
void SetAsianCompressionMode( USHORT n );
USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; }
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index e0e780c784..fedfb0d367 100755
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4209,18 +4209,8 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT
DBG_ERROR("svx::ImpEditEngine::GetXPos(), index out of range!");
}
-#if 0
+ // old code restored see #i112788 (which leaves #i74188 unfixed again)
long nPosInPortion = pLine->GetCharPosArray().GetObject( nPos );
-#else
- // #i74188# (positioning the cursor after deleting components of combined indic characters)
- SvxFont aTmpFont( pParaPortion->GetNode()->GetCharAttribs().GetDefFont() );
- SeekCursor( pParaPortion->GetNode(), nPos+1, aTmpFont );
- aTmpFont.SetPhysFont( GetRefDevice() );
- ImplInitDigitMode( GetRefDevice(), 0, 0, 0, aTmpFont.GetLanguage() );
- String sSegment(*pParaPortion->GetNode(), pLine->GetStart(), nPos+1);
- long nPosInPortion = aTmpFont.QuickGetTextSize( GetRefDevice(),
- sSegment, 0, nPos+1, NULL ).Width();
-#endif
if ( !pPortion->IsRightToLeft() )
{
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 6fc80acf06..e15b7e7d1c 100755
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -76,6 +76,9 @@
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <com/sun/star/linguistic2/XMeaning.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
+#include <com/sun/star/i18n/WordType.hpp>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/textsearch.hxx>
#include <comphelper/processfactory.hxx>
@@ -83,6 +86,8 @@
#include <svtools/rtfkeywd.hxx>
#include <editeng/edtdlg.hxx>
+#include <vector>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -1458,7 +1463,11 @@ Reference< XSpellChecker1 > ImpEditEngine::GetSpeller()
SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs )
{
- pSpellInfo = new SpellInfo;
+ if (!pSpellInfo)
+ pSpellInfo = new SpellInfo;
+ else
+ *pSpellInfo = SpellInfo(); // reset to default values
+
pSpellInfo->bMultipleDoc = bMultipleDocs;
EditSelection aSentenceSel( SelectSentence( rSel ) );
// pSpellInfo->aSpellStart = CreateEPaM( aSentenceSel.Min() );
@@ -2023,7 +2032,6 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView,
#else
bool bRet = false;
EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
- //the pSpellInfo has to be created on demand
if(!pSpellInfo)
pSpellInfo = CreateSpellInfo( aCurSel, true );
pSpellInfo->aCurSentenceStart = aCurSel.Min();
@@ -2191,8 +2199,12 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
{
#ifdef SVX_LIGHT
#else
+ // Note: rNewPortions.size() == 0 is valid and happens when the whole
+ // sentence got removed in the dialog
+
DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized");
- if(pSpellInfo)
+ if (pSpellInfo &&
+ pSpellInfo->aLastSpellPortions.size() > 0) // no portions -> no text to be changed
{
// get current paragraph length to calculate later on how the sentence length changed,
// in order to place the cursor at the end of the sentence again
@@ -2202,6 +2214,10 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
UndoActionStart( EDITUNDO_INSERT );
if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size())
{
+ DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
+ DBG_ASSERT( pSpellInfo->aLastSpellPortions.size() == pSpellInfo->aLastSpellContentSelections.size(),
+ "aLastSpellPortions and aLastSpellContentSelections size mismatch" );
+
//the simple case: the same number of elements on both sides
//each changed element has to be applied to the corresponding source element
svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
@@ -2252,6 +2268,8 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
}
else
{
+ DBG_ASSERT( pSpellInfo->aLastSpellContentSelections.size() > 0, "aLastSpellContentSelections should not be empty here" );
+
//select the complete sentence
SpellContentSelections::const_iterator aCurrentEndPosition = pSpellInfo->aLastSpellContentSelections.end();
--aCurrentEndPosition;
@@ -2798,8 +2816,23 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW
#endif // !SVX_LIGHT
}
+
+struct TransliterationChgData
+{
+ USHORT nStart;
+ xub_StrLen nLen;
+ EditSelection aSelection;
+ String aNewText;
+ uno::Sequence< sal_Int32 > aOffsets;
+};
+
+
EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode )
{
+ uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
+ if (!_xBI.is())
+ return rSelection;
+
EditSelection aSel( rSelection );
aSel.Adjust( aEditDoc );
@@ -2808,8 +2841,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
EditSelection aNewSel( aSel );
- USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ const USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ const USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
BOOL bChanges = FALSE;
BOOL bLenChanged = FALSE;
@@ -2832,83 +2865,266 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
USHORT nCurrentEnd = nEndPos;
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
- do
- {
- if ( bConsiderLanguage )
+ // since we don't use Hiragana/Katakana or half-width/full-width transliterations here
+ // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will
+ // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES
+ // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the
+ // proper thing to do.
+ const sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES;
+
+ //! In order to have less trouble with changing text size, e.g. because
+ //! of ligatures or � (German small sz) being resolved, we need to process
+ //! the text replacements from end to start.
+ //! This way the offsets for the yet to be changed words will be
+ //! left unchanged by the already replaced text.
+ //! For this we temporarily save the changes to be done in this vector
+ std::vector< TransliterationChgData > aChanges;
+ TransliterationChgData aChgData;
+
+ if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE)
+ {
+ // for 'capitalize every word' we need to iterate over each word
+
+ i18n::Boundary aSttBndry;
+ i18n::Boundary aEndBndry;
+ aSttBndry = _xBI->getWordBoundary(
+ *pNode, nStartPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ),
+ nWordType, TRUE /*prefer forward direction*/);
+ aEndBndry = _xBI->getWordBoundary(
+ *pNode, nEndPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ),
+ nWordType, FALSE /*prefer backward direction*/);
+
+ // prevent backtracking to the previous word if selection is at word boundary
+ if (aSttBndry.endPos <= nStartPos)
{
- nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd );
- if ( nCurrentEnd > nEndPos )
- nCurrentEnd = nEndPos;
+ aSttBndry = _xBI->nextWord(
+ *pNode, aSttBndry.endPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aSttBndry.endPos + 1 ) ) ),
+ nWordType);
+ }
+ // prevent advancing to the next word if selection is at word boundary
+ if (aEndBndry.startPos >= nEndPos)
+ {
+ aEndBndry = _xBI->previousWord(
+ *pNode, aEndBndry.startPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aEndBndry.startPos + 1 ) ) ),
+ nWordType);
}
- xub_StrLen nLen = nCurrentEnd - nCurrentStart;
+ i18n::Boundary aCurWordBndry( aSttBndry );
+ while (aCurWordBndry.startPos <= aEndBndry.startPos)
+ {
+ nCurrentStart = (xub_StrLen)aCurWordBndry.startPos;
+ nCurrentEnd = (xub_StrLen)aCurWordBndry.endPos;
+ sal_Int32 nLen = nCurrentEnd - nCurrentStart;
+ DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+#if OSL_DEBUG_LEVEL > 1
+ String aText( pNode->Copy( nCurrentStart, nLen ) );
+#endif
+
+ Sequence< sal_Int32 > aOffsets;
+ String aNewText( aTranslitarationWrapper.transliterate( *pNode,
+ GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
+ nCurrentStart, nLen, &aOffsets ));
+
+ if (!pNode->Equals( aNewText, nCurrentStart, nLen ))
+ {
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) );
+ aChgData.aNewText = aNewText;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
+ }
+#if OSL_DEBUG_LEVEL > 1
+ String aSelTxt ( GetSelected( aChgData.aSelection ) );
+ (void) aSelTxt;
+#endif
- Sequence <sal_Int32> aOffsets;
- String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) );
+ aCurWordBndry = _xBI->nextWord( *pNode, nCurrentEnd,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ),
+ nWordType);
+ }
+ DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" );
+ }
+ else if (nTransliterationMode == i18n::TransliterationModulesExtra::SENTENCE_CASE)
+ {
+ // for 'sentence case' we need to iterate sentence by sentence
+
+ sal_Int32 nLastStart = _xBI->beginOfSentence(
+ *pNode, nEndPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ) );
+ sal_Int32 nLastEnd = _xBI->endOfSentence(
+ *pNode, nLastStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ) );
+
+ // extend nCurrentStart, nCurrentEnd to the current sentence boundaries
+ nCurrentStart = _xBI->beginOfSentence(
+ *pNode, nStartPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ) );
+ nCurrentEnd = _xBI->endOfSentence(
+ *pNode, nCurrentStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) );
+
+ // prevent backtracking to the previous sentence if selection starts at end of a sentence
+ if (nCurrentEnd <= nStartPos)
+ {
+ // now nCurrentStart is probably located on a non-letter word. (unless we
+ // are in Asian text with no spaces...)
+ // Thus to get the real sentence start we should locate the next real word,
+ // that is one found by DICTIONARY_WORD
+ i18n::Boundary aBndry = _xBI->nextWord( *pNode, nCurrentEnd,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ),
+ i18n::WordType::DICTIONARY_WORD);
+
+ // now get new current sentence boundaries
+ nCurrentStart = _xBI->beginOfSentence(
+ *pNode, aBndry.startPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) );
+ nCurrentEnd = _xBI->endOfSentence(
+ *pNode, nCurrentStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) );
+ }
+ // prevent advancing to the next sentence if selection ends at start of a sentence
+ if (nLastStart >= nEndPos)
+ {
+ // now nCurrentStart is probably located on a non-letter word. (unless we
+ // are in Asian text with no spaces...)
+ // Thus to get the real sentence start we should locate the previous real word,
+ // that is one found by DICTIONARY_WORD
+ i18n::Boundary aBndry = _xBI->previousWord( *pNode, nLastStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ),
+ i18n::WordType::DICTIONARY_WORD);
+ nLastEnd = _xBI->endOfSentence(
+ *pNode, aBndry.startPos,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) );
+ if (nCurrentEnd > nLastEnd)
+ nCurrentEnd = nLastEnd;
+ }
- if( ( nLen != aNewText.Len() ) || !pNode->Equals( aNewText, nCurrentStart, nLen ) )
+ while (nCurrentStart < nLastEnd)
{
- bChanges = TRUE;
- if ( nLen != aNewText.Len() )
- bLenChanged = TRUE;
+ sal_Int32 nLen = nCurrentEnd - nCurrentStart;
+ DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+#if OSL_DEBUG_LEVEL > 1
+ String aText( pNode->Copy( nCurrentStart, nLen ) );
+#endif
-#ifndef SVX_LIGHT
- // Create UndoAction on Demand....
- if ( !pUndo && IsUndoEnabled() && !IsInUndo() )
- {
- ESelection aESel( CreateESel( aSel ) );
- pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode );
+ Sequence< sal_Int32 > aOffsets;
+ String aNewText( aTranslitarationWrapper.transliterate( *pNode,
+ GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
+ nCurrentStart, nLen, &aOffsets ));
- if ( ( nStartNode == nEndNode ) && !aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ) )
- pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) );
- else
- pUndo->SetText( CreateBinTextObject( aSel, NULL ) );
+ if (!pNode->Equals( aNewText, nCurrentStart, nLen ))
+ {
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) );
+ aChgData.aNewText = aNewText;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
}
-#endif
- // Change text without loosing the attributes
- USHORT nCharsAfterTransliteration =
- sal::static_int_cast< USHORT >(aOffsets.getLength());
- const sal_Int32* pOffsets = aOffsets.getConstArray();
- short nDiffs = 0;
- for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ )
+ i18n::Boundary aFirstWordBndry;
+ aFirstWordBndry = _xBI->nextWord(
+ *pNode, nCurrentEnd,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ),
+ nWordType);
+ nCurrentStart = aFirstWordBndry.startPos;
+ nCurrentEnd = _xBI->endOfSentence(
+ *pNode, nCurrentStart,
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) );
+ }
+ DBG_ASSERT( nCurrentEnd >= nLastEnd, "failed to reach end of transliteration" );
+ }
+ else
+ {
+ do
+ {
+ if ( bConsiderLanguage )
{
- USHORT nCurrentPos = nCurrentStart+n;
- sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n];
+ nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd );
+ if ( nCurrentEnd > nEndPos )
+ nCurrentEnd = nEndPos;
+ }
- if ( !nDiff )
- {
- DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
- pNode->SetChar( nCurrentPos, aNewText.GetChar(n) );
- }
- else if ( nDiff < 0 )
- {
- // Replace first char, delete the rest...
- DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
- pNode->SetChar( nCurrentPos, aNewText.GetChar(n) );
+ xub_StrLen nLen = nCurrentEnd - nCurrentStart;
- DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" );
- GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) );
- }
- else
- {
- DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." );
- GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), aNewText.GetChar(n) );
+ Sequence< sal_Int32 > aOffsets;
+ String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) );
- }
- nDiffs = sal::static_int_cast< short >(nDiffs + nDiff);
+ if (!pNode->Equals( aNewText, nCurrentStart, nLen ))
+ {
+ aChgData.nStart = nCurrentStart;
+ aChgData.nLen = nLen;
+ aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) );
+ aChgData.aNewText = aNewText;
+ aChgData.aOffsets = aOffsets;
+ aChanges.push_back( aChgData );
}
- if ( nNode == nEndNode )
- aNewSel.Max().GetIndex() =
- aNewSel.Max().GetIndex() + nDiffs;
+ nCurrentStart = nCurrentEnd;
+ } while( nCurrentEnd < nEndPos );
+ }
+
+ if (aChanges.size() > 0)
+ {
+#ifndef SVX_LIGHT
+ // Create a single UndoAction on Demand for all the changes ...
+ if ( !pUndo && IsUndoEnabled() && !IsInUndo() )
+ {
+ // adjust selection to include all changes
+ for (size_t i = 0; i < aChanges.size(); ++i)
+ {
+ const EditSelection &rSel = aChanges[i].aSelection;
+ if (aSel.Min().GetNode() == rSel.Min().GetNode() &&
+ aSel.Min().GetIndex() > rSel.Min().GetIndex())
+ aSel.Min().SetIndex( rSel.Min().GetIndex() );
+ if (aSel.Max().GetNode() == rSel.Max().GetNode() &&
+ aSel.Max().GetIndex() < rSel.Max().GetIndex())
+ aSel.Max().SetIndex( rSel.Max().GetIndex() );
+ }
+ aNewSel = aSel;
+
+ ESelection aESel( CreateESel( aSel ) );
+ pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode );
+
+ const bool bSingleNode = aSel.Min().GetNode()== aSel.Max().GetNode();
+ const bool bHasAttribs = aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() );
+ if (bSingleNode && !bHasAttribs)
+ pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) );
+ else
+ pUndo->SetText( CreateBinTextObject( aSel, NULL ) );
+ }
+#endif
+
+ // now apply the changes from end to start to leave the offsets of the
+ // yet unchanged text parts remain the same.
+ for (size_t i = 0; i < aChanges.size(); ++i)
+ {
+ const TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ];
- ParaPortion* pParaPortion = GetParaPortions()[nNode];
- pParaPortion->MarkSelectionInvalid( nCurrentStart, std::max< USHORT >( nCurrentStart+nLen, nCurrentStart+aNewText.Len() ) );
+ bChanges = TRUE;
+ if (rData.nLen != rData.aNewText.Len())
+ bLenChanged = TRUE;
+ // Change text without loosing the attributes
+ USHORT nDiffs = ReplaceTextOnly( rData.aSelection.Min().GetNode(),
+ rData.nStart, rData.nLen, rData.aNewText, rData.aOffsets );
+
+ // adjust selection in end node to possibly changed size
+ if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode())
+ aNewSel.Max().GetIndex() = aNewSel.Max().GetIndex() + nDiffs;
+
+ USHORT nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() );
+ ParaPortion* pParaPortion = GetParaPortions()[nSelNode];
+ pParaPortion->MarkSelectionInvalid( rData.nStart,
+ std::max< USHORT >( rData.nStart + rData.nLen,
+ rData.nStart + rData.aNewText.Len() ) );
}
- nCurrentStart = nCurrentEnd;
- } while( nCurrentEnd < nEndPos );
+ } // if (aChanges.size() > 0)
}
#ifndef SVX_LIGHT
@@ -2932,6 +3148,52 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
return aNewSel;
}
+
+short ImpEditEngine::ReplaceTextOnly(
+ ContentNode* pNode,
+ USHORT nCurrentStart, xub_StrLen nLen,
+ const String& rNewText,
+ const uno::Sequence< sal_Int32 >& rOffsets )
+{
+ (void) nLen;
+
+ // Change text without loosing the attributes
+ USHORT nCharsAfterTransliteration =
+ sal::static_int_cast< USHORT >(rOffsets.getLength());
+ const sal_Int32* pOffsets = rOffsets.getConstArray();
+ short nDiffs = 0;
+ for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ )
+ {
+ USHORT nCurrentPos = nCurrentStart+n;
+ sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n];
+
+ if ( !nDiff )
+ {
+ DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
+ pNode->SetChar( nCurrentPos, rNewText.GetChar(n) );
+ }
+ else if ( nDiff < 0 )
+ {
+ // Replace first char, delete the rest...
+ DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" );
+ pNode->SetChar( nCurrentPos, rNewText.GetChar(n) );
+
+ DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" );
+ GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) );
+ }
+ else
+ {
+ DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." );
+ GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), rNewText.GetChar(n) );
+
+ }
+ nDiffs = sal::static_int_cast< short >(nDiffs + nDiff);
+ }
+
+ return nDiffs;
+}
+
+
void ImpEditEngine::SetAsianCompressionMode( USHORT n )
{
if ( n != nAsianCompressionMode )
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 78edae142d..8eea009a4e 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1243,27 +1243,25 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt,
else if ( bIsNextRun && !IsAutoCorrectChar( cChar ) )
{
// Remove the NBSP if it wasn't an autocorrection
- if ( NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
+ if ( nInsPos != 0 && NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) &&
cChar != ' ' && cChar != '\t' && cChar != CHAR_HARDBLANK )
{
// Look for the last HARD_SPACE
xub_StrLen nPos = nInsPos - 1;
- bool bFound = false;
- while ( nPos != STRING_NOTFOUND && !bFound )
+ bool bContinue = true;
+ while ( bContinue )
{
- sal_Unicode cTmpChar = rTxt.GetChar( nPos );
+ const sal_Unicode cTmpChar = rTxt.GetChar( nPos );
if ( cTmpChar == CHAR_HARDBLANK )
- bFound = true;
- else if ( !NeedsHardspaceAutocorr( cTmpChar ) )
- nPos = STRING_NOTFOUND;
+ {
+ rDoc.Delete( nPos, nPos + 1 );
+ nRet = AddNonBrkSpace;
+ bContinue = false;
+ }
+ else if ( !NeedsHardspaceAutocorr( cTmpChar ) || nPos == 0 )
+ bContinue = false;
nPos--;
}
-
- if ( bFound && nPos != STRING_NOTFOUND )
- {
- rDoc.Delete( nPos + 1, nPos + 2 );
- nRet = AddNonBrkSpace;
- }
}
}
}
diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index e0440e424c..7f66d10d17 100644
--- a/editeng/source/misc/txtrange.cxx
+++ b/editeng/source/misc/txtrange.cxx
@@ -45,10 +45,6 @@
|*
*************************************************************************/
-#ifdef WIN
-#pragma optimize ( "", off )
-#endif
-
TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon,
USHORT nCacheSz, USHORT nLft, USHORT nRght, BOOL bSimpl, BOOL bInnr,
BOOL bVert ) :
@@ -97,10 +93,6 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const baseg
mpLinePolyPolygon = NULL;
}
-#ifdef WIN
-#pragma optimize ( "", on )
-#endif
-
/*************************************************************************
|*
|* TextRanger::~TextRanger()
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 7aefa78f98..60ef854c56 100644..100755
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -1197,7 +1197,10 @@ uno::Reference< XDictionary > LinguMgr::GetStandard()
// add new dictionary to list
if (xTmp.is())
+ {
xTmpDicList->addDictionary( xTmp );
+ xTmp->setActive( sal_True );
+ }
xDic = uno::Reference< XDictionary > ( xTmp, UNO_QUERY );
}
#if OSL_DEBUG_LEVEL > 1
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 879c2ef8bb..a6c30e9eb0 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -71,15 +71,7 @@ SvxItemPropertySet::SvxItemPropertySet( const SfxItemPropertyMapEntry* pMap, Sfx
//----------------------------------------------------------------------
SvxItemPropertySet::~SvxItemPropertySet()
{
-/*
- if(pItemPool)
- delete pItemPool;
- pItemPool = NULL;
-*/
-
- if(pCombiList)
- delete pCombiList;
- pCombiList = NULL;
+ ClearAllUsrAny();
}
//----------------------------------------------------------------------
@@ -111,6 +103,17 @@ void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID)
pCombiList->Insert(pNew);
}
+//----------------------------------------------------------------------
+
+void SvxItemPropertySet::ClearAllUsrAny()
+{
+ if(pCombiList)
+ delete pCombiList;
+ pCombiList = NULL;
+}
+
+//----------------------------------------------------------------------
+
sal_Bool SvxUnoCheckForPositiveValue( const uno::Any& rVal )
{
sal_Bool bConvert = sal_True; // the default is that all metric items must be converted
diff --git a/editeng/util/editeng.dxp b/editeng/util/editeng.dxp
index 9630d7e067..f0e1c69934 100644
--- a/editeng/util/editeng.dxp
+++ b/editeng/util/editeng.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/embeddedobj/prj/d.lst b/embeddedobj/prj/d.lst
index 6972174716..e85b439a1e 100644
--- a/embeddedobj/prj/d.lst
+++ b/embeddedobj/prj/d.lst
@@ -4,3 +4,5 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\dtd\*.dtd %_DEST%\bin%_EXT%\*.*
+..\%__SRC%\misc\embobj.component %_DEST%\xml%_EXT%\embobj.component
+..\%__SRC%\misc\emboleobj.component %_DEST%\xml%_EXT%\emboleobj.component
diff --git a/embeddedobj/source/commonembedding/register.cxx b/embeddedobj/source/commonembedding/register.cxx
index eb990c382f..ba6eadb25b 100644
--- a/embeddedobj/source/commonembedding/register.cxx
+++ b/embeddedobj/source/commonembedding/register.cxx
@@ -87,47 +87,5 @@ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServic
return pRet;
}
-sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- sal_Int32 nInd = 0;
- uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) );
-
- uno::Reference< registry::XRegistryKey > xNewKey;
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OOoEmbeddedObjectFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
- uno::Sequence< ::rtl::OUString > rServices = OOoEmbeddedObjectFactory::impl_staticGetSupportedServiceNames();
- for( nInd = 0; nInd < rServices.getLength(); nInd++ )
- xNewKey->createKey( rServices.getConstArray()[nInd] );
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- OOoSpecialEmbeddedObjectFactory::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
- rServices = OOoSpecialEmbeddedObjectFactory::impl_staticGetSupportedServiceNames();
- for( nInd = 0; nInd < rServices.getLength(); nInd++ )
- xNewKey->createKey( rServices.getConstArray()[nInd] );
-
- xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
- UNOEmbeddedObjectCreator::impl_staticGetImplementationName() +
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) );
- rServices = UNOEmbeddedObjectCreator::impl_staticGetSupportedServiceNames();
- for( nInd = 0; nInd < rServices.getLength(); nInd++ )
- xNewKey->createKey( rServices.getConstArray()[nInd] );
-
- return sal_True;
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
} // extern "C"
diff --git a/embeddedobj/source/msole/emboleobj.component b/embeddedobj/source/msole/emboleobj.component
new file mode 100644
index 0000000000..96f8ed0d8d
--- /dev/null
+++ b/embeddedobj/source/msole/emboleobj.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory">
+ <service name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"/>
+ <service name="com.sun.star.embed.OLEEmbeddedObjectFactory"/>
+ </implementation>
+</component>
diff --git a/embeddedobj/source/msole/emboleobj.windows.component b/embeddedobj/source/msole/emboleobj.windows.component
new file mode 100644
index 0000000000..644a1d4f19
--- /dev/null
+++ b/embeddedobj/source/msole/emboleobj.windows.component
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.MSOLEObjectSystemCreator">
+ <service name="com.sun.star.comp.embed.MSOLEObjectSystemCreator"/>
+ <service name="com.sun.star.embed.MSOLEObjectSystemCreator"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory">
+ <service name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"/>
+ <service name="com.sun.star.embed.OLEEmbeddedObjectFactory"/>
+ </implementation>
+</component>
diff --git a/embeddedobj/source/msole/exports.dxp b/embeddedobj/source/msole/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/embeddedobj/source/msole/exports.dxp
+++ b/embeddedobj/source/msole/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/embeddedobj/source/msole/makefile.mk b/embeddedobj/source/msole/makefile.mk
index 07b08bce69..f40e231bc2 100644
--- a/embeddedobj/source/msole/makefile.mk
+++ b/embeddedobj/source/msole/makefile.mk
@@ -130,3 +130,14 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/emboleobj.component
+
+.IF "$(OS)" == "WNT"
+my_platform = .windows
+.END
+
+$(MISC)/emboleobj.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ emboleobj.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt emboleobj$(my_platform).component
diff --git a/embeddedobj/util/embobj.component b/embeddedobj/util/embobj.component
new file mode 100644
index 0000000000..e46945dcb7
--- /dev/null
+++ b/embeddedobj/util/embobj.component
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.embed.EmbeddedObjectCreator">
+ <service name="com.sun.star.comp.embed.EmbeddedObjectCreator"/>
+ <service name="com.sun.star.embed.EmbeddedObjectCreator"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.OOoEmbeddedObjectFactory">
+ <service name="com.sun.star.comp.embed.OOoEmbeddedObjectFactory"/>
+ <service name="com.sun.star.embed.OOoEmbeddedObjectFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory">
+ <service name="com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory"/>
+ <service name="com.sun.star.embed.OOoSpecialEmbeddedObjectFactory"/>
+ </implementation>
+</component>
diff --git a/embeddedobj/util/exports.dxp b/embeddedobj/util/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/embeddedobj/util/exports.dxp
+++ b/embeddedobj/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/embeddedobj/util/makefile.mk b/embeddedobj/util/makefile.mk
index 763d64c164..eb2416bd4d 100644
--- a/embeddedobj/util/makefile.mk
+++ b/embeddedobj/util/makefile.mk
@@ -87,3 +87,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo CLEAR_THE_FILE > $@
@echo __CT >>$@
+
+ALLTAR : $(MISC)/embobj.component
+
+$(MISC)/embobj.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ embobj.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt embobj.component
diff --git a/eventattacher/prj/d.lst b/eventattacher/prj/d.lst
index 5f9f228eda..202a0a06ae 100644
--- a/eventattacher/prj/d.lst
+++ b/eventattacher/prj/d.lst
@@ -1,3 +1,4 @@
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%
+..\%__SRC%\misc\evtatt.component %_DEST%\xml%_EXT%\evtatt.component
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index a4182adb27..2100cbb615 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -842,34 +842,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * , void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- // DefaultRegistry
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/" IMPLNAME "/UNO/SERVICES") )));
-
- Sequence< OUString > aSNL
- ( ::comp_EventAttacher::EventAttacherImpl::getSupportedServiceNames_Static() );
- const OUString * pArray = aSNL.getConstArray();
- for ( sal_Int32 nPos = aSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/eventattacher/source/evtatt.component b/eventattacher/source/evtatt.component
new file mode 100644
index 0000000000..3e48d58893
--- /dev/null
+++ b/eventattacher/source/evtatt.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.EventAttacher">
+ <service name="com.sun.star.script.EventAttacher"/>
+ </implementation>
+</component>
diff --git a/eventattacher/source/makefile.mk b/eventattacher/source/makefile.mk
index 632a1fa41a..360dcdabd7 100644
--- a/eventattacher/source/makefile.mk
+++ b/eventattacher/source/makefile.mk
@@ -61,3 +61,11 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/evtatt.component
+
+$(MISC)/evtatt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ evtatt.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt evtatt.component
diff --git a/fileaccess/prj/d.lst b/fileaccess/prj/d.lst
index 695487c560..c9b2bdd18f 100644
--- a/fileaccess/prj/d.lst
+++ b/fileaccess/prj/d.lst
@@ -3,3 +3,4 @@
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*
..\source\fileacc.xml %_DEST%\xml%_EXT%\fileacc.xml
+..\%__SRC%\misc\fileacc.component %_DEST%\xml%_EXT%\fileacc.component
diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx
index c30c298ef0..77de990a71 100644
--- a/fileaccess/source/FileAccess.cxx
+++ b/fileaccess/source/FileAccess.cxx
@@ -914,32 +914,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
- rtl::OUString::createFromAscii("/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
- const Sequence< rtl::OUString > & rSNL = io_FileAccess::FileAccess_getSupportedServiceNames();
- const rtl::OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/fileaccess/source/fileacc.component b/fileaccess/source/fileacc.component
new file mode 100644
index 0000000000..3f14d40532
--- /dev/null
+++ b/fileaccess/source/fileacc.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.SimpleFileAccess">
+ <service name="com.sun.star.ucb.SimpleFileAccess"/>
+ </implementation>
+</component>
diff --git a/fileaccess/source/makefile.mk b/fileaccess/source/makefile.mk
index 2b78265346..8c8a91b0f6 100644
--- a/fileaccess/source/makefile.mk
+++ b/fileaccess/source/makefile.mk
@@ -66,3 +66,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/fileacc.component
+
+$(MISC)/fileacc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fileacc.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fileacc.component
diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx
index f9b04e012f..1593f710b4 100644
--- a/formula/inc/formula/errorcodes.hxx
+++ b/formula/inc/formula/errorcodes.hxx
@@ -64,7 +64,8 @@ const USHORT errInterpOverflow = 527;
// Not displayed, temporary for TrackFormulas,
// Cell depends on another cell that has errCircularReference
const USHORT errTrackFromCircRef = 528;
-// Interpreter internal: existing cell has no value but value queried
+// ScInterpreter internal: no numeric value but numeric queried. If this is
+// set as mnStringNoValueError no error is generated but 0 returned.
const USHORT errCellNoValue = 529;
// Interpreter: needed AddIn not found
const USHORT errNoAddin = 530;
@@ -74,6 +75,11 @@ const USHORT errNoMacro = 531;
const USHORT errDivisionByZero = 532; // #DIV/0!
// Compiler: a non-simple (str,err,val) value was put in an array
const USHORT errNestedArray = 533;
+// ScInterpreter internal: no numeric value but numeric queried. If this is
+// temporarily (!) set as mnStringNoValueError, the error is generated and can
+// be used to distinguish that condition from all other (inherited) errors. Do
+// not use for anything else! Never push or inherit the error otherwise!
+const USHORT errNotNumericString = 534;
// Interpreter: NA() not available condition, not a real error
const USHORT NOTAVAILABLE = 0x7fff;
diff --git a/formula/prj/d.lst b/formula/prj/d.lst
index 3ad1e39484..d2afebacf4 100644
--- a/formula/prj/d.lst
+++ b/formula/prj/d.lst
@@ -35,3 +35,4 @@ mkdir: %_DEST%\inc%_EXT%\formula
+..\%__SRC%\misc\for.component %_DEST%\xml%_EXT%\for.component
diff --git a/formula/source/core/api/services.cxx b/formula/source/core/api/services.cxx
index 39809ab9b6..b828953ac2 100644
--- a/formula/source/core/api/services.cxx
+++ b/formula/source/core/api/services.cxx
@@ -66,10 +66,4 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
*envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return cppu::component_writeInfoHelper(
- serviceManager, registryKey, entries);
-}
} // extern "C"
diff --git a/formula/util/for.component b/formula/util/for.component
new file mode 100644
index 0000000000..99a1adfbf9
--- /dev/null
+++ b/formula/util/for.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="simple.formula.FormulaOpCodeMapperObj">
+ <service name="com.sun.star.sheet.FormulaOpCodeMapper"/>
+ </implementation>
+</component>
diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk
index 7ae30b007d..3c6f91f607 100644
--- a/formula/util/makefile.mk
+++ b/formula/util/makefile.mk
@@ -136,3 +136,11 @@ RESLIB2SRSFILES=$(RES2FILELIST)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/for.component
+
+$(MISC)/for.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ for.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt for.component
diff --git a/fpicker/prj/d.lst b/fpicker/prj/d.lst
index 7c4e0bf602..4fff0467fc 100644
--- a/fpicker/prj/d.lst
+++ b/fpicker/prj/d.lst
@@ -9,6 +9,10 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid
..\source\win32\filepicker\*.xml %_DEST%\xml%_EXT%\*.xml
..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml
-..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt
-..\source\unx\kde4\fps-kde4-ucd.txt %_DEST%\bin%_EXT%\fps-kde4-ucd.txt
-..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt
+..\%__SRC%\misc\fop.component %_DEST%\xml%_EXT%\fop.component
+..\%__SRC%\misc\fpicker.component %_DEST%\xml%_EXT%\fpicker.component
+..\%__SRC%\misc\fps.component %_DEST%\xml%_EXT%\fps.component
+..\%__SRC%\misc\fps_aqua.component %_DEST%\xml%_EXT%\fps_aqua.component
+..\%__SRC%\misc\fps_gnome.component %_DEST%\xml%_EXT%\fps_gnome.component
+..\%__SRC%\misc\fps_kde4.component %_DEST%\xml%_EXT%\fps_kde4.component
+..\%__SRC%\misc\fps_office.component %_DEST%\xml%_EXT%\fps_office.component
diff --git a/fpicker/source/aqua/FPentry.cxx b/fpicker/source/aqua/FPentry.cxx
index d38c0a0a5a..1df58ce346 100644
--- a/fpicker/source/aqua/FPentry.cxx
+++ b/fpicker/source/aqua/FPentry.cxx
@@ -95,32 +95,6 @@ void SAL_CALL component_getImplementationEnvironment(
//
//------------------------------------------------
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
- pXNewKey->createKey( OUString::createFromAscii( FOLDER_PICKER_REGKEY_NAME ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
-//------------------------------------------------
-//
-//------------------------------------------------
-
void* SAL_CALL component_getFactory(
const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ )
{
diff --git a/fpicker/source/aqua/fps-aqua-ucd.txt b/fpicker/source/aqua/fps-aqua-ucd.txt
deleted file mode 100644
index d71e8f4a57..0000000000
--- a/fpicker/source/aqua/fps-aqua-ucd.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.ui.dialogs.SalAquaFilePicker
-ComponentName=fps_aqua.uno.dylib
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ui.dialogs.AquaFilePicker
-
-[ComponentDescriptor]
-ImplementationName=com.sun.star.ui.dialogs.SalAquaFolderPicker
-ComponentName=fps_aqua.uno.dylib
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ui.dialogs.AquaFolderPicker
diff --git a/fpicker/source/aqua/fps_aqua.component b/fpicker/source/aqua/fps_aqua.component
new file mode 100644
index 0000000000..a04443e37f
--- /dev/null
+++ b/fpicker/source/aqua/fps_aqua.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.ui.dialogs.SalAquaFilePicker">
+ <service name="com.sun.star.ui.dialogs.AquaFilePicker"/>
+ </implementation>
+ <implementation name="com.sun.star.ui.dialogs.SalAquaFolderPicker">
+ <service name="com.sun.star.ui.dialogs.AquaFolderPicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk
index 10990e22d5..ff0473c8a7 100644
--- a/fpicker/source/aqua/makefile.mk
+++ b/fpicker/source/aqua/makefile.mk
@@ -83,3 +83,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/fps_aqua.component
+
+$(MISC)/fps_aqua.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fps_aqua.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fps_aqua.component
diff --git a/fpicker/source/generic/fpicker.component b/fpicker/source/generic/fpicker.component
new file mode 100644
index 0000000000..7d44d006d9
--- /dev/null
+++ b/fpicker/source/generic/fpicker.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.fpicker.FilePicker">
+ <service name="com.sun.star.ui.dialogs.FilePicker"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.fpicker.FolderPicker">
+ <service name="com.sun.star.ui.dialogs.FolderPicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx
index 980c04513b..8654b13210 100644
--- a/fpicker/source/generic/fpicker.cxx
+++ b/fpicker/source/generic/fpicker.cxx
@@ -216,13 +216,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * pServiceManager, void * pRegistryKey)
-{
- return cppu::component_writeInfoHelper (
- pServiceManager, pRegistryKey, g_entries);
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
{
diff --git a/fpicker/source/generic/makefile.mk b/fpicker/source/generic/makefile.mk
index bfbfb65f3d..0b2ad77baa 100644
--- a/fpicker/source/generic/makefile.mk
+++ b/fpicker/source/generic/makefile.mk
@@ -60,3 +60,11 @@ DEF1NAME= $(SHL1TARGET)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/fpicker.component
+
+$(MISC)/fpicker.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fpicker.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fpicker.component
diff --git a/fpicker/source/office/fps_office.component b/fpicker/source/office/fps_office.component
new file mode 100644
index 0000000000..3e49f68a49
--- /dev/null
+++ b/fpicker/source/office/fps_office.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.svtools.OfficeFilePicker">
+ <service name="com.sun.star.ui.dialogs.OfficeFilePicker"/>
+ </implementation>
+ <implementation name="com.sun.star.svtools.OfficeFolderPicker">
+ <service name="com.sun.star.ui.dialogs.OfficeFolderPicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/source/office/fps_office.cxx b/fpicker/source/office/fps_office.cxx
index 13bc9dedc1..fd1743fa21 100644
--- a/fpicker/source/office/fps_office.cxx
+++ b/fpicker/source/office/fps_office.cxx
@@ -63,13 +63,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey)
-{
- return cppu::component_writeInfoHelper (
- pServiceManager, pRegistryKey, g_entries);
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
{
diff --git a/fpicker/source/office/makefile.mk b/fpicker/source/office/makefile.mk
index adc3c30f9a..7481fd867c 100644
--- a/fpicker/source/office/makefile.mk
+++ b/fpicker/source/office/makefile.mk
@@ -86,3 +86,11 @@ RESLIB1SRSFILES=\
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/fps_office.component
+
+$(MISC)/fps_office.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fps_office.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fps_office.component
diff --git a/fpicker/source/unx/gnome/FPentry.cxx b/fpicker/source/unx/gnome/FPentry.cxx
index 93097ff8d1..459d943abf 100644
--- a/fpicker/source/unx/gnome/FPentry.cxx
+++ b/fpicker/source/unx/gnome/FPentry.cxx
@@ -99,32 +99,6 @@ void SAL_CALL component_getImplementationEnvironment(
//
//------------------------------------------------
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
- pXNewKey->createKey( OUString::createFromAscii( FOLDER_PICKER_REGKEY_NAME ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
-//------------------------------------------------
-//
-//------------------------------------------------
-
void* SAL_CALL component_getFactory(
const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ )
{
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index 7bff368939..a80c707c1a 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -900,6 +900,9 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
{
static const OUString aStarDot = OUString::createFromAscii( "*." );
+ ::rtl::OUString aNewFilter;
+ ::rtl::OUString aOldFilter = getCurrentFilter();
+ sal_Bool bChangeFilter = sal_True;
for ( FilterList::iterator aListIter = m_pFilterList->begin();
aListIter != m_pFilterList->end();
++aListIter
@@ -907,11 +910,17 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
{
if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 )
{
- setCurrentFilter( aListIter->getTitle() );
+ if( !aNewFilter.getLength() )
+ aNewFilter = aListIter->getTitle();
+
+ if( aOldFilter == aListIter->getTitle() )
+ bChangeFilter = sal_False;
+
bExtensionTypedIn = true;
- break;
}
}
+ if( bChangeFilter )
+ setCurrentFilter( aNewFilter );
}
}
diff --git a/fpicker/source/unx/gnome/fps-gnome-ucd.txt b/fpicker/source/unx/gnome/fps-gnome-ucd.txt
deleted file mode 100644
index 4a84215dc9..0000000000
--- a/fpicker/source/unx/gnome/fps-gnome-ucd.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.ui.dialogs.SalGtkFilePicker
-ComponentName=fps_gnome.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ui.dialogs.GtkFilePicker
-
-[ComponentDescriptor]
-ImplementationName=com.sun.star.ui.dialogs.SalGtkFolderPicker
-ComponentName=fps_gnome.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ui.dialogs.GtkFolderPicker
diff --git a/fpicker/source/unx/gnome/fps_gnome.component b/fpicker/source/unx/gnome/fps_gnome.component
new file mode 100644
index 0000000000..72bca42f8a
--- /dev/null
+++ b/fpicker/source/unx/gnome/fps_gnome.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.ui.dialogs.SalGtkFilePicker">
+ <service name="com.sun.star.ui.dialogs.GtkFilePicker"/>
+ </implementation>
+ <implementation name="com.sun.star.ui.dialogs.SalGtkFolderPicker">
+ <service name="com.sun.star.ui.dialogs.GtkFolderPicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/source/unx/gnome/makefile.mk b/fpicker/source/unx/gnome/makefile.mk
index 04c6e650ff..82b2413dd4 100644
--- a/fpicker/source/unx/gnome/makefile.mk
+++ b/fpicker/source/unx/gnome/makefile.mk
@@ -96,3 +96,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/fps_gnome.component
+
+$(MISC)/fps_gnome.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fps_gnome.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fps_gnome.component
diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
index dfcb339452..c8425e5ce3 100644
--- a/fpicker/source/unx/kde4/KDE4FPEntry.cxx
+++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
@@ -55,27 +55,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey )
- {
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
- }
-
void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* )
{
void* pRet = 0;
diff --git a/fpicker/source/unx/kde4/fps-kde4-ucd.txt b/fpicker/source/unx/kde4/fps-kde4-ucd.txt
deleted file mode 100644
index 8ecc4e0a0a..0000000000
--- a/fpicker/source/unx/kde4/fps-kde4-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.ui.dialogs.KDE4FilePicker
-ComponentName=fps_kde4.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ui.dialogs.KDE4FilePicker
diff --git a/fpicker/source/unx/kde4/fps_kde4.component b/fpicker/source/unx/kde4/fps_kde4.component
new file mode 100644
index 0000000000..d627212b75
--- /dev/null
+++ b/fpicker/source/unx/kde4/fps_kde4.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.ui.dialogs.KDE4FilePicker">
+ <service name="com.sun.star.ui.dialogs.KDE4FilePicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/source/unx/kde4/makefile.mk b/fpicker/source/unx/kde4/makefile.mk
index e245e66184..7ccf6df6a0 100644
--- a/fpicker/source/unx/kde4/makefile.mk
+++ b/fpicker/source/unx/kde4/makefile.mk
@@ -80,3 +80,11 @@ DEF1VERSIONMAP=exports.map
$(MISC)$/KDE4FilePicker.moc.cxx : KDE4FilePicker.hxx
$(MOC4) $< -o $@
+
+ALLTAR : $(MISC)/fps_kde4.component
+
+$(MISC)/fps_kde4.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fps_kde4.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fps_kde4.component
diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx
index a99f467cce..0289b40d0e 100644
--- a/fpicker/source/win32/filepicker/FPentry.cxx
+++ b/fpicker/source/win32/filepicker/FPentry.cxx
@@ -104,31 +104,6 @@ void SAL_CALL component_getImplementationEnvironment(
//
//------------------------------------------------
-sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
-//------------------------------------------------
-//
-//------------------------------------------------
-
void* SAL_CALL component_getFactory(
const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* )
{
diff --git a/fpicker/source/win32/folderpicker/Fopentry.cxx b/fpicker/source/win32/folderpicker/Fopentry.cxx
index d379ca47a5..9c9574f13f 100644
--- a/fpicker/source/win32/folderpicker/Fopentry.cxx
+++ b/fpicker/source/win32/folderpicker/Fopentry.cxx
@@ -87,31 +87,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-----------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_REGKEY_NAME ) ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/fpicker/util/exports.dxp b/fpicker/util/exports.dxp
index 028ac41759..f0e1c69934 100644
--- a/fpicker/util/exports.dxp
+++ b/fpicker/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/fpicker/util/fop.component b/fpicker/util/fop.component
new file mode 100644
index 0000000000..a31c096dd4
--- /dev/null
+++ b/fpicker/util/fop.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.ui.dialogs.Win32FolderPicker">
+ <service name="com.sun.star.ui.dialogs.SystemFolderPicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/util/fps.component b/fpicker/util/fps.component
new file mode 100644
index 0000000000..cc18d21102
--- /dev/null
+++ b/fpicker/util/fps.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.ui.dialogs.Win32FilePicker">
+ <service name="com.sun.star.ui.dialogs.SystemFilePicker"/>
+ </implementation>
+</component>
diff --git a/fpicker/util/makefile.mk b/fpicker/util/makefile.mk
index c249e4259e..60bd3333cb 100644
--- a/fpicker/util/makefile.mk
+++ b/fpicker/util/makefile.mk
@@ -100,3 +100,16 @@ DEF2EXPORTFILE= exports.dxp
.INCLUDE : target.mk
+ALLTAR : $(MISC)/fop.component $(MISC)/fps.component
+
+$(MISC)/fop.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fop.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fop.component
+
+$(MISC)/fps.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fps.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fps.component
diff --git a/framework/inc/classes/framelistanalyzer.hxx b/framework/inc/classes/framelistanalyzer.hxx
index cabd25b2ad..77f7328b20 100644
--- a/framework/inc/classes/framelistanalyzer.hxx
+++ b/framework/inc/classes/framelistanalyzer.hxx
@@ -29,13 +29,6 @@
#define __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_
//_______________________________________________
-// my own includes
-
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/debug.hxx>
-#include <general.h>
-
-//_______________________________________________
// interface includes
#include <com/sun/star/frame/XFrame.hpp>
@@ -88,10 +81,10 @@ class FrameListAnalyzer
public:
/** provides access to the frame container, which should be analyzed. */
- const css::uno::Reference< css::frame::XFramesSupplier >& m_xSupplier;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& m_xSupplier;
/** hold the reference frame, which is used e.g. to detect other frames with the same model. */
- const css::uno::Reference< css::frame::XFrame >& m_xReferenceFrame;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& m_xReferenceFrame;
/** enable/disable some special analyzing steps.
see impl_analyze() for further informations. */
@@ -100,19 +93,19 @@ class FrameListAnalyzer
/** contains all frames, which uses the same model like the reference frame.
Will be filled only if m_eDetectMode has set the flag E_MODEL.
The reference frame is never part of this list! */
- css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lModelFrames;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lModelFrames;
/** contains all frames, which does not contain the same model like the reference frame.
Filling of it can't be supressed by m_eDetectMode.
The reference frame is never part of this list!
All frames inside this list are visible ones. */
- css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lOtherVisibleFrames;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherVisibleFrames;
/** contains all frames, which does not contain the same model like the reference frame.
Filling of it can't be supressed by m_eDetectMode.
The reference frame is never part of this list!
All frames inside this list are hidden ones. */
- css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lOtherHiddenFrames;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherHiddenFrames;
/** points to the help frame.
Will be set only, if any other frame (means different from the reference frame)
@@ -137,7 +130,7 @@ class FrameListAnalyzer
Analyzing of the help frame ignores the visible state of any frame.
But note: a hidden help frame indicates a wrong state!
*/
- css::uno::Reference< css::frame::XFrame > m_xHelp;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xHelp;
/** points to the frame, which contains the backing component.
Will be set only, if any other frame (means different from the reference frame)
@@ -163,7 +156,7 @@ class FrameListAnalyzer
Analyzing of the help frame ignores the visible state of any frame.
But note: a hidden backing mode frame indicates a wrong state!
*/
- css::uno::Reference< css::frame::XFrame > m_xBackingComponent;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBackingComponent;
/** is set to true only, if the reference frame is a hidden one.
This value is undefined if m_eDetectMode doesn't have set the flag E_HIDDEN! */
@@ -200,8 +193,8 @@ class FrameListAnalyzer
analyze steps. Note: Some member values will be undefined, if
an analyze step will be disabled.
*/
- FrameListAnalyzer( const css::uno::Reference< css::frame::XFramesSupplier >& xSupplier ,
- const css::uno::Reference< css::frame::XFrame >& xReferenceFrame ,
+ FrameListAnalyzer( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& xSupplier ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xReferenceFrame ,
sal_uInt32 eDetectMode );
virtual ~FrameListAnalyzer();
diff --git a/framework/inc/macros/debug/memorymeasure.hxx b/framework/inc/macros/debug/memorymeasure.hxx
index e4106a3fa8..4ed1603b62 100644
--- a/framework/inc/macros/debug/memorymeasure.hxx
+++ b/framework/inc/macros/debug/memorymeasure.hxx
@@ -37,7 +37,7 @@
#ifdef ENABLE_MEMORYMEASURE
- #if !defined( WIN ) && !defined( WNT )
+ #if !defined( WNT )
#error "Macros to measure memory access not available under platforms different from windows!"
#endif
diff --git a/framework/inc/macros/debug/registration.hxx b/framework/inc/macros/debug/registration.hxx
index 21f8ad20d3..9f7219c484 100644
--- a/framework/inc/macros/debug/registration.hxx
+++ b/framework/inc/macros/debug/registration.hxx
@@ -53,26 +53,6 @@
"registration.log"
#endif
- /*_____________________________________________________________________________________________________________
- LOG_REGISTRATION_WRITEINFO( SINFOTEXT )
-
- Write informations for component_writeInfo() in log file.
- _____________________________________________________________________________________________________________*/
-
- #define LOG_REGISTRATION_WRITEINFO( SINFOTEXT ) \
- { \
- ::rtl::OStringBuffer sOut( 1024 ); \
- sOut.append( "component_writeInfo():" ); \
- sOut.append( SINFOTEXT ); \
- WRITE_LOGFILE( LOGFILE_REGISTRATION, sOut.makeStringAndClear() ) \
- }
-
- /*_____________________________________________________________________________________________________________
- LOG_REGISTRATION_WRITEINFO( SINFOTEXT )
-
- Write informations for component_getFactory() in log file.
- _____________________________________________________________________________________________________________*/
-
#define LOG_REGISTRATION_GETFACTORY( SINFOTEXT ) \
{ \
::rtl::OStringBuffer sOut( 1024 ); \
@@ -88,7 +68,6 @@
_____________________________________________________________________________________________________________*/
#undef LOGFILE_REGISTRATION
- #define LOG_REGISTRATION_WRITEINFO( SINFOTEXT )
#define LOG_REGISTRATION_GETFACTORY( SINFOTEXT )
#endif // #ifdef ENABLE_REGISTRATIONDEBUG
diff --git a/framework/inc/macros/registration.hxx b/framework/inc/macros/registration.hxx
index 4b95530d45..de84e05dd6 100644
--- a/framework/inc/macros/registration.hxx
+++ b/framework/inc/macros/registration.hxx
@@ -37,10 +37,8 @@
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/registry/InvalidRegistryException.hpp>
//_________________________________________________________________________________________________________________
// other includes
@@ -57,67 +55,14 @@
macros for registration of services
Please use follow public macros only!
- 1) COMPONENTINFO( CLASS ) => use it as parameter for COMPONENT_WRITEINFO( INFOS )
- 2) IFFACTORY( CLASS ) => use it as parameter for COMPONENT_GETFACTORY( IFFACTORIES )
- 3) COMPONENTGETIMPLEMENTATIONENVIRONMENT => use it to define exported function component_getImplementationEnvironment()
- 4) COMPONENTWRITEINFO( INFOS ) => use it to define exported function component_writeInfo()
- 5) COMPONENTGETFACTORY( IFFACTORIES ) => use it to define exported function component_getFactory()
+ IFFACTORY( CLASS ) => use it as parameter for COMPONENT_GETFACTORY( IFFACTORIES )
+ COMPONENTGETIMPLEMENTATIONENVIRONMENT => use it to define exported function component_getImplementationEnvironment()
+ COMPONENTGETFACTORY( IFFACTORIES ) => use it to define exported function component_getFactory()
_________________________________________________________________________________________________________________*/
//*****************************************************************************************************************
// public
-// use it as parameter for COMPONENT_WRITEINFO( INFOS )
-//*****************************************************************************************************************
-
-#define COMPONENTINFO( CLASS ) \
- try \
- { \
- /* Set default result of follow operations !!! */ \
- bReturn = sal_False; \
- /* Do the follow only, if given key is valid ! */ \
- if ( xKey.is() == sal_True ) \
- { \
- LOG_REGISTRATION_WRITEINFO( "\t\t\txKey is valid ...\n" ) \
- /* Build new keyname */ \
- sKeyName = DECLARE_ASCII( "/" ); \
- sKeyName += CLASS::impl_getStaticImplementationName(); \
- sKeyName += DECLARE_ASCII( "/UNO/SERVICES" ); \
- LOG_REGISTRATION_WRITEINFO( "\t\t\tcreate key \"" ) \
- LOG_REGISTRATION_WRITEINFO( U2B( sKeyName ) ) \
- LOG_REGISTRATION_WRITEINFO( "\" ...\n" ) \
- /* Create new key with new name. */ \
- xNewKey = xKey->createKey( sKeyName ); \
- /* If this new key valid ... */ \
- if ( xNewKey.is() == sal_True ) \
- { \
- LOG_REGISTRATION_WRITEINFO( "\t\t\t\ttsuccessful ...\n" ) \
- /* Get information about supported services. */ \
- seqServiceNames = CLASS::impl_getStaticSupportedServiceNames() ; \
- pArray = seqServiceNames.getArray() ; \
- nLength = seqServiceNames.getLength() ; \
- nCounter = 0 ; \
- /* Then set this information on this key. */ \
- for ( nCounter = 0; nCounter < nLength; ++nCounter ) \
- { \
- LOG_REGISTRATION_WRITEINFO( "\t\t\t\twrite key \"" ) \
- LOG_REGISTRATION_WRITEINFO( U2B( pArray[nCounter] ) ) \
- LOG_REGISTRATION_WRITEINFO( "\" to registry ...\n" ) \
- xNewKey->createKey( pArray[nCounter] ); \
- } \
- /* Result of this operations = OK. */ \
- bReturn = sal_True ; \
- } \
- } \
- } \
- catch( ::com::sun::star::registry::InvalidRegistryException& ) \
- { \
- LOG_REGISTRATION_WRITEINFO( "\n\nERROR:\nInvalidRegistryException detected\n\n" ) \
- bReturn = sal_False ; \
- }
-
-//*****************************************************************************************************************
-// public
// use it as parameter for COMPONENT_GETFACTORY( IFFACTORIES )
//*****************************************************************************************************************
#define IFFACTORY( CLASS ) \
@@ -144,41 +89,6 @@ ________________________________________________________________________________
//*****************************************************************************************************************
// public
-// define registration of service
-//*****************************************************************************************************************
-#define COMPONENTWRITEINFO( INFOS ) \
- extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \
- void* pRegistryKey ) \
- { \
- LOG_REGISTRATION_WRITEINFO( "\t[start]\n" ) \
- /* Set default return value for this operation - if it failed. */ \
- sal_Bool bReturn = sal_False ; \
- if ( pRegistryKey != NULL ) \
- { \
- LOG_REGISTRATION_WRITEINFO( "\t\tpRegistryKey is valid ...\n" ) \
- /* Define variables for following helper macros! */ \
- /* bReturn will set automaticly. */ \
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey ; \
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xNewKey ; \
- ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames ; \
- const ::rtl::OUString* pArray ; \
- sal_Int32 nLength ; \
- sal_Int32 nCounter ; \
- ::rtl::OUString sKeyName ; \
- xKey = reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ); \
- /* This parameter will expand to */ \
- /* "COMPONENT_INFO(a) */ \
- /* ... */ \
- /* COMPONENT_INFO(z)" */ \
- INFOS \
- } \
- LOG_REGISTRATION_WRITEINFO( "\t[end]\n" ) \
- /* Return with result of this operation. */ \
- return bReturn ; \
- }
-
-//*****************************************************************************************************************
-// public
// define method to instanciate new services
//*****************************************************************************************************************
#define COMPONENTGETFACTORY( IFFACTORIES ) \
diff --git a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
index ce71154a3b..f85ff68d2f 100644
--- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
+++ b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
@@ -219,6 +219,7 @@ namespace framework
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager;
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xModuleAcceleratorManager;
};
}
diff --git a/framework/prj/d.lst b/framework/prj/d.lst
index 7f260f07cf..d3a3d6dd15 100644
--- a/framework/prj/d.lst
+++ b/framework/prj/d.lst
@@ -42,6 +42,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar
..\inc\classes\menuextensionsupplier.hxx %_DEST%\inc%_EXT%\framework\menuextensionsupplier.hxx
..\inc\interaction\preventduplicateinteraction.hxx %_DEST%\inc%_EXT%\framework\preventduplicateinteraction.hxx
..\inc\helper\titlehelper.hxx %_DEST%\inc%_EXT%\framework\titlehelper.hxx
+..\inc\classes\framelistanalyzer.hxx %_DEST%\inc%_EXT%\framework\framelistanalyzer.hxx
..\uiconfig\startmodule\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\menubar\*.xml
..\uiconfig\startmodule\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\toolbar\*.xml
@@ -49,3 +50,6 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar
..\source\unotypes\fw?.xml %_DEST%\xml%_EXT%\*.xml
+..\%__SRC%\misc\fwk.component %_DEST%\xml%_EXT%\fwk.component
+..\%__SRC%\misc\fwl.component %_DEST%\xml%_EXT%\fwl.component
+..\%__SRC%\misc\fwm.component %_DEST%\xml%_EXT%\fwm.component
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index a865516b94..88a941294a 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -96,6 +96,8 @@
#include <svtools/acceleratorexecute.hxx>
+#include <stdio.h>
+
//_______________________________________________
// const
@@ -1246,12 +1248,12 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
if (! xHAccess.is ())
return;
- const sal_Int32 c = aEvent.Changes.getLength();
+ css::util::ChangesEvent aReceivedEvents( aEvent );
+ const sal_Int32 c = aReceivedEvents.Changes.getLength();
sal_Int32 i = 0;
-
for (i=0; i<c; ++i)
{
- const css::util::ElementChange& aChange = aEvent.Changes[i];
+ const css::util::ElementChange& aChange = aReceivedEvents.Changes[i];
// Only path of form "PrimaryKeys/Modules/Module['<module_name>']/Key['<command_url>']/Command[<locale>]" will
// be interesting for use. Sometimes short path values are given also by the broadcaster ... but they must be ignored :-)
@@ -1264,27 +1266,25 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
aChange.Accessor >>= sOrgPath;
sPath = sOrgPath;
- ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath);
- sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sPrimarySecondary);
-
- ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath);
- sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sGlobalModules);
-
+ ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath, &sPath);
+ ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath, &sPath);
+
if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) )
{
::rtl::OUString sModule;
- sKey = ::utl::extractFirstFromConfigurationPath(sPath);
- if ( sKey.getLength() )
+ sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath);
+ if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 ))
reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
}
else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) )
{
- ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath);
- ::rtl::OUString sDropModule = ::rtl::OUString::createFromAscii("Module['") + sModule + ::rtl::OUString::createFromAscii("']");
- sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sDropModule);
- sKey = ::utl::extractFirstFromConfigurationPath(sPath);
- if ( sKey.getLength() )
+ ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath, &sPath);
+ sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath);
+
+ if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 ))
+ {
reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
+ }
}
}
}
@@ -1385,8 +1385,8 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD1;
else if (sToken[k].equalsAscii("MOD2"))
aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD2;
- else if (sToken[k].equalsAscii("MOD3"))
- aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3;
+ else if (sToken[k].equalsAscii("MOD3"))
+ aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3;
else
{
bValid = sal_False;
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 392b98eb6e..68683df34c 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -103,6 +103,7 @@
#include <unotools/moduleoptions.hxx>
#include <svtools/sfxecode.hxx>
#include <unotools/processfactory.hxx>
+#include <unotools/ucbhelper.hxx>
#include <comphelper/configurationhelper.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/svapp.hxx>
@@ -1407,7 +1408,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded()
// don't check the complete URL here.
// use its main part - ignore optional jumpmarks!
const ::rtl::OUString sURL = xModel->getURL();
- if (!m_aURL.Main.equals(sURL))
+ if (!::utl::UCBContentHelper::EqualURLs( m_aURL.Main, sURL ))
{
xTask.clear ();
continue;
diff --git a/framework/source/register/register3rdcomponents.cxx b/framework/source/register/register3rdcomponents.cxx
index e9c63ac04e..3ddbad0da3 100644
--- a/framework/source/register/register3rdcomponents.cxx
+++ b/framework/source/register/register3rdcomponents.cxx
@@ -47,10 +47,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
- COMPONENTWRITEINFO ( COMPONENTINFO( Service1 )
- COMPONENTINFO( Service2 )
- )
-
COMPONENTGETFACTORY ( IFFACTORIE( Service1 )
else
IFFACTORIE( Service2 )
@@ -63,12 +59,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
-COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::HelpOnStartup )
- COMPONENTINFO( ::framework::TabWinFactory )
- COMPONENTINFO( ::framework::SystemExec )
- COMPONENTINFO( ::framework::ShellJob )
- )
-
COMPONENTGETFACTORY ( IFFACTORY( ::framework::HelpOnStartup ) else
IFFACTORY( ::framework::TabWinFactory ) else
IFFACTORY( ::framework::SystemExec ) else
diff --git a/framework/source/register/registerlogindialog.cxx b/framework/source/register/registerlogindialog.cxx
index 166f489b94..01dd6f806c 100644
--- a/framework/source/register/registerlogindialog.cxx
+++ b/framework/source/register/registerlogindialog.cxx
@@ -48,10 +48,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
- COMPONENTWRITEINFO ( COMPONENTINFO( Service1 )
- COMPONENTINFO( Service2 )
- )
-
COMPONENTGETFACTORY ( IFFACTORIE( Service1 )
else
IFFACTORIE( Service2 )
@@ -64,8 +60,5 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
-COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::LoginDialog )
- )
-
COMPONENTGETFACTORY ( IFFACTORY( ::framework::LoginDialog )
)
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index 297431d80f..7078ec6beb 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -47,10 +47,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
- COMPONENTWRITEINFO ( COMPONENTINFO( Service1 )
- COMPONENTINFO( Service2 )
- )
-
COMPONENTGETFACTORY ( IFFACTORIE( Service1 )
else
IFFACTORIE( Service2 )
@@ -117,66 +113,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
-COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer )
- COMPONENTINFO( ::framework::Desktop )
- COMPONENTINFO( ::framework::Frame )
- //COMPONENTINFO( ::framework::Oxt_Handler )
- COMPONENTINFO( ::framework::JobExecutor )
- //COMPONENTINFO( ::framework::DispatchRecorderSupplier )
- //COMPONENTINFO( ::framework::DispatchRecorder )
- //COMPONENTINFO( ::framework::MailToDispatcher )
- //COMPONENTINFO( ::framework::ServiceHandler )
- COMPONENTINFO( ::framework::JobDispatch )
- COMPONENTINFO( ::framework::BackingComp )
- //COMPONENTINFO( ::framework::DispatchHelper )
- COMPONENTINFO( ::framework::LayoutManager )
- //COMPONENTINFO( ::framework::License )
- COMPONENTINFO( ::framework::UIElementFactoryManager )
- COMPONENTINFO( ::framework::PopupMenuControllerFactory )
- //COMPONENTINFO( ::framework::FontMenuController )
- //COMPONENTINFO( ::framework::FontSizeMenuController )
- COMPONENTINFO( ::framework::ObjectMenuController )
- //COMPONENTINFO( ::framework::HeaderMenuController )
- //COMPONENTINFO( ::framework::FooterMenuController )
- COMPONENTINFO( ::framework::ControlMenuController )
- //COMPONENTINFO( ::framework::MacrosMenuController )
- COMPONENTINFO( ::framework::UICommandDescription )
- COMPONENTINFO( ::framework::ModuleManager )
- COMPONENTINFO( ::framework::UIConfigurationManager )
- COMPONENTINFO( ::framework::ModuleUIConfigurationManagerSupplier )
- COMPONENTINFO( ::framework::ModuleUIConfigurationManager )
- COMPONENTINFO( ::framework::MenuBarFactory )
- COMPONENTINFO( ::framework::GlobalAcceleratorConfiguration )
- COMPONENTINFO( ::framework::ModuleAcceleratorConfiguration )
- COMPONENTINFO( ::framework::DocumentAcceleratorConfiguration )
- COMPONENTINFO( ::framework::ToolBoxFactory )
- COMPONENTINFO( ::framework::AddonsToolBoxFactory )
- COMPONENTINFO( ::framework::WindowStateConfiguration )
- COMPONENTINFO( ::framework::ToolbarControllerFactory )
- //COMPONENTINFO( ::framework::ToolbarsMenuController )
- COMPONENTINFO( ::framework::AutoRecovery )
- COMPONENTINFO( ::framework::StatusIndicatorFactory )
- COMPONENTINFO( ::framework::RecentFilesMenuController )
- COMPONENTINFO( ::framework::StatusBarFactory )
- COMPONENTINFO( ::framework::UICategoryDescription )
- COMPONENTINFO( ::framework::StatusbarControllerFactory )
- COMPONENTINFO( ::framework::SessionListener )
- //COMPONENTINFO( ::framework::LogoImageStatusbarController )
- //COMPONENTINFO( ::framework::LogoTextStatusbarController )
- //COMPONENTINFO( ::framework::NewMenuController )
- COMPONENTINFO( ::framework::TaskCreatorService )
- //COMPONENTINFO( ::framework::SimpleTextStatusbarController )
- //COMPONENTINFO( ::framework::UriAbbreviation )
- //COMPONENTINFO( ::framework::PopupMenuDispatcher )
- COMPONENTINFO( ::framework::ImageManager )
- COMPONENTINFO( ::framework::LangSelectionStatusbarController )
- //COMPONENTINFO( ::framework::LanguageSelectionMenuController )
- //COMPONENTINFO( ::framework::TabWindowService )
- COMPONENTINFO( ::framework::WindowContentFactoryManager )
- COMPONENTINFO( ::framework::SubstitutePathVariables )
- COMPONENTINFO( ::framework::PathSettings )
- )
-
COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer ) else
IFFACTORY( ::framework::Desktop ) else
IFFACTORY( ::framework::Frame ) else
diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx
index b4a1252ffa..2ad7f59365 100644
--- a/framework/source/register/registertemp.cxx
+++ b/framework/source/register/registertemp.cxx
@@ -47,10 +47,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
- COMPONENTWRITEINFO ( COMPONENTINFO( Service1 )
- COMPONENTINFO( Service2 )
- )
-
COMPONENTGETFACTORY ( IFFACTORIE( Service1 )
else
IFFACTORIE( Service2 )
@@ -82,31 +78,6 @@
COMPONENTGETIMPLEMENTATIONENVIRONMENT
-COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper )
- COMPONENTINFO( ::framework::MailToDispatcher )
- COMPONENTINFO( ::framework::NewMenuController )
- COMPONENTINFO( ::framework::ToolbarsMenuController )
- COMPONENTINFO( ::framework::MacrosMenuController )
- COMPONENTINFO( ::framework::FontSizeMenuController )
- COMPONENTINFO( ::framework::HeaderMenuController )
- COMPONENTINFO( ::framework::FooterMenuController )
- COMPONENTINFO( ::framework::FontMenuController )
- COMPONENTINFO( ::framework::ServiceHandler )
- COMPONENTINFO( ::framework::LogoImageStatusbarController )
- COMPONENTINFO( ::framework::LogoTextStatusbarController )
- COMPONENTINFO( ::framework::SimpleTextStatusbarController )
- COMPONENTINFO( ::framework::UriAbbreviation )
- COMPONENTINFO( ::framework::LanguageSelectionMenuController )
- COMPONENTINFO( ::framework::PopupMenuDispatcher )
- COMPONENTINFO( ::framework::DispatchHelper )
- COMPONENTINFO( ::framework::TabWindowService )
- COMPONENTINFO( ::framework::DispatchRecorder )
- COMPONENTINFO( ::framework::DispatchRecorderSupplier )
- COMPONENTINFO( ::framework::Oxt_Handler )
- COMPONENTINFO( ::framework::License )
- COMPONENTINFO( ::framework::PopupMenuController )
- )
-
COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper )
IFFACTORY( ::framework::MailToDispatcher ) else
IFFACTORY( ::framework::ServiceHandler ) else
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index a4827dc24b..54f8ecf506 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -776,26 +776,29 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u
css::lang::EventObject aEvent( xThis );
m_aListenerContainer.disposeAndClear( aEvent );
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ ResetableGuard aGuard( m_aLock );
+ Reference< XComponent > xModuleImageManager( m_xModuleImageManager );
+ m_xModuleImageManager.clear();
+ m_xModuleAcceleratorManager.clear();
+ m_aUIElements[LAYER_USERDEFINED].clear();
+ m_aUIElements[LAYER_DEFAULT].clear();
+ m_xDefaultConfigStorage.clear();
+ m_xUserConfigStorage.clear();
+ m_xUserRootCommit.clear();
+ m_bConfigRead = false;
+ m_bModified = false;
+ m_bDisposed = true;
+ aGuard.unlock();
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+
+ try
+ {
+ if ( xModuleImageManager.is() )
+ xModuleImageManager->dispose();
+ }
+ catch ( Exception& )
{
- ResetableGuard aGuard( m_aLock );
- try
- {
- if ( m_xModuleImageManager.is() )
- m_xModuleImageManager->dispose();
- }
- catch ( Exception& )
- {
- }
-
- m_xModuleImageManager.clear();
- m_aUIElements[LAYER_USERDEFINED].clear();
- m_aUIElements[LAYER_DEFAULT].clear();
- m_xDefaultConfigStorage.clear();
- m_xUserConfigStorage.clear();
- m_xUserRootCommit.clear();
- m_bConfigRead = false;
- m_bModified = false;
- m_bDisposed = true;
}
}
@@ -1370,30 +1373,35 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager()
}
return Reference< XInterface >( m_xModuleImageManager, UNO_QUERY );
-
-// return Reference< XInterface >();
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException)
{
ResetableGuard aGuard( m_aLock );
+
+ if ( m_bDisposed )
+ throw DisposedException();
+
Reference< XMultiServiceFactory > xSMGR = m_xServiceManager;
- ::rtl::OUString aModule = /*m_aModuleShortName*/m_aModuleIdentifier;
- aGuard.unlock();
+ ::rtl::OUString aModule = m_aModuleIdentifier;
- Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION);
- Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW);
-
- PropertyValue aProp;
- aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier");
- aProp.Value <<= aModule;
-
- Sequence< Any > lArgs(1);
- lArgs[0] <<= aProp;
-
- xInit->initialize(lArgs);
+ if ( !m_xModuleAcceleratorManager.is() )
+ {
+ Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION);
+ Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW);
+
+ PropertyValue aProp;
+ aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier");
+ aProp.Value <<= aModule;
+
+ Sequence< Any > lArgs(1);
+ lArgs[0] <<= aProp;
+
+ xInit->initialize(lArgs);
+ m_xModuleAcceleratorManager = Reference< XInterface >( xManager, UNO_QUERY );
+ }
- return xManager;
+ return m_xModuleAcceleratorManager;
}
Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException)
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
new file mode 100644
index 0000000000..e6ceb91e80
--- /dev/null
+++ b/framework/util/fwk.component
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.frame.SessionListener">
+ <service name="com.sun.star.frame.SessionListener"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.AddonsToolBarFactory">
+ <service name="com.sun.star.ui.ToolBarFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.AutoRecovery">
+ <service name="com.sun.star.frame.AutoRecovery"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.BackingComp">
+ <service name="com.sun.star.frame.StartModule"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ControlMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.Desktop">
+ <service name="com.sun.star.frame.Desktop"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.DocumentAcceleratorConfiguration">
+ <service name="com.sun.star.ui.DocumentAcceleratorConfiguration"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.Frame">
+ <service name="com.sun.star.frame.Frame"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.GlobalAcceleratorConfiguration">
+ <service name="com.sun.star.ui.GlobalAcceleratorConfiguration"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ImageManager">
+ <service name="com.sun.star.ui.ImageManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.JobExecutor">
+ <service name="com.sun.star.task.JobExecutor"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.LangSelectionStatusbarController">
+ <service name="com.sun.star.frame.StatusbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.LayoutManager">
+ <service name="com.sun.star.frame.LayoutManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.MenuBarFactory">
+ <service name="com.sun.star.ui.UIElementFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ModuleAcceleratorConfiguration">
+ <service name="com.sun.star.ui.ModuleAcceleratorConfiguration"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ModuleManager">
+ <service name="com.sun.star.frame.ModuleManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ModuleUIConfigurationManager">
+ <service name="com.sun.star.ui.ModuleUIConfigurationManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ModuleUIConfigurationManagerSupplier">
+ <service name="com.sun.star.ui.ModuleUIConfigurationManagerSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ObjectMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.PathSettings">
+ <service name="com.sun.star.util.PathSettings"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.PathSubstitution">
+ <service name="com.sun.star.util.PathSubstitution"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.PopupMenuControllerFactory">
+ <service name="com.sun.star.frame.PopupMenuControllerFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.RecentFilesMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.StatusBarControllerFactory">
+ <service name="com.sun.star.frame.StatusbarControllerFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.StatusBarFactory">
+ <service name="com.sun.star.ui.StatusBarFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.StatusIndicatorFactory">
+ <service name="com.sun.star.task.StatusIndicatorFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.TaskCreator">
+ <service name="com.sun.star.frame.TaskCreator"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ToolBarControllerFactory">
+ <service name="com.sun.star.frame.ToolBarControllerFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ToolBarFactory">
+ <service name="com.sun.star.ui.ToolBarFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.UICategoryDescription">
+ <service name="com.sun.star.ui.UICategoryDescription"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.UICommandDescription">
+ <service name="com.sun.star.frame.UICommandDescription"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.UIConfigurationManager">
+ <service name="com.sun.star.ui.UIConfigurationManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.UIElementFactoryManager">
+ <service name="com.sun.star.ui.UIElementFactoryManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.URLTransformer">
+ <service name="com.sun.star.util.URLTransformer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.WindowContentFactoryManager">
+ <service name="com.sun.star.ui.WindowContentFactoryManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.WindowStateConfiguration">
+ <service name="com.sun.star.ui.WindowStateConfiguration"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.jobs.JobDispatch">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+</component>
diff --git a/framework/util/fwl.component b/framework/util/fwl.component
new file mode 100644
index 0000000000..aa124d1cdc
--- /dev/null
+++ b/framework/util/fwl.component
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sum.star.comp.framework.LanguageSelectionMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.DispatchRecorder">
+ <service name="com.sun.star.frame.DispatchRecorder"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.DispatchRecorderSupplier">
+ <service name="com.sun.star.frame.DispatchRecorderSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.FontMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.FontSizeMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.FooterMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.HeaderMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.License">
+ <service name="com.sun.star.task.Job"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.LogoImageStatusbarController">
+ <service name="com.sun.star.frame.StatusbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.LogoTextStatusbarController">
+ <service name="com.sun.star.frame.StatusbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.MacrosMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.MailToDispatcher">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.MediaTypeDetectionHelper">
+ <service name="com.sun.star.frame.MediaTypeDetectionHelper"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.NewMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.OXTFileHandler">
+ <service name="com.sun.star.frame.ContentHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.PopupMenuController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.PopupMenuControllerDispatcher">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ServiceHandler">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.SimpleTextStatusbarController">
+ <service name="com.sun.star.frame.StatusbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.TabWindowService">
+ <service name="com.sun.star.ui.dialogs.TabContainerWindow"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ToolBarsMenuController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.UriAbbreviation">
+ <service name="com.sun.star.util.UriAbbreviation"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.services.DispatchHelper">
+ <service name="com.sun.star.frame.DispatchHelper"/>
+ </implementation>
+</component>
diff --git a/framework/util/fwm.component b/framework/util/fwm.component
new file mode 100644
index 0000000000..624249ff43
--- /dev/null
+++ b/framework/util/fwm.component
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.framework.HelpOnStartup">
+ <service name="com.sun.star.task.Job"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.ShellJob">
+ <service name="com.sun.star.task.Job"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.SystemExecute">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.framework.TabWindowFactory">
+ <service name="com.sun.star.frame.TabWindowFactory"/>
+ </implementation>
+</component>
diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk
index 91532cda76..a3f14341d3 100644
--- a/framework/util/makefile.mk
+++ b/framework/util/makefile.mk
@@ -50,7 +50,6 @@ LIB1OBJFILES= \
$(SLO)$/protocolhandlercache.obj \
$(SLO)$/networkdomain.obj \
$(SLO)$/configaccess.obj \
- $(SLO)$/framelistanalyzer.obj \
$(SLO)$/shareablemutex.obj \
$(SLO)$/itemcontainer.obj \
$(SLO)$/rootitemcontainer.obj \
@@ -99,6 +98,7 @@ LIB2OBJFILES= \
$(SLO)$/configimporter.obj \
$(SLO)$/menuextensionsupplier.obj \
$(SLO)$/preventduplicateinteraction.obj \
+ $(SLO)$/framelistanalyzer.obj \
$(SLO)$/titlehelper.obj
# --- import classes library ---------------------------------------------------
@@ -423,3 +423,23 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk
@echo _TI2>>$@
@echo LIBMAIN>>$@
@echo LibMain>>$@
+
+ALLTAR : $(MISC)/fwk.component $(MISC)/fwl.component $(MISC)/fwm.component
+
+$(MISC)/fwk.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fwk.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fwk.component
+
+$(MISC)/fwl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fwl.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fwl.component
+
+$(MISC)/fwm.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ fwm.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL5TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt fwm.component
diff --git a/idl/source/cmptools/hash.cxx b/idl/source/cmptools/hash.cxx
index d4305a0b3b..ac6fe446ad 100644
--- a/idl/source/cmptools/hash.cxx
+++ b/idl/source/cmptools/hash.cxx
@@ -141,10 +141,6 @@ BOOL SvHashTable::Test_Insert( const void * pElement, BOOL bInsert,
SvStringHashTable::SvStringHashTable( UINT32 nMaxEntries )
: SvHashTable( nMaxEntries )
{
-#ifdef WIN
- DBG_ASSERT( (UINT32)nMaxEntries * sizeof( SvStringHashEntry ) <= 0xFF00,
- "Hash table size cannot exeed 64k byte" )
-#endif
pEntries = new SvStringHashEntry[ nMaxEntries ];
// RefCount auf eins setzen
diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx
index a82da6cf5d..65df6d529d 100644
--- a/idl/source/cmptools/lex.cxx
+++ b/idl/source/cmptools/lex.cxx
@@ -146,11 +146,7 @@ SvToken & SvToken::operator = ( const SvToken & rObj )
*************************************************************************/
void SvTokenStream::InitCtor()
{
-#ifdef DOS
- SetCharSet( CHARSET_ANSI );
-#else
SetCharSet( gsl_getSystemTextEncoding() );
-#endif
aStrTrue = "TRUE";
aStrFalse = "FALSE";
nLine = nColumn = 0;
@@ -251,11 +247,7 @@ void SvTokenStream::SetCharSet( CharSet nSet )
{
nCharSet = nSet;
-#ifdef DOS
- pCharTab = SvChar::GetTable( nSet, CHARSET_ANSI );
-#else
pCharTab = SvChar::GetTable( nSet, gsl_getSystemTextEncoding() );
-#endif
}
/*************************************************************************
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 320fd20cad..cc4e5d48c0 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -697,10 +697,8 @@ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm )
*************************************************************************/
void SvIdlDataBase::Write( const ByteString & rText )
{
-#ifndef W31
if( nVerbosity != 0 )
fprintf( stdout, "%s", rText.GetBuffer() );
-#endif
}
/*************************************************************************
@@ -714,7 +712,6 @@ void SvIdlDataBase::WriteError( const ByteString & rErrWrn,
ULONG nRow, ULONG nColumn ) const
{
//Fehlerbehandlung
-#ifndef W31
fprintf( stderr, "\n%s --- %s: ( %ld, %ld )\n",
rFileName.GetBuffer(), rErrWrn.GetBuffer(), nRow, nColumn );
@@ -722,7 +719,6 @@ void SvIdlDataBase::WriteError( const ByteString & rErrWrn,
{ // Fehler gesetzt
fprintf( stderr, "\t%s\n", rErrorText.GetBuffer() );
}
-#endif
}
/*************************************************************************
@@ -733,7 +729,6 @@ void SvIdlDataBase::WriteError( const ByteString & rErrWrn,
void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
{
//Fehlerbehandlung
-#ifndef W31
String aFileName( rInStm.GetFileName() );
ByteString aErrorText;
ULONG nRow = 0, nColumn = 0;
@@ -793,7 +788,6 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
if( aN.Len() )
fprintf( stderr, "%s versus %s\n", pTok->GetString().GetBuffer(), aN.GetBuffer() );
}
-#endif
}
/****************** SvIdlWorkingBase ****************************************/
diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx
index b943b56f22..f28b403253 100644
--- a/idl/source/prj/globals.cxx
+++ b/idl/source/prj/globals.cxx
@@ -35,15 +35,6 @@
#include <database.hxx>
/****************** G L O B A L S ****************************************/
-#ifdef DOS
-static IdlDll * pApp = NULL;
-IdlDll * GetIdlApp()
-{
- if( !pApp )
- pApp = new IdlDll();
- return pApp;
-}
-#else
IdlDll * GetIdlApp()
{
if( !(*(IdlDll**)GetAppData(SHL_IDL)) )
@@ -55,7 +46,6 @@ IdlDll * GetIdlApp()
}
return (*(IdlDll**)GetAppData(SHL_IDL));
}
-#endif
IdlDll::IdlDll()
: pHashTable( NULL )
diff --git a/idl/source/prj/makefile.mk b/idl/source/prj/makefile.mk
index 3e0a55a7fd..c33d2e9f3d 100644
--- a/idl/source/prj/makefile.mk
+++ b/idl/source/prj/makefile.mk
@@ -41,7 +41,6 @@ CDEFS+=-DIDL_COMPILER
OBJFILES= $(OBJ)$/command.obj \
$(OBJ)$/svidl.obj \
$(OBJ)$/globals.obj \
- $(OBJ)$/idldll.obj \
$(OBJ)$/database.obj
# --- Targets ------------------------------------------------------------
diff --git a/linguistic/prj/d.lst b/linguistic/prj/d.lst
index 01a755e53c..0e0534feaf 100644
--- a/linguistic/prj/d.lst
+++ b/linguistic/prj/d.lst
@@ -8,3 +8,4 @@
mkdir: %_DEST%\inc%_EXT%\linguistic
..\inc\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx
+..\%__SRC%\misc\lng.component %_DEST%\xml%_EXT%\lng.component
diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx
index 9199d43ad9..65fb6dbce5 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -692,31 +692,6 @@ uno::Reference< uno::XInterface > SAL_CALL ConvDicList_CreateInstance(
return StaticConvDicList::get();
}
-
-sal_Bool SAL_CALL ConvDicList_writeInfo(
- void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey )
-{
- try
- {
- String aImpl( '/' );
- aImpl += ConvDicList::getImplementationName_Static().getStr();
- aImpl.AppendAscii( "/UNO/SERVICES" );
- uno::Reference< registry::XRegistryKey > xNewKey =
- pRegistryKey->createKey(aImpl );
- uno::Sequence< OUString > aServices =
- ConvDicList::getSupportedServiceNames_Static();
- for( INT32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i]);
-
- return sal_True;
- }
- catch(Exception &)
- {
- return sal_False;
- }
-}
-
-
void * SAL_CALL ConvDicList_getFactory(
const sal_Char * pImplName,
XMultiServiceFactory * pServiceManager, void * )
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 04fc03b497..3460246dbc 100755
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -438,101 +438,48 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL)
return static_cast< ULONG >(-1);
SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) );
-
ULONG nErr = sal::static_int_cast< ULONG >(-1);
- rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
- if (nDicVersion >= DIC_VERSION_6)
- eEnc = RTL_TEXTENCODING_UTF8;
-
- if (nDicVersion == DIC_VERSION_7)
+ //
+ // Always write as the latest version, i.e. DIC_VERSION_7
+ //
+ rtl_TextEncoding eEnc = RTL_TEXTENCODING_UTF8;
+ pStream->WriteLine(ByteString (pVerOOo7));
+ if (0 != (nErr = pStream->GetError()))
+ return nErr;
+ if (nLanguage == LANGUAGE_NONE)
+ pStream->WriteLine(ByteString("lang: <none>"));
+ else
{
- pStream->WriteLine(ByteString (pVerOOo7));
- if (0 != (nErr = pStream->GetError()))
- return nErr;
-
- if (nLanguage == LANGUAGE_NONE)
- pStream->WriteLine(ByteString("lang: <none>"));
- else
- {
- ByteString aLine("lang: ");
- aLine += ByteString( String( MsLangId::convertLanguageToIsoString( nLanguage ) ), eEnc);
- pStream->WriteLine( aLine );
- }
- if (0 != (nErr = pStream->GetError()))
- return nErr;
-
- if (eDicType == DictionaryType_POSITIVE)
- pStream->WriteLine(ByteString("type: positive"));
- else
- pStream->WriteLine(ByteString("type: negative"));
- if (0 != (nErr = pStream->GetError()))
- return nErr;
-
- pStream->WriteLine(ByteString("---"));
- if (0 != (nErr = pStream->GetError()))
- return nErr;
-
- const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray();
- for (INT32 i = 0; i < nCount; i++)
- {
- ByteString aOutStr = formatForSave(pEntry[i], eEnc);
- pStream->WriteLine (aOutStr);
- if (0 != (nErr = pStream->GetError()))
- return nErr;
- }
+ ByteString aLine("lang: ");
+ aLine += ByteString( String( MsLangId::convertLanguageToIsoString( nLanguage ) ), eEnc);
+ pStream->WriteLine( aLine );
}
+ if (0 != (nErr = pStream->GetError()))
+ return nErr;
+ if (eDicType == DictionaryType_POSITIVE)
+ pStream->WriteLine(ByteString("type: positive"));
else
+ pStream->WriteLine(ByteString("type: negative"));
+ if (0 != (nErr = pStream->GetError()))
+ return nErr;
+ pStream->WriteLine(ByteString("---"));
+ if (0 != (nErr = pStream->GetError()))
+ return nErr;
+ const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray();
+ for (INT32 i = 0; i < nCount; i++)
{
- sal_Char aWordBuf[BUFSIZE];
-
- // write version
- const sal_Char *pVerStr = NULL;
- if (DIC_VERSION_6 == nDicVersion)
- pVerStr = pVerStr6;
- else
- pVerStr = eDicType == DictionaryType_POSITIVE ? pVerStr2 : pVerStr5;
- strcpy( aWordBuf, pVerStr ); // #100211# - checked
- USHORT nLen = sal::static_int_cast< USHORT >(strlen( aWordBuf ));
- *pStream << nLen;
+ ByteString aOutStr = formatForSave(pEntry[i], eEnc);
+ pStream->WriteLine (aOutStr);
if (0 != (nErr = pStream->GetError()))
return nErr;
- pStream->Write(aWordBuf, nLen);
- if (0 != (nErr = pStream->GetError()))
- return nErr;
-
- *pStream << nLanguage;
- if (0 != (nErr = pStream->GetError()))
- return nErr;
- *pStream << (sal_Char) (eDicType == DictionaryType_NEGATIVE ? TRUE : FALSE);
- if (0 != (nErr = pStream->GetError()))
- return nErr;
-
- const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray();
- for (INT32 i = 0; i < nCount; i++)
- {
- ByteString aOutStr = formatForSave(pEntry[i], eEnc);
-
- // the old format would fail (mis-calculation of nLen) and write
- // uninitialized junk for combined len >= BUFSIZE - we truncate
- // silently here, but BUFSIZE is large anyway.
- nLen = aOutStr.Len();
- if (nLen >= BUFSIZE)
- nLen = BUFSIZE - 1;
-
- *pStream << nLen;
- if (0 != (nErr = pStream->GetError()))
- return nErr;
- pStream->Write(aOutStr.GetBuffer(), nLen);
- if (0 != (nErr = pStream->GetError()))
- return nErr;
- }
}
- //! get return value before Stream is destroyed
- ULONG nError = pStream->GetError();
+ //If we are migrating from an older version, then on first successful
+ //write, we're now converted to the latest version, i.e. DIC_VERSION_7
+ nDicVersion = DIC_VERSION_7;
- return nError;
+ return nErr;
}
void DictionaryNeo::launchEvent(INT16 nEvent,
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 989d0588e4..872b942dea 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -796,31 +796,6 @@ uno::Sequence< rtl::OUString > DicList::getSupportedServiceNames_Static() throw(
return aSNS;
}
-
-sal_Bool SAL_CALL DicList_writeInfo(
- void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey )
-{
- try
- {
- String aImpl( '/' );
- aImpl += DicList::getImplementationName_Static().getStr();
- aImpl.AppendAscii( "/UNO/SERVICES" );
- uno::Reference< registry::XRegistryKey > xNewKey =
- pRegistryKey->createKey(aImpl );
- uno::Sequence< rtl::OUString > aServices =
- DicList::getSupportedServiceNames_Static();
- for( INT32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i]);
-
- return sal_True;
- }
- catch(Exception &)
- {
- return sal_False;
- }
-}
-
-
void * SAL_CALL DicList_getFactory( const sal_Char * pImplName,
XMultiServiceFactory * pServiceManager, void * )
{
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 101c231db6..444649493c 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -1333,27 +1333,3 @@ void * SAL_CALL GrammarCheckingIterator_getFactory(
}
return pRet;
}
-
-
-sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo(
- void * /*pServiceManager*/,
- registry::XRegistryKey * pRegistryKey )
-{
- try
- {
- OUString aImpl( '/' );
- aImpl += GrammarCheckingIterator_getImplementationName().getStr();
- aImpl += A2OU( "/UNO/SERVICES" );
- uno::Reference< registry::XRegistryKey > xNewKey = pRegistryKey->createKey( aImpl );
- uno::Sequence< OUString > aServices = GrammarCheckingIterator_getSupportedServiceNames();
- for( sal_Int32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- catch (uno::Exception &)
- {
- return sal_False;
- }
-}
-
diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx
index 1f076f0f39..fb12f96559 100644
--- a/linguistic/source/grammarchecker.cxx
+++ b/linguistic/source/grammarchecker.cxx
@@ -276,27 +276,6 @@ OUString SAL_CALL GrammarChecker::getImplementationName( ) throw(uno::RuntimeEx
return getImplementationName_Static();
}
-sal_Bool SAL_CALL GrammarChecker_writeInfo( void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey )
-{
- try
- {
- String aImpl( '/' );
- aImpl += GrammarChecker::getImplementationName_Static().getStr();
- aImpl.AppendAscii( "/UNO/SERVICES" );
- uno::Reference< registry::XRegistryKey > xNewKey =
- pRegistryKey->createKey( aImpl );
- uno::Sequence< OUString > aServices = GrammarChecker::getSupportedServiceNames_Static();
- for( INT32 i = 0; i < aServices.getLength(); ++i )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- catch(uno::Exception &)
- {
- return sal_False;
- }
-}
-
uno::Reference< uno::XInterface > SAL_CALL GrammarChecker_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ )
throw(uno::Exception)
diff --git a/linguistic/source/lng.component b/linguistic/source/lng.component
new file mode 100644
index 0000000000..f4f3ca603a
--- /dev/null
+++ b/linguistic/source/lng.component
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.lingu2.ConvDicList">
+ <service name="com.sun.star.linguistic2.ConversionDictionaryList"/>
+ </implementation>
+ <implementation name="com.sun.star.lingu2.DicList">
+ <service name="com.sun.star.linguistic2.DictionaryList"/>
+ </implementation>
+ <implementation name="com.sun.star.lingu2.LinguProps">
+ <service name="com.sun.star.linguistic2.LinguProperties"/>
+ </implementation>
+ <implementation name="com.sun.star.lingu2.LngSvcMgr">
+ <service name="com.sun.star.linguistic2.LinguServiceManager"/>
+ </implementation>
+ <implementation name="com.sun.star.lingu2.ProofreadingIterator">
+ <service name="com.sun.star.linguistic2.ProofreadingIterator"/>
+ </implementation>
+</component>
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index d377f856e8..e00500d17e 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -665,29 +665,6 @@ uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static()
return aSNS;
}
-
-sal_Bool SAL_CALL LinguProps_writeInfo( void * /*pServiceManager*/,
- XRegistryKey * pRegistryKey )
-{
- try
- {
- String aImpl( '/' );
- aImpl += LinguProps::getImplementationName_Static().getStr();
- aImpl.AppendAscii( "/UNO/SERVICES" );
- Reference< XRegistryKey > xNewKey =
- pRegistryKey->createKey(aImpl );
- uno::Sequence< OUString > aServices = LinguProps::getSupportedServiceNames_Static();
- for( INT32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i]);
-
- return sal_True;
- }
- catch(Exception &)
- {
- return sal_False;
- }
-}
-
void * SAL_CALL LinguProps_getFactory( const sal_Char * pImplName,
XMultiServiceFactory *pServiceManager, void * )
{
diff --git a/linguistic/source/lngreg.cxx b/linguistic/source/lngreg.cxx
index 2eaadda56f..be7fb66b9a 100644
--- a/linguistic/source/lngreg.cxx
+++ b/linguistic/source/lngreg.cxx
@@ -38,42 +38,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::registry;
-////////////////////////////////////////
-// declaration of external RegEntry-functions defined by the service objects
-//
-
-extern sal_Bool SAL_CALL LngSvcMgr_writeInfo
-(
- void * /*pServiceManager*/,
- XRegistryKey * pRegistryKey
-);
-
-extern sal_Bool SAL_CALL DicList_writeInfo
-(
- void * /*pServiceManager*/, XRegistryKey * pRegistryKey
-);
-
-extern sal_Bool SAL_CALL LinguProps_writeInfo
-(
- void * /*pServiceManager*/,
- XRegistryKey * pRegistryKey
-);
-
-extern sal_Bool SAL_CALL ConvDicList_writeInfo
-(
- void * /*pServiceManager*/, XRegistryKey * pRegistryKey
-);
-
-extern sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo
-(
- void * /*pServiceManager*/, XRegistryKey * pRegistryKey
-);
-
-//extern sal_Bool SAL_CALL GrammarChecker_writeInfo
-//(
-// void * /*pServiceManager*/, XRegistryKey * pRegistryKey
-//);
-
extern void * SAL_CALL LngSvcMgr_getFactory
(
const sal_Char * pImplName,
@@ -129,28 +93,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo
-(
- void * pServiceManager,
- XRegistryKey * pRegistryKey
-)
-{
- sal_Bool bRet = LngSvcMgr_writeInfo( pServiceManager, pRegistryKey );
- if(bRet)
- bRet = LinguProps_writeInfo( pServiceManager, pRegistryKey );
- if(bRet)
- bRet = DicList_writeInfo( pServiceManager, pRegistryKey );
- if(bRet)
- bRet = ConvDicList_writeInfo( pServiceManager, pRegistryKey );
- if(bRet)
- bRet = GrammarCheckingIterator_writeInfo( pServiceManager, pRegistryKey );
-/*
- if(bRet)
- bRet = GrammarChecker_writeInfo( pServiceManager, pRegistryKey );
-*/
- return bRet;
-}
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 82caafe02e..48f683bc09 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -45,6 +45,8 @@
#include <cppuhelper/extract.hxx>
#include <rtl/logfile.hxx>
+#include <boost/checked_delete.hpp>
+
#include "lngsvcmgr.hxx"
#include "lngopt.hxx"
#include "misc.hxx"
@@ -605,6 +607,14 @@ LngSvcMgr::LngSvcMgr() :
EnableNotification( aNames );
}
+void LngSvcMgr::clearSvcInfoArray(SvcInfoArray* pInfo)
+{
+ if (pInfo)
+ {
+ std::for_each(pInfo->begin(), pInfo->end(), boost::checked_deleter<SvcInfo>());
+ delete pInfo;
+ }
+}
LngSvcMgr::~LngSvcMgr()
{
@@ -612,10 +622,10 @@ LngSvcMgr::~LngSvcMgr()
// will be freed in the destructor of the respective Reference's
// xSpellDsp, xGrammarDsp, xHyphDsp, xThesDsp
- delete pAvailSpellSvcs;
- delete pAvailGrammarSvcs;
- delete pAvailHyphSvcs;
- delete pAvailThesSvcs;
+ clearSvcInfoArray(pAvailSpellSvcs);
+ clearSvcInfoArray(pAvailGrammarSvcs);
+ clearSvcInfoArray(pAvailHyphSvcs);
+ clearSvcInfoArray(pAvailThesSvcs);
}
@@ -652,7 +662,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() ))
{
// delete old cached data, needs to be acquired new on demand
- delete pAvailSpellSvcs; pAvailSpellSvcs = 0;
+ clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0;
OUString aNode( aSpellCheckerList );
if (lcl_SeqHasString( aSpellCheckerListEntries, aKeyText ))
@@ -677,7 +687,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
else if (0 == rName.compareTo( aGrammarCheckerList, aGrammarCheckerList.getLength() ))
{
// delete old cached data, needs to be acquired new on demand
- delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0;
+ clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0;
OUString aNode( aGrammarCheckerList );
if (lcl_SeqHasString( aGrammarCheckerListEntries, aKeyText ))
@@ -705,7 +715,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
else if (0 == rName.compareTo( aHyphenatorList, aHyphenatorList.getLength() ))
{
// delete old cached data, needs to be acquired new on demand
- delete pAvailHyphSvcs; pAvailHyphSvcs = 0;
+ clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0;
OUString aNode( aHyphenatorList );
if (lcl_SeqHasString( aHyphenatorListEntries, aKeyText ))
@@ -730,7 +740,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
else if (0 == rName.compareTo( aThesaurusList, aThesaurusList.getLength() ))
{
// delete old cached data, needs to be acquired new on demand
- delete pAvailThesSvcs; pAvailThesSvcs = 0;
+ clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0;
OUString aNode( aThesaurusList );
if (lcl_SeqHasString( aThesaurusListEntries, aKeyText ))
@@ -1402,7 +1412,7 @@ uno::Sequence< OUString > SAL_CALL
{
// don't used cached data here (force re-evaluation in order to have downloaded dictionaries
// already found without the need to restart the office
- delete pAvailSpellSvcs; pAvailSpellSvcs = 0;
+ clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0;
GetAvailableSpellSvcs_Impl();
pInfoArray = pAvailSpellSvcs;
}
@@ -1410,7 +1420,7 @@ uno::Sequence< OUString > SAL_CALL
{
// don't used cached data here (force re-evaluation in order to have downloaded dictionaries
// already found without the need to restart the office
- delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0;
+ clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0;
GetAvailableGrammarSvcs_Impl();
pInfoArray = pAvailGrammarSvcs;
}
@@ -1418,7 +1428,7 @@ uno::Sequence< OUString > SAL_CALL
{
// don't used cached data here (force re-evaluation in order to have downloaded dictionaries
// already found without the need to restart the office
- delete pAvailHyphSvcs; pAvailHyphSvcs = 0;
+ clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0;
GetAvailableHyphSvcs_Impl();
pInfoArray = pAvailHyphSvcs;
}
@@ -1426,7 +1436,7 @@ uno::Sequence< OUString > SAL_CALL
{
// don't used cached data here (force re-evaluation in order to have downloaded dictionaries
// already found without the need to restart the office
- delete pAvailThesSvcs; pAvailThesSvcs = 0;
+ clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0;
GetAvailableThesSvcs_Impl();
pInfoArray = pAvailThesSvcs;
}
@@ -1990,31 +2000,6 @@ uno::Reference< uno::XInterface > SAL_CALL LngSvcMgr_CreateInstance(
return xService;
}
-
-
-sal_Bool SAL_CALL LngSvcMgr_writeInfo(
- void * /*pServiceManager*/,
- registry::XRegistryKey * pRegistryKey )
-{
- try
- {
- String aImpl( '/' );
- aImpl += LngSvcMgr::getImplementationName_Static().getStr();
- aImpl.AppendAscii( "/UNO/SERVICES" );
- uno::Reference< registry::XRegistryKey > xNewKey =
- pRegistryKey->createKey( aImpl );
- uno::Sequence< OUString > aServices = LngSvcMgr::getSupportedServiceNames_Static();
- for( INT32 i = 0; i < aServices.getLength(); i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- return sal_True;
- }
- catch(uno::Exception &)
- {
- return sal_False;
- }
-}
-
void * SAL_CALL LngSvcMgr_getFactory(
const sal_Char * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx
index 5ffb9defdb..51f44d90c5 100644
--- a/linguistic/source/lngsvcmgr.hxx
+++ b/linguistic/source/lngsvcmgr.hxx
@@ -143,6 +143,8 @@ class LngSvcMgr :
void SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher,
const SvcInfoArray &rAvailSvcs );
+ static void clearSvcInfoArray(SvcInfoArray *pInfo);
+
// utl::ConfigItem (to allow for listening of changes of relevant properties)
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames );
virtual void Commit();
diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk
index 3f68afb305..9bbd456ce8 100644
--- a/linguistic/source/makefile.mk
+++ b/linguistic/source/makefile.mk
@@ -91,9 +91,8 @@ DEF1DES =Linguistic main DLL
.IF "$(GUI)"=="WNT"
-DEF1EXPORT1 = component_writeInfo
-DEF1EXPORT2 = component_getFactory
-DEF1EXPORT3 = component_getImplementationEnvironment
+DEF1EXPORT1 = component_getFactory
+DEF1EXPORT2 = component_getImplementationEnvironment
.ENDIF
# --- Targets ------------------------------------------------------
@@ -109,3 +108,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo component >> $@
@echo __CT >> $@
+
+ALLTAR : $(MISC)/lng.component
+
+$(MISC)/lng.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ lng.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt lng.component
diff --git a/officecfg/registry/data/org/openoffice/Office/Math.xcu b/officecfg/registry/data/org/openoffice/Office/Math.xcu
index 3acc948129..b040267907 100644..100755
--- a/officecfg/registry/data/org/openoffice/Office/Math.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Math.xcu
@@ -48,6 +48,8 @@
<value>0</value>
</prop>
</node>
+
+ <!-- only used for symbols with the 'Greek' symbol set name -->
<node oor:name="Id2" oor:op="replace">
<prop oor:name="Name">
<value>OpenSymbol</value>
@@ -65,10 +67,11 @@
<value>0</value>
</prop>
<prop oor:name="Italic">
- <value>2</value>
+ <value>0</value>
</prop>
</node>
</node>
+
<node oor:name="SymbolList">
<node oor:name="alpha" oor:op="replace">
<prop oor:name="Char">
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
index 8fef51ca23..686682ff93 100644
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
@@ -169,7 +169,8 @@
<node oor:name="Fingerprint" oor:op="fuse" oor:mandatory="true">
<node oor:name="InternalPaths">
- <node oor:name="$(insturl)/share/fingerprint" oor:op="fuse" />
+ <node install:module="internallibtextcatdata" oor:name="$(insturl)/share/fingerprint" oor:op="fuse"/>
+ <node install:module="externallibtextcatdata" oor:name="${SYSTEM_LIBTEXTCAT_DATA}" oor:op="fuse"/>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 33e5109405..5c72d94843 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE oor:component-data SYSTEM "../../../../../component-update.dtd">
<oor:component-data oor:name="CalcCommands" oor:package="org.openoffice.Office.UI" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<node oor:name="UserInterface">
@@ -160,6 +160,14 @@
<value xml:lang="en-US">~Select...</value>
</prop>
</node>
+ <node oor:name=".uno:TableEvents" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Sheet ~Events...</value>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string">
+ <value xml:lang="en-US">~Events...</value>
+ </prop>
+ </node>
<node oor:name=".uno:DataPilotFilter" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">DataPilot Filter</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index dd8a0a1047..2efbaaa703 100644..100755
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2133,9 +2133,6 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Sentence case</value>
</prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
</node>
<node oor:name=".uno:ChangeCaseToLower" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
@@ -2157,17 +2154,11 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Capitalize Every Word</value>
</prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
</node>
<node oor:name=".uno:ChangeCaseToToggleCase" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~tOGGLE cASE</value>
</prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
</node>
<node oor:name=".uno:ChangeCaseToHalfWidth" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
index 7570fda066..4ed9be5a3d 100644..100755
--- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
@@ -38,7 +38,7 @@
<value xml:lang="en-US">~Text Mode</value>
</prop>
</node>
- <node oor:name=".uno:InsertFormula" oor:op="replace">
+ <node oor:name=".uno:ImportFormula" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Import Formula...</value>
</prop>
diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk
index e65b03371d..2af1e8629b 100644
--- a/officecfg/registry/data/org/openoffice/Office/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk
@@ -87,6 +87,8 @@ MODULEFILES= \
Paths-macosx.xcu \
Paths-unxwnt.xcu \
Paths-unixdesktop.xcu \
+ Paths-internallibtextcatdata.xcu \
+ Paths-externallibtextcatdata.xcu \
Writer-cjk.xcu \
Impress-ogltrans.xcu \
Embedding-calc.xcu \
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 02e05a9329..9bc07c592f 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -4368,69 +4368,133 @@
<info>
<desc>Specifies default settings of graphic export dialogs.</desc>
</info>
- <group oor:name="BMP">
+ <prop oor:name="PixelExportUnit" oor:type="xs:int">
+ <info>
+ <desc>Specifies the unit default that is used in the the graphic export dialog if exporting pixel graphics.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="0">
+ <info>
+ <desc>inches</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="1">
+ <info>
+ <desc>cm</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="2">
+ <info>
+ <desc>mm</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="3">
+ <info>
+ <desc>points</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="4">
+ <info>
+ <desc>pica</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="5">
+ <info>
+ <desc>pixels</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="-1">
+ <info>
+ <desc>default (depends to the metric settings in tools/options)</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>-1</value>
+ </prop>
+ <prop oor:name="PixelExportResolutionUnit" oor:type="xs:int">
+ <info>
+ <desc>Specifies the unit default for the resolution that is used in the the graphic export dialog if exporting pixel graphics.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="0">
+ <info>
+ <desc>pixels/inch</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="1">
+ <info>
+ <desc>pixels/cm</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="2">
+ <info>
+ <desc>pixels/meter</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>0</value>
+ </prop>
+ <prop oor:name="PixelExportResolution" oor:type="xs:int">
+ <info>
+ <desc>Specifies the logical width of a graphic. [UNIT=1/100 mm].</desc>
+ </info>
+ <constraints>
+ <minInclusive oor:value="1">
+ <info>
+ <desc>Represents the lowest value that can be entered in the dialog.</desc>
+ </info>
+ </minInclusive>
+ </constraints>
+ <value>96</value>
+ </prop>
+ <prop oor:name="MaxFilesizeForRealtimePreview" oor:type="xs:int">
+ <info>
+ <desc>Specifies the maximum raw graphic size in bytes up to which the realtime preview is enabled, for fast computers this value may be enlarged</desc>
+ </info>
+ <value>4000000</value>
+ </prop>
+ <prop oor:name="VectorExportUnit" oor:type="xs:int">
+ <info>
+ <desc>Specifies the unit default that is used in the the graphic export dialog if exporting vector graphics.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="0">
+ <info>
+ <desc>inches</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="1">
+ <info>
+ <desc>cm</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="2">
+ <info>
+ <desc>mm</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="3">
+ <info>
+ <desc>points</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="4">
+ <info>
+ <desc>pica</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="-1">
+ <info>
+ <desc>default (depends to the metric settings in tools/options)</desc>
+ </info>
+ </enumeration>
+ </constraints>
+ <value>-1</value>
+ </prop>
+ <group oor:name="BMP">
<info>
<desc>Specifies default settings of the Windows Bitmap export dialog.</desc>
</info>
- <prop oor:name="ExportMode" oor:type="xs:int">
- <!-- OldPath: BMP-EXPORT-MODE -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype BMP-MS Windows - [dialog] BMP Options -->
- <info>
- <desc>Specifies usable export modes.</desc>
- <label>Mode - Original / Resolution / Size</label>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Original size</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Logical size (dpi/pixel ratio)</desc>
- </info>
- </enumeration>
- <enumeration oor:value="2">
- <info>
- <desc>Given size</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <prop oor:name="Resolution" oor:type="xs:int">
- <!-- OldPath: BMP-EXPORT-RES -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype BMP-MS Windows - [dialog] BMP Options -->
- <info>
- <desc>Specifies resolution which is to be used if export mode is 1. [UNIT=dpi]</desc>
- <label>Resolution</label>
- </info>
- <constraints>
- <enumeration oor:value="75">
- <info>
- <desc>75</desc>
- </info>
- </enumeration>
- <enumeration oor:value="150">
- <info>
- <desc>150</desc>
- </info>
- </enumeration>
- <enumeration oor:value="300">
- <info>
- <desc>300</desc>
- </info>
- </enumeration>
- <enumeration oor:value="600">
- <info>
- <desc>600</desc>
- </info>
- </enumeration>
- </constraints>
- <value>75</value>
- </prop>
<prop oor:name="Color" oor:type="xs:int">
<!-- OldLocation: fltopt.ini -->
<!-- UIHints: File Export Filetype BMP-MS Windows - [dialog] BMP Options -->
@@ -4492,13 +4556,6 @@
</info>
<value>true</value>
</prop>
- <node-ref oor:name="Size" oor:node-type="LogicalGraphicSize">
- <info>
- <desc>Specifies the logical size of a graphic. [UNIT=1/100 mm].</desc>
- </info>
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype BMP-MS Windows - [dialog] BMP Options -->
- </node-ref>
</group>
<group oor:name="EPS">
<!-- OldLocation: fltopt.ini -->
@@ -4706,72 +4763,6 @@
<value>0</value>
</prop>
</group>
- <group oor:name="MET">
- <info>
- <desc>Specifies if graphics are exported with the original- or selected size.</desc>
- </info>
- <prop oor:name="ExportMode" oor:type="xs:int">
- <!-- OldPath: MET-EXPORT-MODE -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype MET-OS/2 Metafile -->
- <info>
- <desc>Specifies if graphics are exported with the original- or selected size.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Original size</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Given size</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <node-ref oor:name="Size" oor:node-type="LogicalGraphicSize">
- <info>
- <desc>Specifies the logical size of a graphic. [UNIT=1/100 mm].</desc>
- </info>
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype MET-MS Windows - [dialog] MET Options -->
- </node-ref>
- </group>
- <group oor:name="PCT">
- <info>
- <desc>Specifies default settings of the PCT - Mac Pict export dialog.</desc>
- </info>
- <prop oor:name="ExportMode" oor:type="xs:int">
- <!-- OldPath: PCT-EXPORT-MODE -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype PCT-Mac Pict -->
- <info>
- <desc>Specifies if graphics are exported with original- or selected size.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Original size</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Given size</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <node-ref oor:name="Size" oor:node-type="LogicalGraphicSize">
- <info>
- <desc>Specifies the logical size of a graphic. [UNIT=1/100 mm].</desc>
- </info>
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype PCT-MS Windows - [dialog] PCT Options -->
- </node-ref>
- </group>
<group oor:name="PBM">
<info>
<desc>Specifies default settings of the PBM - Portable Bitmap export dialog.</desc>
@@ -4850,105 +4841,6 @@
<value>1</value>
</prop>
</group>
- <group oor:name="SVM">
- <info>
- <desc>Specifies default settings of the SVM - StarView Meta File export dialog.</desc>
- </info>
- <prop oor:name="ExportMode" oor:type="xs:int">
- <!-- OldPath: SVM-EXPORT-MODE -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype SVM - StarView Metafile -->
- <info>
- <desc>Specifies if graphics should be exported with the original- or selected size.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Original size</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Given size</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <node-ref oor:name="Size" oor:node-type="LogicalGraphicSize">
- <info>
- <desc>Specifies the logical size of a graphic. [UNIT=1/100 mm].</desc>
- </info>
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype SVM - StarView Metafile - [dialog] SVM Options -->
- </node-ref>
- </group>
- <group oor:name="WMF">
- <info>
- <desc>Specifies default settings of the WMF - Windows Metafile export dialog.</desc>
- </info>
- <prop oor:name="ExportMode" oor:type="xs:int">
- <!-- OldPath: WMF-EXPORT-MODE -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype WMF -MS Windows Metafile -->
- <info>
- <desc>Specifies if graphics should be exported with the original- or selected size.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Original size</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Given size</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <node-ref oor:name="Size" oor:node-type="LogicalGraphicSize">
- <info>
- <desc>Specifies the logical size of a graphic. [UNIT=1/100 mm].</desc>
- </info>
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype WMF - MS Windows Metafile - [dialog] WMF Options -->
- </node-ref>
- </group>
- <group oor:name="EMF">
- <info>
- <desc>Specifies default settings of the EMF - Enhanced Metafile export dialog.</desc>
- </info>
- <prop oor:name="ExportMode" oor:type="xs:int">
- <!-- OldPath: EMF-EXPORT-MODE -->
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File - Export -->
- <info>
- <desc>Specifies if graphics should be exported with the original- or selected size.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0">
- <info>
- <desc>Original size</desc>
- </info>
- </enumeration>
- <enumeration oor:value="1">
- <info>
- <desc>Given size</desc>
- </info>
- </enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <node-ref oor:name="Size" oor:node-type="LogicalGraphicSize">
- <info>
- <desc>Specifies the logical size of a graphic. [UNIT=1/100 mm].</desc>
- </info>
- <!-- OldLocation: fltopt.ini -->
- <!-- UIHints: File Export Filetype EMF - Enhanced Metafile - [dialog] EMF Options -->
- </node-ref>
- </group>
<group oor:name="PNG">
<info>
<desc>Specifies default settings of the PNG - Portable Network Graphic export dialog.</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Math.xcs b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
index caa8726b7c..31f6e00a23 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Math.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
@@ -402,7 +402,28 @@
</info>
<value>false</value>
</prop>
- <prop oor:name="ScaleNormalBracket" oor:type="xs:boolean">
+ <prop oor:name="GreekCharStyle" oor:type="xs:short">
+ <!-- UIHints: n/a yet -->
+ <info>
+ <author>TL</author>
+ <desc>Specifies the default layout for symbols from the 'Greek' symbol set.</desc>
+ <label>Greek character style</label>
+ </info>
+ <constraints>
+ <minInclusive oor:value="0">
+ <info>
+ <desc>Specifies the minimum value allowed</desc>
+ </info>
+ </minInclusive>
+ <maxInclusive oor:value="2">
+ <info>
+ <desc>Specifies the maximum value allowed</desc>
+ </info>
+ </maxInclusive>
+ </constraints>
+ <value>0</value>
+ </prop>
+ <prop oor:name="ScaleNormalBracket" oor:type="xs:boolean">
<!-- OldPath: Math/StandardFormat -->
<!-- OldLocation: Soffice.cfg -->
<!-- UIHints: Format - Spacing - Category - Brackets - Scale all brackets -->
diff --git a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs
index 7b0b221f15..7ff9146472 100755
--- a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs
@@ -15,7 +15,7 @@
OpenOffice.org Improvement Program. If this is zero the user will get asked.
</desc>
</info>
- <value>2</value>
+ <value>1</value>
</prop>
<prop oor:name="InvitationAccepted" oor:type="xs:boolean">
<info>
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 76c4bb1778..62d3fdcce8 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -395,7 +395,14 @@
<author>AS</author>
<desc>Contains all of the document factories that were installed during setup.</desc>
</info>
- </set>
+ </set>
+ <prop oor:name="OfficeRestartInProgress" oor:type="xs:boolean">
+ <info>
+ <author>MAV</author>
+ <desc>The entry specifies that we are in restart process</desc>
+ </info>
+ <value>false</value>
+ </prop>
</group>
<group oor:name="L10N">
<info>
diff --git a/oovbaapi/ooo/vba/XApplicationBase.idl b/oovbaapi/ooo/vba/XApplicationBase.idl
index 6157d38079..2a9830568d 100644
--- a/oovbaapi/ooo/vba/XApplicationBase.idl
+++ b/oovbaapi/ooo/vba/XApplicationBase.idl
@@ -24,21 +24,15 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#ifndef __ooo_vba_XApplicationBase_idl__
#define __ooo_vba_XApplicationBase_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-#ifndef __ooo_vba_XHelperInterface_idl__
#include <ooo/vba/XHelperInterface.idl>
-#endif
-
-module ooo { module vba {
-//=============================================================================
+module ooo { module vba {
+//=============================================================================
interface XApplicationBase
{
@@ -47,8 +41,9 @@ interface XApplicationBase
[attribute] boolean ScreenUpdating;
[attribute] boolean DisplayStatusBar;
[attribute] boolean Interactive;
+ [attribute] boolean Visible;
+
[attribute, readonly] string Version;
- //mbn
[attribute, readonly] any VBE;
[attribute, readonly] any VBProjects;
@@ -61,6 +56,8 @@ interface XApplicationBase
void Undo();
};
+//=============================================================================
+
}; };
#endif
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index e7b9aee618..ac1f4c4ee0 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -64,6 +64,7 @@ interface XApplication
[attribute] any CutCopyMode;
[attribute] any StatusBar;
[attribute] long Cursor;
+ [attribute] boolean EnableEvents;
void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException);
diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl
index c54740a613..ad9d85eb45 100644
--- a/oovbaapi/ooo/vba/excel/XGlobals.idl
+++ b/oovbaapi/ooo/vba/excel/XGlobals.idl
@@ -42,6 +42,10 @@
#ifndef __ooo_vba_XAssistant_idl__
#include <ooo/vba/XAssistant.idl>
#endif
+#ifndef __ooo_vba_excel_XApplication_idl__
+#include <ooo/vba/excel/XApplication.idl>
+#endif
+
module ooo { module vba { module excel {
interface XRange;
@@ -55,6 +59,9 @@ interface XGlobals: com::sun::star::uno::XInterface
[attribute, readonly] ooo::vba::XAssistant Assistant;
[attribute, readonly] any Selection;
[attribute, readonly] XWorkbook ThisWorkbook;
+ [attribute, readonly] ooo::vba::excel::XApplication Excel;
+ [attribute, readonly] any Debug;
+
void Calculate() raises(com::sun::star::script::BasicErrorException);
XRange Cells([in] any RowIndex, [in] any ColumnIndex);
diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl
index f59c9eb345..a6d86957ec 100644
--- a/oovbaapi/ooo/vba/excel/XWorksheet.idl
+++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl
@@ -66,13 +66,15 @@ interface XWorksheet
[attribute, readonly] boolean ProtectionMode;
[attribute, readonly] boolean ProtectContents;
[attribute, readonly] boolean ProtectDrawingObjects;
- [attribute, readonly] XRange UsedRange;
+ [attribute, readonly] boolean ProtectScenarios;
+ [attribute, readonly] XRange UsedRange;
[attribute, readonly] XWorksheet Next;
[attribute, readonly] XWorksheet Previous;
[attribute, readonly] string CodeName;
[attribute, readonly] short Index;
[attribute] long EnableSelection;
-
+ [attribute] boolean AutoFilterMode;
+
void Activate();
void Calculate( );
void Select();
@@ -114,6 +116,7 @@ interface XWorksheet
XRange Rows([in] any aIndex);
XRange Columns([in] any aIndex);
any Hyperlinks( [in] any aIndex );
+ any Names( [in] any Index );
any Evaluate( [in] string Name);
diff --git a/oovbaapi/ooo/vba/excel/makefile.mk b/oovbaapi/ooo/vba/excel/makefile.mk
index 12dcf025e4..2515880867 100644
--- a/oovbaapi/ooo/vba/excel/makefile.mk
+++ b/oovbaapi/ooo/vba/excel/makefile.mk
@@ -29,7 +29,7 @@ PRJ=..$/..$/..
PRJNAME=oovapi
TARGET=excel
-PACKAGE=ooo$/vba$/Excel
+PACKAGE=ooo$/vba$/excel
# --- Settings -----------------------------------------------------
.INCLUDE : $(PRJ)$/util$/makefile.pmk
diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk
index 75f6465bf4..4f6d378cfe 100644
--- a/oovbaapi/ooo/vba/makefile.mk
+++ b/oovbaapi/ooo/vba/makefile.mk
@@ -61,9 +61,8 @@ IDLFILES=\
XFontBase.idl\
XDialogsBase.idl\
XDialogBase.idl\
- XPageSetupBase.idl \
- XVBAAppService.idl\
- XVBADocService.idl\
+ XPageSetupBase.idl
+
# ------------------------------------------------------------------
.ENDIF
.INCLUDE : target.mk
diff --git a/oovbaapi/ooo/vba/word/makefile.mk b/oovbaapi/ooo/vba/word/makefile.mk
index e3a19e6784..543e99f7c5 100644
--- a/oovbaapi/ooo/vba/word/makefile.mk
+++ b/oovbaapi/ooo/vba/word/makefile.mk
@@ -29,7 +29,7 @@ PRJ=..$/..$/..
PRJNAME=oovapi
TARGET=word
-PACKAGE=ooo$/vba$/Word
+PACKAGE=ooo$/vba$/word
# --- Settings -----------------------------------------------------
.INCLUDE : $(PRJ)$/util$/makefile.pmk
diff --git a/oovbaapi/prj/d.lst b/oovbaapi/prj/d.lst
index ac5924e2d6..86e801a15d 100644
--- a/oovbaapi/prj/d.lst
+++ b/oovbaapi/prj/d.lst
@@ -8,7 +8,7 @@ mkdir: %COMMON_DEST%\idl%_EXT%\ooo\vba\word
..\%__SRC%\ucr\oovbaapi.db %_DEST%\bin%_EXT%\oovbaapi.rdb
-..\ooo\vba\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\
+..\ooo\vba\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba
..\ooo\vba\constants\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\constants
..\ooo\vba\excel\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\excel
..\ooo\vba\msforms\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\msforms
diff --git a/readlicense_oo/util/makefile.pmk b/readlicense_oo/util/makefile.pmk
index 30e0777945..0efd9712f1 100755
--- a/readlicense_oo/util/makefile.pmk
+++ b/readlicense_oo/util/makefile.pmk
@@ -57,7 +57,7 @@ $(MISC)$/readme_text.xsl : virtual
$(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
@@-$(MKDIRHIER) $(@:d)
- $(XSLTPROC) --nonet -o $@ \
+ $(XSLTPROC) --nonet --novalid -o $@ \
--stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \
--stringparam cp1 $(CPUNAME) --stringparam type html --stringparam lang1 $* \
..$/readme.xsl $(MERGEDXRM)
@@ -67,7 +67,7 @@ $(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
$(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual'
@@-$(MKDIRHIER) $(@:d)
- $(XSLTPROC) --nonet -o $@ \
+ $(XSLTPROC) --nonet --novalid -o $@ \
--stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \
--stringparam cp1 $(CPUNAME) --stringparam type html --stringparam lang1 $* \
..$/readme.xsl $(MERGEDXRM)
@@ -75,7 +75,7 @@ $(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual'
# no percent-rule to avoid ambiguous inference chains for README_<lang>.html
$(SYSTEXTDOCS) : $(MISC)$/readme_text.xsl
@@-$(MKDIRHIER) $(@:d)
- $(XSLTPROC) --nonet -o $@ \
+ $(XSLTPROC) --nonet --novalid -o $@ \
--stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \
--stringparam cp1 $(CPUNAME) --stringparam type text --stringparam lang1 $(@:b:s/readme_//:s/README_//) \
$< $(MERGEDXRM)
diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java
index 8b3d4479ce..9003f5ee0e 100644
--- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java
+++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java
@@ -215,11 +215,6 @@ XInitialization {
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo( XRegistryKey regKey ) {
- return FactoryHelper.writeRegistryServiceInfo(
- SecurityDialog.class.getName(), SecurityDialog.__serviceName, regKey );
- }
-
// XServiceInfo
public String getImplementationName( ) {
return getClass().getName();
diff --git a/scripting/java/ScriptFramework.component b/scripting/java/ScriptFramework.component
new file mode 100644
index 0000000000..d6f9a8f62b
--- /dev/null
+++ b/scripting/java/ScriptFramework.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.script.framework.security.SecurityDialog">
+ <service name="com.sun.star.script.framework.security.SecurityDialog"/>
+ </implementation>
+</component>
diff --git a/scripting/java/ScriptProviderForBeanShell.component b/scripting/java/ScriptProviderForBeanShell.component
new file mode 100644
index 0000000000..fe040d71d9
--- /dev/null
+++ b/scripting/java/ScriptProviderForBeanShell.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.script.framework.provider.beanshell.ScriptProviderForBeanShell$_ScriptProviderForBeanShell">
+ <service name="com.sun.star.script.browse.BrowseNode"/>
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForBeanShell"/>
+ </implementation>
+</component>
diff --git a/scripting/java/ScriptProviderForJava.component b/scripting/java/ScriptProviderForJava.component
new file mode 100644
index 0000000000..4ea6ea8a10
--- /dev/null
+++ b/scripting/java/ScriptProviderForJava.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.script.framework.provider.java.ScriptProviderForJava$_ScriptProviderForJava">
+ <service name="com.sun.star.script.browse.BrowseNode"/>
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForJava"/>
+ </implementation>
+</component>
diff --git a/scripting/java/ScriptProviderForJavaScript.component b/scripting/java/ScriptProviderForJavaScript.component
new file mode 100644
index 0000000000..e9725d8659
--- /dev/null
+++ b/scripting/java/ScriptProviderForJavaScript.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.script.framework.provider.javascript.ScriptProviderForJavaScript$_ScriptProviderForJavaScript">
+ <service name="com.sun.star.script.browse.BrowseNode"/>
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForJavaScript"/>
+ </implementation>
+</component>
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
index 3120487935..6a9a16f7b1 100755
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
@@ -123,41 +123,6 @@ public class ScriptProviderForBeanShell
return xSingleServiceFactory;
}
-
-
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- *
- * @param regKey the registryKey
- * @return returns true if the operation succeeded
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo( XRegistryKey regKey )
- {
- String impl = "com.sun.star.script.framework.provider.beanshell." +
- "ScriptProviderForBeanShell$_ScriptProviderForBeanShell";
-
- String service1 = "com.sun.star.script.provider." +
- "ScriptProvider";
- String service2 = "com.sun.star.script.provider." +
- "LanguageScriptProvider";
- String service3 = "com.sun.star.script.provider." +
- "ScriptProviderForBeanShell";
- String service4 = "com.sun.star.script.browse." +
- "BrowseNode";
-
- if ( FactoryHelper.writeRegistryServiceInfo(impl, service1, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service2, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service3, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service4, regKey) )
- {
- return true;
- }
- return false;
- }
-
}
class ScriptImpl implements XScript
diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
index c89285ffdf..ab5e51db82 100755
--- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
+++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java
@@ -134,41 +134,6 @@ public class ScriptProviderForJava
return xSingleServiceFactory;
}
-
-
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- *
- * @param regKey the registryKey
- * @return returns true if the operation succeeded
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo( XRegistryKey regKey )
- {
- String impl = "com.sun.star.script.framework.provider.java." +
- "ScriptProviderForJava$_ScriptProviderForJava";
-
- String service1 = "com.sun.star.script.provider." +
- "ScriptProvider";
- String service2 = "com.sun.star.script.provider." +
- "LanguageScriptProvider";
- String service3 = "com.sun.star.script.provider." +
- "ScriptProviderForJava";
- String service4 = "com.sun.star.script.browse." +
- "BrowseNode";
-
- if ( FactoryHelper.writeRegistryServiceInfo(impl, service1, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service2, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service3, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service4, regKey) )
- {
- return true;
- }
- return false;
- }
-
}
class ScriptImpl implements XScript
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
index a90e4bc41a..e855bea4fb 100755
--- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
+++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
@@ -124,40 +124,6 @@ public class ScriptProviderForJavaScript
return xSingleServiceFactory;
}
-
-
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- *
- * @param regKey the registryKey
- * @return returns true if the operation succeeded
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo( XRegistryKey regKey )
- {
- String impl = "com.sun.star.script.framework.provider.javascript." +
- "ScriptProviderForJavaScript$_ScriptProviderForJavaScript";
-
- String service1 = "com.sun.star.script.provider." +
- "ScriptProvider";
- String service2 = "com.sun.star.script.provider." +
- "LanguageScriptProvider";
- String service3 = "com.sun.star.script.provider." +
- "ScriptProviderForJavaScript";
- String service4 = "com.sun.star.script.browse." +
- "BrowseNode";
-
- if ( FactoryHelper.writeRegistryServiceInfo(impl, service1, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service2, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service3, regKey) &&
- FactoryHelper.writeRegistryServiceInfo(impl, service4, regKey) )
- {
- return true;
- }
- return false;
- }
}
class ScriptImpl implements XScript
{
diff --git a/scripting/java/makefile.mk b/scripting/java/makefile.mk
index 6a5a81bf97..dc8ee1abdc 100755
--- a/scripting/java/makefile.mk
+++ b/scripting/java/makefile.mk
@@ -36,3 +36,37 @@ TARGET=scriptruntimeforjava
ALLTAR : ANTBUILD
.ENDIF
.ENDIF
+
+ALLTAR : \
+ $(MISC)/ScriptFramework.component \
+ $(MISC)/ScriptProviderForBeanShell.component \
+ $(MISC)/ScriptProviderForJava.component \
+ $(MISC)/ScriptProviderForJavaScript.component
+
+$(MISC)/ScriptFramework.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt ScriptFramework.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)ScriptFramework.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ScriptFramework.component
+
+$(MISC)/ScriptProviderForBeanShell.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt \
+ ScriptProviderForBeanShell.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)ScriptProviderForBeanShell.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt \
+ ScriptProviderForBeanShell.component
+
+$(MISC)/ScriptProviderForJava.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt ScriptProviderForJava.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)ScriptProviderForJava.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ScriptProviderForJava.component
+
+$(MISC)/ScriptProviderForJavaScript.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt \
+ ScriptProviderForJavaScript.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)ScriptProviderForJavaScript.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt \
+ ScriptProviderForJavaScript.component
diff --git a/scripting/prj/d.lst b/scripting/prj/d.lst
index ef216fe84f..4b9d435af7 100644
--- a/scripting/prj/d.lst
+++ b/scripting/prj/d.lst
@@ -15,3 +15,15 @@ mkdir: %_DEST%\bin%_EXT%\pyuno
..\source\storage\storage.xml %_DEST%\xml%_EXT%\storage.xml
..\%__SRC%\lib\lib*static*.dylib %_DEST%\lib%_EXT%\lib*static*.dylib
+..\%__SRC%\misc\mailmerge.component %_DEST%\xml%_EXT%\mailmerge.component
+..\%__SRC%\misc\pythonscript.component %_DEST%\xml%_EXT%\pythonscript.component
+..\%__SRC%\misc\ScriptFramework.component %_DEST%\xml%_EXT%\ScriptFramework.component
+..\%__SRC%\misc\ScriptProviderForBeanShell.component %_DEST%\xml%_EXT%\ScriptProviderForBeanShell.component
+..\%__SRC%\misc\ScriptProviderForJava.component %_DEST%\xml%_EXT%\ScriptProviderForJava.component
+..\%__SRC%\misc\ScriptProviderForJavaScript.component %_DEST%\xml%_EXT%\ScriptProviderForJavaScript.component
+..\%__SRC%\misc\basprov.component %_DEST%\xml%_EXT%\basprov.component
+..\%__SRC%\misc\dlgprov.component %_DEST%\xml%_EXT%\dlgprov.component
+..\%__SRC%\misc\protocolhandler.component %_DEST%\xml%_EXT%\protocolhandler.component
+..\%__SRC%\misc\scriptframe.component %_DEST%\xml%_EXT%\scriptframe.component
+..\%__SRC%\misc\stringresource.component %_DEST%\xml%_EXT%\stringresource.component
+..\%__SRC%\misc\vbaevents.component %_DEST%\xml%_EXT%\vbaevents.component
diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx
index 687fea3584..f56bc33519 100644
--- a/scripting/source/basprov/basmodnode.cxx
+++ b/scripting/source/basprov/basmodnode.cxx
@@ -97,14 +97,22 @@ namespace basprov
if ( pMethods )
{
sal_Int32 nCount = pMethods->Count();
- aChildNodes.realloc( nCount );
+ sal_Int32 nRealCount = 0;
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) );
+ if ( pMethod && !pMethod->IsHidden() )
+ ++nRealCount;
+ }
+ aChildNodes.realloc( nRealCount );
Reference< browse::XBrowseNode >* pChildNodes = aChildNodes.getArray();
+ sal_Int32 iTarget = 0;
for ( sal_Int32 i = 0; i < nCount; ++i )
{
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) );
- if ( pMethod )
- pChildNodes[i] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) );
+ if ( pMethod && !pMethod->IsHidden() )
+ pChildNodes[iTarget++] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) );
}
}
}
diff --git a/scripting/source/basprov/basprov.component b/scripting/source/basprov/basprov.component
new file mode 100644
index 0000000000..528ab6544e
--- /dev/null
+++ b/scripting/source/basprov/basprov.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.scripting.ScriptProviderForBasic">
+ <service name="com.sun.star.script.browse.BrowseNode"/>
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForBasic"/>
+ </implementation>
+</component>
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index c616371276..1cc4b2a889 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -412,7 +412,7 @@ namespace basprov
if ( pMethods )
{
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( aMethod, SbxCLASS_METHOD ) );
- if ( pMethod )
+ if ( pMethod && !pMethod->IsHidden() )
{
if ( m_pDocBasicManager == pBasicMgr )
xScript = new BasicScriptImpl( aDescription, pMethod, *m_pDocBasicManager, m_xInvocationContext );
@@ -589,13 +589,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::basprov::s_component_entries );
- }
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk
index 5001e5db28..c98f961e6b 100644
--- a/scripting/source/basprov/makefile.mk
+++ b/scripting/source/basprov/makefile.mk
@@ -71,3 +71,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/basprov.component
+
+$(MISC)/basprov.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ basprov.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt basprov.component
diff --git a/scripting/source/dlgprov/dlgprov.component b/scripting/source/dlgprov/dlgprov.component
new file mode 100644
index 0000000000..f7ceed336c
--- /dev/null
+++ b/scripting/source/dlgprov/dlgprov.component
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.scripting.DialogProvider">
+ <service name="com.sun.star.awt.ContainerWindowProvider"/>
+ <service name="com.sun.star.awt.DialogProvider"/>
+ <service name="com.sun.star.awt.DialogProvider2"/>
+ </implementation>
+</component>
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 49c07a4787..57aaffe256 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -766,6 +766,31 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
return xDialog;
}
+ Reference < XDialog > DialogProviderImpl::createDialogWithArguments(
+ const ::rtl::OUString& URL, const Sequence< NamedValue >& Arguments )
+ throw (IllegalArgumentException, RuntimeException)
+ {
+ ::comphelper::NamedValueCollection aArguments( Arguments );
+
+ Reference< XWindowPeer > xParentPeer;
+ if ( aArguments.has( "ParentWindow" ) )
+ {
+ const Any aParentWindow( aArguments.get( "ParentWindow" ) );
+ if ( !( aParentWindow >>= xParentPeer ) )
+ {
+ const Reference< XControl > xParentControl( aParentWindow, UNO_QUERY );
+ if ( xParentControl.is() )
+ xParentPeer = xParentControl->getPeer();
+ }
+ }
+
+ const Reference< XInterface > xHandler( aArguments.get( "EventHandler" ), UNO_QUERY );
+
+ Reference < XControl > xControl = DialogProviderImpl::createDialogImpl( URL, xHandler, xParentPeer, true );
+ Reference< XDialog > xDialog( xControl, UNO_QUERY );
+ return xDialog;
+ }
+
Reference< XWindow > DialogProviderImpl::createContainerWindow(
const ::rtl::OUString& URL, const ::rtl::OUString& WindowType,
const Reference< XWindowPeer >& xParent, const Reference< XInterface >& xHandler )
@@ -828,13 +853,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::dlgprov::s_component_entries );
- }
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx
index 098e1d9378..82faef2f86 100644
--- a/scripting/source/dlgprov/dlgprov.hxx
+++ b/scripting/source/dlgprov/dlgprov.hxx
@@ -138,6 +138,11 @@ namespace dlgprov
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xHandler )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XDialog > SAL_CALL createDialogWithArguments(
+ const ::rtl::OUString& URL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createContainerWindow(
const ::rtl::OUString& URL, const ::rtl::OUString& WindowType,
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent,
diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk
index 6c8ec298c7..111dca58ed 100644
--- a/scripting/source/dlgprov/makefile.mk
+++ b/scripting/source/dlgprov/makefile.mk
@@ -80,3 +80,11 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
echo $@
+
+ALLTAR : $(MISC)/dlgprov.component
+
+$(MISC)/dlgprov.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ dlgprov.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt dlgprov.component
diff --git a/scripting/source/protocolhandler/exports.dxp b/scripting/source/protocolhandler/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/scripting/source/protocolhandler/exports.dxp
+++ b/scripting/source/protocolhandler/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/protocolhandler/makefile.mk b/scripting/source/protocolhandler/makefile.mk
index c782c1a188..ec69c00b20 100644
--- a/scripting/source/protocolhandler/makefile.mk
+++ b/scripting/source/protocolhandler/makefile.mk
@@ -61,3 +61,11 @@ DEF1EXPORTFILE= exports.dxp
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/protocolhandler.component
+
+$(MISC)/protocolhandler.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt protocolhandler.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt protocolhandler.component
diff --git a/scripting/source/protocolhandler/protocolhandler.component b/scripting/source/protocolhandler/protocolhandler.component
new file mode 100644
index 0000000000..db177a896c
--- /dev/null
+++ b/scripting/source/protocolhandler/protocolhandler.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ScriptProtocolHandler">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+</component>
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 388be37eb7..e8c45b5d88 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -537,27 +537,6 @@ extern "C"
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
- sal_Bool SAL_CALL component_writeInfo( void * pServiceManager ,
- void * pRegistryKey )
- {
- (void)pServiceManager;
-
- Reference< css::registry::XRegistryKey > xKey(
- reinterpret_cast< css::registry::XRegistryKey* >( pRegistryKey ) ) ;
-
- ::rtl::OUString aStr = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
- aStr +=
- ::scripting_protocolhandler::ScriptProtocolHandler::impl_getStaticImplementationName();
-
- aStr += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ) );
- Reference< css::registry::XRegistryKey > xNewKey = xKey->createKey( aStr );
- xNewKey->createKey(
- ::rtl::OUString::createFromAscii( ::scripting_protocolhandler::MYSERVICENAME )
- );
-
- return sal_True;
- }
-
void* SAL_CALL component_getFactory( const sal_Char * pImplementationName ,
void * pServiceManager ,
void * pRegistryKey )
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index fcaaf00877..efd7862892 100755
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -982,42 +982,6 @@ extern "C"
}
/**
- * This function creates an implementation section in the registry and another subkey
- *
- * for each supported service.
- * @param pServiceManager the service manager
- * @param pRegistryKey the registry key
- */
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
- {
- if (::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey,
- ::scripting_runtimemgr::s_entries ))
- {
- try
- {
- // MasterScriptProviderFactory Mangager singleton
- registry::XRegistryKey * pKey =
- reinterpret_cast< registry::XRegistryKey * >(pRegistryKey);
-
- Reference< registry::XRegistryKey >xKey = pKey->createKey(
- OUSTR("com.sun.star.script.provider.MasterScriptProviderFactory/UNO/SINGLETONS/com.sun.star.script.provider.theMasterScriptProviderFactory"));
- xKey->setStringValue( OUSTR("com.sun.star.script.provider.MasterScriptProviderFactory") );
- // BrowseNodeFactory Mangager singleton
- xKey = pKey->createKey(
- OUSTR("com.sun.star.script.browse.BrowseNodeFactory/UNO/SINGLETONS/com.sun.star.script.browse.theBrowseNodeFactory"));
- xKey->setStringValue( OUSTR("com.sun.star.script.browse.BrowseNodeFactory") );
- return sal_True;
- }
- catch (Exception &)
- {
- }
- }
- return sal_False;
- }
-
- /**
* This function is called to get service factories for an implementation.
*
* @param pImplName name of implementation
diff --git a/scripting/source/provider/exports.dxp b/scripting/source/provider/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/scripting/source/provider/exports.dxp
+++ b/scripting/source/provider/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/pyprov/mailmerge.component b/scripting/source/pyprov/mailmerge.component
new file mode 100644
index 0000000000..dd6a65e9a1
--- /dev/null
+++ b/scripting/source/pyprov/mailmerge.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Python"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.pyuno.MailMessage">
+ <service name="com.sun.star.mail.MailMessage"/>
+ </implementation>
+ <implementation name="org.openoffice.pyuno.MailServiceProvider">
+ <service name="com.sun.star.mail.MailServiceProvider"/>
+ </implementation>
+</component>
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index 55c204f87d..6592a59d18 100644
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -153,8 +153,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
if len(textbody):
mimeEncoding = re.sub("charset=.*", "charset=UTF-8", flavor.MimeType)
- if mimeEncoding.find('charset=UTF-8') == -1:
- mimeEncoding = mimeEncoding + "; charset=UTF-8"
+ if mimeEncoding.find('charset=UTF-8') == -1:
+ mimeEncoding = mimeEncoding + "; charset=UTF-8"
textmsg['Content-Type'] = mimeEncoding
textmsg['MIME-Version'] = '1.0'
textmsg.set_payload(textbody)
diff --git a/scripting/source/pyprov/makefile.mk b/scripting/source/pyprov/makefile.mk
index 3c02785951..42c161adbb 100644
--- a/scripting/source/pyprov/makefile.mk
+++ b/scripting/source/pyprov/makefile.mk
@@ -47,3 +47,17 @@ $(DLLDEST)$/%.py: %.py
cp $? $@
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/mailmerge.component $(MISC)/pythonscript.component
+
+$(MISC)/mailmerge.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ mailmerge.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_PYTHON)mailmerge' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt mailmerge.component
+
+$(MISC)/pythonscript.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt pythonscript.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_PYTHON)pythonscript' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt pythonscript.component
diff --git a/scripting/source/pyprov/pythonscript.component b/scripting/source/pyprov/pythonscript.component
new file mode 100644
index 0000000000..08f8950972
--- /dev/null
+++ b/scripting/source/pyprov/pythonscript.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Python"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.pyuno.LanguageScriptProviderForPython">
+ <service name="com.sun.star.script.provider.LanguageScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProviderForPython"/>
+ </implementation>
+</component>
diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
index 6fa510c65e..e23265364b 100755
--- a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
+++ b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
@@ -486,68 +486,6 @@ extern "C"
}
/**
- * This function creates an implementation section in the registry and another subkey
- *
- * for each supported service.
- * @param pServiceManager the service manager
- * @param pRegistryKey the registry key
- */
- sal_Bool SAL_CALL component_writeInfo( lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
- {
- if (::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey,
- ::scripting_runtimemgr::s_entries ))
- {
- try
- {
- // register RuntimeManager singleton
-
- registry::XRegistryKey * pKey =
- reinterpret_cast< registry::XRegistryKey * >(pRegistryKey);
-
- Reference< registry::XRegistryKey > xKey(
- pKey->createKey(
-
- OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeManager")));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager") );
-
- // ScriptStorage Mangaer singleton
-
- xKey = pKey->createKey(
- OUSTR("drafts.com.sun.star.script.framework.storage.ScriptStorageManager/UNO/SINGLETONS/drafts.com.sun.star.script.framework.storage.theScriptStorageManager"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.storage.ScriptStorageManager") );
- // Singleton entries are not handled by the setup process
- // below is the only alternative at the momement which
- // is to programmatically do this.
-
- // "Java" Runtime singleton entry
-
- xKey = pKey->createKey(
- OUSTR("com.sun.star.scripting.runtime.java.ScriptRuntimeForJava$_ScriptRuntimeForJava/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForJava"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForJava") );
-
- // "JavaScript" Runtime singleton entry
-
- xKey = pKey->createKey(
- OUSTR("com.sun.star.scripting.runtime.javascript.ScriptRuntimeForJavaScript$_ScriptRuntimeForJavaScript/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForJavaScript"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForJavaScript") );
-
- // "BeanShell" Runtime singleton entry
-
- xKey = pKey->createKey(
- OUSTR("com.sun.star.scripting.runtime.beanshell.ScriptRuntimeForBeanShell$_ScriptRuntimeForBeanShell/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForBeanShell"));
- xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForBeanShell") );
-
- return sal_True;
- }
- catch (Exception & exc)
- {
- }
- }
- return sal_False;
- }
-
- /**
* This function is called to get service factories for an implementation.
*
* @param pImplName name of implementation
diff --git a/scripting/source/runtimemgr/exports.dxp b/scripting/source/runtimemgr/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/scripting/source/runtimemgr/exports.dxp
+++ b/scripting/source/runtimemgr/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/storage/exports.dxp b/scripting/source/storage/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/scripting/source/storage/exports.dxp
+++ b/scripting/source/storage/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/source/stringresource/makefile.mk b/scripting/source/stringresource/makefile.mk
index dfc2d19791..71f8ee39e7 100644
--- a/scripting/source/stringresource/makefile.mk
+++ b/scripting/source/stringresource/makefile.mk
@@ -60,3 +60,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/stringresource.component
+
+$(MISC)/stringresource.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt stringresource.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt stringresource.component
diff --git a/scripting/source/stringresource/stringresource.component b/scripting/source/stringresource/stringresource.component
new file mode 100644
index 0000000000..6d64d95539
--- /dev/null
+++ b/scripting/source/stringresource/stringresource.component
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.scripting.StringResource">
+ <service name="com.sun.star.resource.StringResource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.scripting.StringResourceWithLocation">
+ <service name="com.sun.star.resource.StringResourceWithLocation"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.scripting.StringResourceWithStorage">
+ <service name="com.sun.star.resource.StringResourceWithStorage"/>
+ </implementation>
+</component>
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 330ae8397b..bbde6609e0 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -3080,13 +3080,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::stringresource::s_component_entries );
- }
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk
index 1946c61d1e..287bbe2b05 100644..100755
--- a/scripting/source/vbaevents/makefile.mk
+++ b/scripting/source/vbaevents/makefile.mk
@@ -91,3 +91,11 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
echo $@
+
+ALLTAR : $(MISC)/vbaevents.component
+
+$(MISC)/vbaevents.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ vbaevents.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt vbaevents.component
diff --git a/scripting/source/vbaevents/service.cxx b/scripting/source/vbaevents/service.cxx
index ea2c44f1dc..1a6fe2927a 100755
--- a/scripting/source/vbaevents/service.cxx
+++ b/scripting/source/vbaevents/service.cxx
@@ -110,16 +110,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- OSL_TRACE("In component_writeInfo");
- if ( ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, s_component_entries ) )
- return sal_True;
- return sal_False;
- }
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/scripting/source/vbaevents/vbaevents.component b/scripting/source/vbaevents/vbaevents.component
new file mode 100644
index 0000000000..e8cbf3d88f
--- /dev/null
+++ b/scripting/source/vbaevents/vbaevents.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="ooo.vba.EventListener">
+ <service name="ooo.vba.EventListener"/>
+ </implementation>
+ <implementation name="ooo.vba.VBAToOOEventDesc">
+ <service name="ooo.vba.VBAToOOEventDesc"/>
+ </implementation>
+</component>
diff --git a/scripting/util/exports.dxp b/scripting/util/exports.dxp
index 9630d7e067..f0e1c69934 100644
--- a/scripting/util/exports.dxp
+++ b/scripting/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/scripting/util/makefile.mk b/scripting/util/makefile.mk
index f18970f164..04435caab1 100644
--- a/scripting/util/makefile.mk
+++ b/scripting/util/makefile.mk
@@ -65,3 +65,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/scriptframe.component
+
+$(MISC)/scriptframe.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt scriptframe.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt scriptframe.component
diff --git a/scripting/util/scriptframe.component b/scripting/util/scriptframe.component
new file mode 100644
index 0000000000..5b3fe8c396
--- /dev/null
+++ b/scripting/util/scriptframe.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.script.browse.BrowseNodeFactory">
+ <service name="com.sun.star.script.browse.BrowseNodeFactory"/>
+ <singleton name="com.sun.star.script.browse.theBrowseNodeFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.script.provider.MasterScriptProvider">
+ <service name="com.sun.star.script.browse.BrowseNode"/>
+ <service name="com.sun.star.script.provider.MasterScriptProvider"/>
+ <service name="com.sun.star.script.provider.ScriptProvider"/>
+ </implementation>
+ <implementation
+ name="com.sun.star.script.provider.MasterScriptProviderFactory">
+ <service name="com.sun.star.script.provider.MasterScriptProviderFactory"/>
+ <singleton
+ name="com.sun.star.script.provider.theMasterScriptProviderFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.script.provider.ScriptURIHelper">
+ <service name="com.sun.star.script.provider.ScriptURIHelper"/>
+ </implementation>
+</component>
diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx
index fe2667d128..3054278504 100644
--- a/sfx2/inc/sfx2/docfac.hxx
+++ b/sfx2/inc/sfx2/docfac.hxx
@@ -94,7 +94,7 @@ public:
USHORT GetViewFactoryCount() const;
SfxViewFactory& GetViewFactory(USHORT i = 0) const;
- /// returns the view factory whose GetViewName delivers the requested logical name
+ /// returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical name
SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const;
// Filter
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index cd43e0989d..8bed61e997 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -62,7 +62,6 @@ class Timer;
class SfxItemSet;
class DateTime;
class SvStringsDtor;
-class SvEaMgr;
#define S2BS(s) ByteString( s, RTL_TEXTENCODING_MS_1252 )
@@ -208,8 +207,6 @@ public:
SvStream* GetInStream();
SvStream* GetOutStream();
- SvEaMgr* GetEaMgr();
-
sal_Bool Commit();
sal_Bool IsStorage();
@@ -323,7 +320,6 @@ public:
static com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag > GetVersionList(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
- static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL );
static ::rtl::OUString CreateTempCopyWithExt( const ::rtl::OUString& aURL );
static sal_Bool CallApproveHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler, ::com::sun::star::uno::Any aRequest, sal_Bool bAllowAbort );
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index f2e6fb5c50..8e4dde2872 100755..100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -293,6 +293,7 @@ public:
sal_Bool IsReadOnlyUI() const;
void SetNoName();
sal_Bool IsInModalMode() const;
+ sal_Bool IsInPrepareClose() const;
//<!--Added by PengYunQuan for Validity Cell Range Picker
virtual sal_Bool AcceptStateUpdate() const;
//-->Added by PengYunQuan for Validity Cell Range Picker
@@ -346,6 +347,9 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
virtual void UpdateLinks();
+ // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action
+ virtual sal_Bool QuerySlotExecutable( USHORT nSlotId );
+
sal_Bool SaveChildren(BOOL bObjectsOnly=FALSE);
sal_Bool SaveAsChildren( SfxMedium &rMedium );
sal_Bool SwitchChildrenPersistance(
diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx
index 2953b95644..f070dd4676 100644
--- a/sfx2/inc/sfx2/sfxuno.hxx
+++ b/sfx2/inc/sfx2/sfxuno.hxx
@@ -73,7 +73,6 @@
#define UNOPROPERTYVALUE ::com::sun::star::beans::PropertyValue
#define UNOREFERENCE ::com::sun::star::uno::Reference
#define UNORUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
-#define UNOINVALIDREGISTRYEXCEPTION ::com::sun::star::registry::InvalidRegistryException
#define UNOSEQUENCE ::com::sun::star::uno::Sequence
#define UNOTYPE ::com::sun::star::uno::Type
#define UNOURL ::com::sun::star::util::URL
@@ -591,52 +590,6 @@ sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd );
}
//************************************************************************************************************************
-// definition for "extern c component_writeInfo()"
-//************************************************************************************************************************
-#define COMPONENT_INFO(CLASS) \
- \
- try \
- { \
- /* Set default result of follow operations !!! */ \
- bReturn = sal_False ; \
- \
- /* Do the follow only, if given key is valid ! */ \
- if ( xKey.is () ) \
- { \
- /* Build new keyname */ \
- sKeyName = UNOOUSTRING::createFromAscii( "/" ) ; \
- sKeyName += CLASS::impl_getStaticImplementationName() ; \
- sKeyName += UNOOUSTRING::createFromAscii( "/UNO/SERVICES" ); \
- \
- /* Create new key with new name. */ \
- xNewKey = xKey->createKey( sKeyName ); \
- \
- /* If this new key valid ... */ \
- if ( xNewKey.is () ) \
- { \
- /* Get information about supported services. */ \
- seqServiceNames = CLASS::impl_getStaticSupportedServiceNames() ; \
- pArray = seqServiceNames.getArray() ; \
- nLength = seqServiceNames.getLength() ; \
- nCounter = 0 ; \
- \
- /* Then set this information on this key. */ \
- for ( nCounter = 0; nCounter < nLength; ++nCounter ) \
- { \
- xNewKey->createKey( pArray [nCounter] ); \
- } \
- \
- /* Result of this operations = OK. */ \
- bReturn = sal_True ; \
- } \
- } \
- } \
- catch( UNOINVALIDREGISTRYEXCEPTION& ) \
- { \
- bReturn = sal_False ; \
- } \
-
-//************************************************************************************************************************
// definition for "extern c component_getFactory()"
//************************************************************************************************************************
#define CREATEFACTORY(CLASS) \
diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx
index f63d68525e..f173d6aac7 100644
--- a/sfx2/inc/sfx2/titledockwin.hxx
+++ b/sfx2/inc/sfx2/titledockwin.hxx
@@ -100,6 +100,11 @@ namespace sfx2
ToolBox& GetToolBox() { return m_aToolbox; }
const ToolBox& GetToolBox() const { return m_aToolbox; }
+ /** Return the border that is painted around the inner window as
+ decoration.
+ */
+ SvBorder GetDecorationBorder (void) const { return m_aBorder; }
+
protected:
// Window overridables
virtual void Paint( const Rectangle& i_rArea );
@@ -153,6 +158,11 @@ namespace sfx2
since the last Paint().
*/
bool m_bLayoutPending;
+
+ /** Height of the title bar. Calculated in impl_layout().
+ */
+ int m_nTitleBarHeight;
+
};
//......................................................................................................................
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 81b296b267..cf6bbf0b16 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -253,6 +253,7 @@ public:
private:
SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell );
+ SAL_DLLPRIVATE void SaveCurrentViewData_Impl( const USHORT i_nNewViewId );
/** loads the given existing document into the given frame
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 0e8bc90260..f60c58b283 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -123,13 +123,13 @@ public: \
static SfxViewFactory&Factory() { return *pFactory; } \
static void InitFactory()
-#define SFX_IMPL_VIEWFACTORY(Class, rResId) \
+#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
SfxViewFactory* Class::pFactory; \
SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
{ return new Class(pFrame, pOldView); } \
void Class::RegisterFactory( USHORT nPrio ) \
{ \
- pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,rResId);\
+ pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,AsciiViewName);\
InitFactory(); \
} \
void Class::InitFactory()
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
index 0ab7159ae2..15462c3361 100644
--- a/sfx2/inc/viewfac.hxx
+++ b/sfx2/inc/viewfac.hxx
@@ -46,24 +46,29 @@ class SFX2_DLLPUBLIC SfxViewFactory
{
public:
SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
- USHORT nOrdinal, const ResId& aDescrResId );
+ USHORT nOrdinal, const sal_Char* asciiViewName );
~SfxViewFactory();
SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
void InitFactory();
- String GetDescription() const
- { return String( aDescription ); }
USHORT GetOrdinal() const { return nOrd; }
- /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID
- String GetViewName() const;
+ /// returns a legacy view name. This is "view" with an appended ordinal/ID.
+ String GetLegacyViewName() const;
+
+ /** returns a API-compatible view name.
+
+ For details on which view names are specified, see the XModel2.getAvailableViewControllerNames
+ documentation.
+ */
+ String GetAPIViewName() const;
private:
SfxViewCtor fnCreate;
SfxViewInit fnInit;
USHORT nOrd;
- ResId aDescription;
+ const String m_sViewName;
};
#endif
diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst
index 0748aa19cd..0768000425 100644
--- a/sfx2/prj/d.lst
+++ b/sfx2/prj/d.lst
@@ -44,3 +44,4 @@ mkdir: %_DEST%\inc%_EXT%\sfx2
..\inc\mailmodelapi.hxx %_DEST%\inc%_EXT%\sfx2\mailmodelapi.hxx
..\inc\docinsert.hxx %_DEST%\inc%_EXT%\sfx2\docinsert.hxx
+..\%__SRC%\misc\sfx.component %_DEST%\xml%_EXT%\sfx.component
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk
index 2794c2ae92..dce0b86a06 100644
--- a/sfx2/qa/cppunit/makefile.mk
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx
index 903be69203..6a0be13a9c 100644
--- a/sfx2/qa/cppunit/test_metadatable.cxx
+++ b/sfx2/qa/cppunit/test_metadatable.cxx
@@ -27,10 +27,12 @@
#include "precompiled_sfx2.hxx"
+#include "preextstl.h"
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
+#include "postextstl.h"
#include <rtl/ustrbuf.hxx>
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index ca8062bcb7..de333ac5a7 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -129,7 +129,7 @@
#include <sfx2/mnuitem.hxx>
#endif
-#if defined( WIN ) || defined( WNT ) || defined( OS2 )
+#if defined( WNT ) || defined( OS2 )
#define DDE_AVAILABLE
#endif
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 4cde428a57..3f724038e6 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -30,9 +30,6 @@
#include <basic/basmgr.hxx>
#include <basic/sbstar.hxx>
-#ifdef WIN
-#define _TL_LANG_SPECIAL
-#endif
#include <svl/svdde.hxx>
#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 2a7bb3f56d..3768fe1409 100755..100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -2124,166 +2124,6 @@ SFX2_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment(
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo(
- void* ,
- void* pRegistryKey )
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ) ) ;
-
- // register actual implementations and their services
- ::rtl::OUString aImpl;
- ::rtl::OUString aTempStr;
- ::rtl::OUString aKeyStr;
- Reference< XRegistryKey > xNewKey;
- Reference< XRegistryKey > xLoaderKey;
-
- // PluginObject
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::PluginObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
-
- #if 0
- // AppletObject
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::AppletObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
- #endif
-
- // IFrameObject
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::IFrameObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") );
-
- // global app event broadcaster
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxGlobalEvents_Impl::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster") );
-
- // global app dispatcher
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxAppDispatchProvider::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ProtocolHandler") );
-
- // standalone document info
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxStandaloneDocumentInfoObject::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.document.StandaloneDocumentInfo") );
-
- // frame loader
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxFrameLoader_Impl::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- Sequence < ::rtl::OUString > aServices = SfxFrameLoader_Impl::impl_getStaticSupportedServiceNames();
- sal_Int32 nCount = aServices.getLength();
- for ( sal_Int16 i=0; i<nCount; i++ )
- xNewKey->createKey( aServices.getConstArray()[i] );
-
- // macro loader
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxMacroLoader::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ProtocolHandler") );
-
- // - sfx document templates
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxDocTplService::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.DocumentTemplates") );
-
- // quickstart wrapper service
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ShutdownIcon::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.office.Quickstart") );
-
- // application script library container service
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.script.ApplicationScriptLibraryContainer") );
-
- // application dialog library container service
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.script.ApplicationDialogLibraryContainer") );
-
- // converter of fs folders to packages
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += OPackageStructureCreator::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- Sequence< ::rtl::OUString > rServices = OPackageStructureCreator::impl_getStaticSupportedServiceNames();
- for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
- xNewKey->createKey( rServices.getConstArray()[ind] );
-
- // subfilter to parse a stream in OASIS format generated by the filter
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += ::sfx2::OwnSubFilterService::impl_getStaticImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- rServices = ::sfx2::OwnSubFilterService::impl_getStaticSupportedServiceNames();
- for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
- xNewKey->createKey( rServices.getConstArray()[ind] );
-
- // document meta data
- aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += comp_SfxDocumentMetaData::_getImplementationName();
-
- aTempStr = aImpl;
- aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey( aTempStr );
- xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentProperties") );
-
- return sal_True;
-}
-
SFX2_DLLPUBLIC void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName ,
void* pServiceManager ,
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 8db6fb93dd..fd642941b4 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
#include <tools/svwin.h>
#endif
@@ -211,7 +211,7 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/,
BOOL SvDDEObject::Connect( SvBaseLink * pSvLink )
{
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
static BOOL bInWinExec = FALSE;
#endif
USHORT nLinkType = pSvLink->GetUpdateMode();
@@ -258,7 +258,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink )
// ansonsten unter Win/WinNT die Applikation direkt starten
}
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
// Server nicht da, starten und nochmal versuchen
if( !bInWinExec )
@@ -291,7 +291,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink )
}
}
else
-#endif // WIN / WNT
+#endif // WNT
{
nError = DDELINK_ERROR_APP;
}
diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk
index 72ac94a9b3..30f7435507 100644
--- a/sfx2/source/appl/makefile.mk
+++ b/sfx2/source/appl/makefile.mk
@@ -101,7 +101,6 @@ SFX_OBJECTS = \
$(SLO)$/module.obj \
$(SLO)$/newhelp.obj \
$(SLO)$/opengrf.obj \
- $(SLO)$/sfxdll.obj \
$(SLO)$/sfxhelp.obj \
$(SLO)$/sfxpicklist.obj \
$(SLO)$/shutdownicon.obj \
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 521a6c3257..6c596bea3d 100755..100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1525,19 +1525,6 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
{
// Dateiname
String aFile( pInfoItem->GetValue() );
-#ifdef WIN
- if ( aFile.Len() <= 8 )
- {
- String sTmp( SfxResId( STR_NONAME ) );
- USHORT nLen = Min( (USHORT)8, sTmp.Len() );
-
- if ( sTmp.Copy( 0, nLen ).Lower() ==
- aFile.Copy( 0, nLen ).Lower() )
- {
- aFile = pInfoItem->GetValue();
- }
- }
-#endif
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 0d76af8d26..07faf55df9 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1954,7 +1954,7 @@ void FileDialogHelper_Impl::addGraphicFilter()
}
}
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if ( aExtensions.Len() > 240 )
aExtensions = DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL );
#endif
@@ -2748,7 +2748,7 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath )
if ( sFolder.getLength() == 0 )
{
// _rPath is not a valid path -> fallback to home directory
- NAMESPACE_VOS( OSecurity ) aSecurity;
+ vos:: OSecurity aSecurity;
aSecurity.getHomeDir( sFolder );
}
mpImp->displayFolder( sFolder );
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 5577170c90..4f9b41a0dd 100755..100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -245,6 +245,36 @@ SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const Sfx
m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE );
m_aRecordChangesCB.SetToggleHdl( LINK( this, SfxSecurityPage_Impl, RecordChangesCBToggleHdl ) );
m_aChangeProtectionPB.SetClickHdl( LINK( this, SfxSecurityPage_Impl, ChangeProtectionPBHdl ) );
+
+
+ // #i112277: for the time being (OOO 3.3) the following options should not
+ // be available. In the long run however it is planned to implement the yet
+ // missing functionality. Thus now we hide them and move the remaining ones up.
+ m_aNewPasswordToOpenFL.Hide();
+ m_aNewPasswordToOpenFT.Hide();
+ m_aNewPasswordToOpenED.Hide();
+ m_aConfirmPasswordToOpenFT.Hide();
+ m_aConfirmPasswordToOpenED.Hide();
+ m_aNewPasswordInfoFT.Hide();
+ m_aNewPasswordToModifyFL.Hide();
+ m_aNewPasswordToModifyFT.Hide();
+ m_aNewPasswordToModifyED.Hide();
+ m_aConfirmPasswordToModifyFT.Hide();
+ m_aConfirmPasswordToModifyED.Hide();
+ const long nDelta = m_aOptionsFL.GetPosPixel().Y() - m_aNewPasswordToOpenFL.GetPosPixel().Y();
+ Point aPos;
+ aPos = m_aOptionsFL.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aOptionsFL.SetPosPixel( aPos );
+ aPos = m_aOpenReadonlyCB.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aOpenReadonlyCB.SetPosPixel( aPos );
+ aPos = m_aRecordChangesCB.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aRecordChangesCB.SetPosPixel( aPos );
+ aPos = m_aChangeProtectionPB.GetPosPixel();
+ aPos.Y() -= nDelta;
+ m_aChangeProtectionPB.SetPosPixel( aPos );
}
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index 35da8e2593..ed29ae0032 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -253,10 +253,11 @@ namespace sfx2
pWindow->SetHelpId( HID_TASKPANE_WINDOW );
pWindow->SetOutputSizePixel( Size( 300, 450 ) );
- pWindow->Show();
dynamic_cast< SfxDockingWindow* >( pWindow )->Initialize( i_pInfo );
SetHideNotDelete( TRUE );
+
+ pWindow->Show();
}
//------------------------------------------------------------------------------------------------------------------
@@ -584,6 +585,7 @@ namespace sfx2
return;
::rtl::OUString sFirstVisiblePanelResource;
+ ::rtl::OUString sFirstPanelResource;
const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() );
for ( const ::rtl::OUString* resource = aUIElements.getConstArray();
@@ -594,6 +596,8 @@ namespace sfx2
if ( !impl_isToolPanelResource( *resource ) )
continue;
+ sFirstPanelResource = *resource;
+
::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) );
::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) );
@@ -620,6 +624,9 @@ namespace sfx2
sFirstVisiblePanelResource = *resource;
}
+ if ( sFirstVisiblePanelResource.getLength() == 0 )
+ sFirstVisiblePanelResource = sFirstPanelResource;
+
if ( sFirstVisiblePanelResource.getLength() )
{
::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) );
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index b264561275..89a22ee062 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -51,6 +51,7 @@ namespace sfx2
,m_aContentWindow( this, WB_DIALOGCONTROL )
,m_aBorder( 3, 1, 3, 3 )
,m_bLayoutPending( false )
+ ,m_nTitleBarHeight(0)
{
impl_construct();
}
@@ -139,23 +140,23 @@ namespace sfx2
Size aWindowSize( GetOutputSizePixel() );
// position the tool box
- int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() );
- if ( aToolBoxSize.Height() > nTitleBarHeight )
- nTitleBarHeight = aToolBoxSize.Height();
+ m_nTitleBarHeight = GetSettings().GetStyleSettings().GetTitleHeight();
+ if ( aToolBoxSize.Height() > m_nTitleBarHeight )
+ m_nTitleBarHeight = aToolBoxSize.Height();
m_aToolbox.SetPosSizePixel(
Point(
aWindowSize.Width() - aToolBoxSize.Width(),
- ( nTitleBarHeight - aToolBoxSize.Height() ) / 2
+ ( m_nTitleBarHeight - aToolBoxSize.Height() ) / 2
),
aToolBoxSize
);
// Place the content window.
- if ( nTitleBarHeight < aToolBoxSize.Height() )
- nTitleBarHeight = aToolBoxSize.Height();
- aWindowSize.Height() -= nTitleBarHeight;
+ if ( m_nTitleBarHeight < aToolBoxSize.Height() )
+ m_nTitleBarHeight = aToolBoxSize.Height();
+ aWindowSize.Height() -= m_nTitleBarHeight;
m_aContentWindow.SetPosSizePixel(
- Point( m_aBorder.Left(), nTitleBarHeight + m_aBorder.Top() ),
+ Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ),
Size(
aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(),
aWindowSize.Height() - m_aBorder.Top() - m_aBorder.Bottom()
@@ -175,11 +176,6 @@ namespace sfx2
Push( PUSH_FONT | PUSH_FILLCOLOR | PUSH_LINECOLOR );
- int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() );
- const Size aToolBoxSize = m_aToolbox.CalcWindowSizePixel();
- if ( aToolBoxSize.Height() > nTitleBarHeight )
- nTitleBarHeight = aToolBoxSize.Height();
-
SetFillColor( GetSettings().GetStyleSettings().GetDialogColor() );
SetLineColor();
@@ -194,7 +190,7 @@ namespace sfx2
int nInnerLeft = nOuterLeft + m_aBorder.Left() - 1;
int nOuterRight = aWindowSize.Width() - 1;
int nInnerRight = nOuterRight - m_aBorder.Right() + 1;
- int nInnerTop = nTitleBarHeight + m_aBorder.Top() - 1;
+ int nInnerTop = m_nTitleBarHeight + m_aBorder.Top() - 1;
int nOuterBottom = aWindowSize.Height() - 1;
int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1;
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index bf6782ef7e..5336b5cfe5 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -45,6 +45,8 @@
#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
+#include <rtl/uri.hxx>
+#include <rtl/bootstrap.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/makesequence.hxx>
@@ -136,6 +138,24 @@ uno::Reference<rdf::XURI> createBaseURI(
throw uno::RuntimeException();
}
+ // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs
+ // this really should be done somewhere else, not here.
+ ::rtl::OUString pkgURI(i_rPkgURI);
+ if (pkgURI.matchIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:")))
+ {
+ // expand it here (makeAbsolute requires hierarchical URI)
+ pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") );
+ if (pkgURI.getLength() != 0) {
+ pkgURI = ::rtl::Uri::decode(
+ pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8);
+ if (pkgURI.getLength() == 0) {
+ throw uno::RuntimeException();
+ }
+ ::rtl::Bootstrap::expandMacros(pkgURI);
+ }
+ }
+
const uno::Reference<lang::XMultiComponentFactory> xServiceFactory(
i_xContext->getServiceManager(), uno::UNO_SET_THROW);
const uno::Reference<uri::XUriReferenceFactory> xUriFactory(
@@ -146,11 +166,12 @@ uno::Reference<rdf::XURI> createBaseURI(
uno::Reference< uri::XUriReference > xBaseURI;
const uno::Reference< uri::XUriReference > xPkgURI(
- xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW );
+ xUriFactory->parse(pkgURI), uno::UNO_SET_THROW );
xPkgURI->clearFragment();
+
// need to know whether the storage is a FileSystemStorage
// XServiceInfo would be better, but it is not implemented
-// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) )
+// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) )
if (true) {
xBaseURI.set( xPkgURI, uno::UNO_SET_THROW );
#if 0
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 95fe000709..16a9ba4603 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -2380,12 +2380,5 @@ extern "C" void * SAL_CALL component_getFactory(
return ::cppu::component_getFactoryHelper(
implName, serviceManager, registryKey, entries);
}
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return ::cppu::component_writeInfoHelper(serviceManager, registryKey,
- entries);
-}
#endif
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 448d89b7d2..47a46fc1ca 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory
SfxViewFactory &rFactory
)
{
+#if OSL_DEBUG_LEVEL > 0
+ {
+ const String sViewName( rFactory.GetAPIViewName() );
+ for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i )
+ {
+ if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) )
+ continue;
+ ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" );
+ sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US );
+ sMessage += "'!";
+ OSL_ENSURE( false, sMessage.GetBuffer() );
+ break;
+ }
+ }
+#endif
sal_uInt16 nPos;
for ( nPos = 0;
nPos < pImpl->aViewFactoryArr.Count() &&
@@ -467,7 +482,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie
)
{
SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) );
- if ( rViewFac.GetViewName() == i_rViewName )
+ if ( ( rViewFac.GetAPIViewName() == i_rViewName )
+ || ( rViewFac.GetLegacyViewName() == i_rViewName )
+ )
return &rViewFac;
}
return NULL;
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 43d98d1c04..f0d3511716 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3717,53 +3717,6 @@ void SfxMedium::SetCachedSignatureState_Impl( sal_uInt16 nState )
pImp->m_nSignatureState = nState;
}
-//----------------------------------------------------------------
-sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL )
-{
- sal_Bool bResult = sal_False;
-
- if ( aFirstURL.getLength() && aSecondURL.getLength() )
- {
- INetURLObject aFirst( aFirstURL );
- INetURLObject aSecond( aSecondURL );
-
- if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID )
- {
- try
- {
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- if ( !pBroker )
- throw uno::RuntimeException();
-
- uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac
- = pBroker->getContentIdentifierFactoryInterface();
- if ( !xIdFac.is() )
- throw uno::RuntimeException();
-
- uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst
- = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) );
- uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond
- = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) );
-
- if ( xIdFirst.is() && xIdSecond.is() )
- {
- uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider =
- pBroker->getContentProviderInterface();
- if ( !xProvider.is() )
- throw uno::RuntimeException();
- bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond );
- }
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" );
- }
- }
- }
-
- return bResult;
-}
-
BOOL SfxMedium::HasStorage_Impl() const
{
return pImp->xStorage.is();
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 72fe259c12..879e1b534e 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1919,7 +1919,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
aStoreArgs[1].Value <<= rTemplateName;
::rtl::OUString aCurrentDocumentURL = rStorable->getLocation();
- if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
+ if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
else
rStorable->store();
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 5b91b31fcf..343f880581 100755..100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -732,7 +732,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL )
SetSharedXMLFlag( sal_False );
if ( IsDocShared() && aTempFileURL.getLength()
- && !SfxMedium::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
+ && !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
{
if ( pImp->m_bAllowShareControlFileClean )
{
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 795f5a20ca..ee8e57a667 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -489,6 +489,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_SAVEASDOC:
case SID_SAVEDOC:
{
+ // derived class may decide to abort this
+ if( !QuerySlotExecutable( nId ) )
+ {
+ rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) );
+ return;
+ }
+
//!! detaillierte Auswertung eines Fehlercodes
SfxObjectShellRef xLock( this );
@@ -895,7 +902,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
rReq.Done();
}
-//--------------------------------------------------------------------
+//-------------------------------------------------------------------------
void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
{
@@ -1337,8 +1344,13 @@ sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent )
void SfxObjectShell::ImplSign( sal_Bool bScriptingContent )
{
// Check if it is stored in OASIS format...
- if ( GetMedium() && GetMedium()->GetFilter()
- && ( !GetMedium()->GetFilter()->IsOwnFormat() || !GetMedium()->HasStorage_Impl() ) )
+ if ( GetMedium()
+ && GetMedium()->GetFilter()
+ && GetMedium()->GetName().Len()
+ && ( !GetMedium()->GetFilter()->IsOwnFormat()
+ || !GetMedium()->HasStorage_Impl()
+ )
+ )
{
// Only OASIS and OOo6.x formats will be handled further
InfoBox( NULL, SfxResId( RID_XMLSEC_INFO_WRONGDOCFORMAT ) ).Execute();
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 8d0fea6811..234c17b65c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -195,6 +195,13 @@ sal_Bool SfxObjectShell::SaveAs( SfxMedium& rMedium )
//-------------------------------------------------------------------------
+sal_Bool SfxObjectShell::QuerySlotExecutable( USHORT /*nSlotId*/ )
+{
+ return sal_True;
+}
+
+//-------------------------------------------------------------------------
+
sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd )
{
const SfxPoolItem* pItem = NULL;
@@ -1182,7 +1189,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( pMedium
&& pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
&& rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
+ && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
{
bStoreToSameLocation = sal_True;
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
@@ -1910,7 +1917,25 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl(
bResult = SaveCompleted( xTmpStorage );
if ( bResult )
+ {
pImp->pBasicManager->setStorage( xTmpStorage );
+
+ // Get rid of this workaround after issue i113914 is fixed
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW );
+ xBasicLibraries->setRootStorage( xTmpStorage );
+ }
+ catch( uno::Exception& )
+ {}
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW );
+ xDialogLibraries->setRootStorage( xTmpStorage );
+ }
+ catch( uno::Exception& )
+ {}
+ }
}
catch( uno::Exception& )
{}
@@ -2056,6 +2081,22 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
// TODO/LATER: may be this code will be replaced, but not sure
// Set storage in document library containers
pImp->pBasicManager->setStorage( xStorage );
+
+ // Get rid of this workaround after issue i113914 is fixed
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW );
+ xBasicLibraries->setRootStorage( xStorage );
+ }
+ catch( uno::Exception& )
+ {}
+ try
+ {
+ uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW );
+ xDialogLibraries->setRootStorage( xStorage );
+ }
+ catch( uno::Exception& )
+ {}
}
else
{
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 11268aeab5..a9a75831e2 100755..100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -526,6 +526,13 @@ SfxObjectShell* SfxObjectShell::Current()
return pFrame ? pFrame->GetObjectShell() : 0;
}
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsInPrepareClose() const
+{
+ return pImp->bInPrepareClose;
+}
+
//------------------------------------------------------------------------
struct BoolEnv_Impl
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 2486f4e9fb..24a68de511 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -95,6 +95,7 @@
#include <framework/titlehelper.hxx>
#include <comphelper/numberedcollection.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/ucbhelper.hxx>
//________________________________________________________________________________________________________
// includes of my own project
@@ -977,6 +978,8 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
aArgs.remove( "BreakMacroSignature" );
aArgs.remove( "Stream" );
aArgs.remove( "InputStream" );
+ aArgs.remove( "URL" );
+ aArgs.remove( "Frame" );
// TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here
@@ -988,6 +991,10 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
SfxAllItemSet aSet( pObjectShell->GetPool() );
TransformParameters( SID_OPENDOC, rArgs, aSet );
+ // the arguments are not allowed to reach the medium
+ aSet.ClearItem( SID_FILE_NAME );
+ aSet.ClearItem( SID_FILLFRAME );
+
pMedium->GetItemSet()->Put( aSet );
SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False );
if ( pItem )
@@ -2642,7 +2649,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
sal_Bool bSaved = sal_False;
if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength()
&& sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL
- && SfxMedium::EqualURLs( getLocation(), sURL ) )
+ && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) )
{
// this is the same file URL as the current document location, try to use storeOwn if possible
@@ -3805,7 +3812,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon
Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount );
for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo )
- aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName();
+ aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName();
return aViewNames;
}
@@ -3819,7 +3826,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef
SfxModelGuard aGuard( *this );
const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory();
- const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName();
+ const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetAPIViewName();
aGuard.clear();
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index 8269611c97..e1c50e4f3f 100755
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -60,6 +60,7 @@
#include <osl/file.hxx>
#include <vcl/graph.hxx>
#include <svtools/filter.hxx>
+#include <svl/lngmisc.hxx>
#include <sfx2/mnumgr.hxx>
@@ -244,7 +245,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu )
//! item ids should start with values > 0, since 0 has special meaning
const USHORT nId = i + 1;
- String aItemText( GetThesaurusReplaceText_Impl( aSynonyms[i] ) );
+ String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) );
pThesSubMenu->InsertItem( nId, aItemText );
::rtl::OUString aCmd( ::rtl::OUString::createFromAscii( ".uno:ThesaurusFromContext?WordReplace:string=" ) );
aCmd += aItemText;
@@ -578,6 +579,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
return 0;
}
+
void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, Window* pWindow )
{
PopupMenu *pSVMenu = new PopupMenu( rResId );
@@ -622,6 +624,12 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
SfxPopupMenuManager aPop( pSVMenu, pFrame->GetBindings() );
aPop.RemoveDisabledEntries();
aPop.Execute( rPoint, pWindow );
+
+ // #i112646 avoid crash when context menu is closed.
+ // the (manually inserted) sub-menu needs to be destroyed before
+ // aPop gets destroyed.
+ delete pThesSubMenu;
+ pThesSubMenu = 0;
}
delete pThesSubMenu;
@@ -631,3 +639,4 @@ Menu* SfxPopupMenuManager::GetSVMenu()
{
return (Menu*) GetMenu()->GetSVMenu();
}
+
diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx
index a47e1b18a4..b153196cd5 100755
--- a/sfx2/source/menu/thessubmenu.cxx
+++ b/sfx2/source/menu/thessubmenu.cxx
@@ -61,39 +61,6 @@ SFX_IMPL_MENU_CONTROL(SfxThesSubMenuControl, SfxStringItem);
////////////////////////////////////////////////////////////
-String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText )
-{
- // The strings returned by the thesaurus sometimes have some
- // explanation text put in between '(' and ')' or a trailing '*'.
- // These parts should not be put in the ReplaceEdit Text that may get
- // inserted into the document. Thus we strip them from the text.
-
- String aText( rText );
-
- xub_StrLen nPos = aText.Search( sal_Unicode('(') );
- while (STRING_NOTFOUND != nPos)
- {
- xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos );
- if (STRING_NOTFOUND != nEnd)
- aText.Erase( nPos, nEnd-nPos+1 );
- else
- break;
- nPos = aText.Search( sal_Unicode('(') );
- }
-
- nPos = aText.Search( sal_Unicode('*') );
- if (STRING_NOTFOUND != nPos)
- aText.Erase( nPos );
-
- // remove any possible remaining ' ' that may confuse the thesaurus
- // when it gets called with the text
- aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
-
- return aText;
-}
-
-////////////////////////////////////////////////////////////
-
/*
Ctor; setzt Select-Handler am Menu und traegt Menu
diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx
index 13438a917a..ccc5ccde66 100644..100755
--- a/sfx2/source/menu/thessubmenu.hxx
+++ b/sfx2/source/menu/thessubmenu.hxx
@@ -46,10 +46,6 @@ namespace css = ::com::sun::star;
////////////////////////////////////////////////////////////
-String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText );
-
-////////////////////////////////////////////////////////////
-
class SfxThesSubMenuControl : public SfxMenuControl
{
PopupMenu* pMenu;
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index c9876ce1f0..5b302047ac 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -280,10 +280,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI
aLoadArgs = aArgs.getPropertyValues();
// load the doc into that frame
- ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() );
- if ( sLoaderURL.getLength() == 0 )
- sLoaderURL = rDoc.GetFactory().GetFactoryURL();
-
+ ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW );
xLoader->loadComponentFromURL(
sLoaderURL,
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index f59b80b84c..03c2289283 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -650,7 +650,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
// ensure the ID of the to-be-created view is in the descriptor, if possible
const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor );
const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
- const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() );
+ const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() );
// if the document is created hidden, prevent it from being deleted until it is shown or disposed
impl_lockHiddenDocument( *xDoc, aDescriptor );
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 339e1bfcad..1d65579ea3 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -118,6 +118,7 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::awt::XWindow;
using ::com::sun::star::frame::XController;
@@ -579,7 +580,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run
::rtl::OUString sViewName;
if ( nViewNo < rDocFac.GetViewFactoryCount() )
- sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName();
+ sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName();
return sViewName;
}
@@ -1421,20 +1422,52 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
// if so, forward it to the view/shell.
if ( !bHasPluginMode && !bHasJumpMark )
{
+ // Note that this might not be the ideal place here. Restoring view data should, IMO, be the
+ // responsibility of the loader, not an implementation detail burried here deep within the controller's
+ // implementation.
+ // What I think should be done to replace the below code:
+ // - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts
+ // a string only), and forward it to its ViewShell's ReadUserDataSequence
+ // - change the frame loader so that when a new document is loaded (as opposed to an existing
+ // document being loaded into a new frame), the model's view data is examine the very same
+ // way as below, and the proper view data is set via XController::restoreViewData
+ // - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview
+ // view is exchanged, and sets the old view's data at the model. It should also care for the other
+ // way, were the PrintPreview view is left: in this case, the new view should also be initialized
+ // with the model's view data
try
{
- Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY );
- Reference< XIndexAccess > xViewData;
- if ( xViewDataSupplier.is() )
- xViewData = xViewDataSupplier->getViewData();
- if ( xViewData.is() && xViewData->getCount() > 0 )
+ Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW );
+ Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW );
+
+ // find the view data item whose ViewId matches the ID of the view we're just connecting to
+ const SfxObjectFactory& rDocFactory( rDoc.GetFactory() );
+ const sal_Int32 nCount = xViewData->getCount();
+ sal_Int32 nViewDataIndex = 0;
+ for ( sal_Int32 i=0; i<nCount; ++i )
{
- Sequence< PropertyValue > aViewData;
- if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) )
+ const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
+ ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+ if ( sViewId.getLength() == 0 )
+ continue;
+
+ const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
+ if ( pViewFactory == NULL )
+ continue;
+
+ if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() )
{
- m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+ nViewDataIndex = i;
+ break;
}
}
+ if ( nViewDataIndex < nCount )
+ {
+ Sequence< PropertyValue > aViewData;
+ OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData );
+ if ( aViewData.getLength() > 0 )
+ m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+ }
}
catch( const Exception& )
{
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index 57187cda67..70a076bc71 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -49,7 +49,7 @@ void SfxViewFactory::InitFactory()
(*fnInit)();
}
-String SfxViewFactory::GetViewName() const
+String SfxViewFactory::GetLegacyViewName() const
{
::rtl::OUStringBuffer aViewName;
aViewName.appendAscii( "view" );
@@ -57,18 +57,27 @@ String SfxViewFactory::GetViewName() const
return aViewName.makeStringAndClear();
}
+String SfxViewFactory::GetAPIViewName() const
+{
+ if ( m_sViewName.Len() > 0 )
+ return m_sViewName;
+
+ if ( GetOrdinal() == 0 )
+ return String::CreateFromAscii( "Default" );
+
+ return GetLegacyViewName();
+}
+
// CTOR / DTOR -----------------------------------------------------------
SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
- USHORT nOrdinal, const ResId& aDescrResId ):
+ USHORT nOrdinal, const sal_Char* asciiViewName ):
fnCreate(fnC),
fnInit(fnI),
nOrd(nOrdinal),
- aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr())
+ m_sViewName( String::CreateFromAscii( asciiViewName ) )
{
- aDescription.SetRT(aDescrResId.GetRT());
DBG_CTOR(SfxViewFactory, 0);
-// SFX_APP()->RegisterViewFactory_Impl(*this);
}
SfxViewFactory::~SfxViewFactory()
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 21d10471fc..2cfda86cdb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -75,6 +75,8 @@
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
#include <rtl/ustrbuf.hxx>
#include <unotools/localfilehelper.hxx>
@@ -96,6 +98,7 @@
#include <comphelper/storagehelper.hxx>
#include <svtools/asynclink.hxx>
#include <svl/sharecontrolfile.hxx>
+#include <framework/framelistanalyzer.hxx>
#include <boost/optional.hpp>
@@ -106,6 +109,8 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using ::com::sun::star::awt::XWindow;
using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::document::XViewDataSupplier;
+using ::com::sun::star::container::XIndexContainer;
namespace css = ::com::sun::star;
#ifndef GCC
@@ -813,6 +818,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
xNewObj->SetModifyPasswordEntered( sal_False );
xNewObj->SetReadOnly();
}
+ else if ( rReq.GetSlot() == SID_EDITDOC && bForEdit && !xNewObj->IsReadOnlyMedium() )
+ {
+ // the filter might request setting of the document to readonly state
+ // but in case of SID_EDITDOC it should not happen if the document
+ // can be opened for editing
+ xNewObj->SetReadOnlyUI( sal_False );
+ }
if ( xNewObj->IsDocShared() )
{
@@ -1172,10 +1184,6 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame )
DBG_CHKTHIS(SfxViewFrame, 0);
SFX_APP();
-#ifdef WIN
- pSfxApp->TestFreeResources_Impl();
-#endif
-
pDispatcher->DoActivate_Impl( bUI, pOldFrame );
// Wenn ich einen parent habe und dieser ist kein parent des alten
@@ -1240,9 +1248,6 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame )
pFrame = pFrame->GetParentViewFrame();
}
}
-#ifdef WIN
- pSfxApp->TestFreeResources_Impl();
-#endif
}
//------------------------------------------------------------------------
@@ -2085,7 +2090,25 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell
{
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
- xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+
+ if ( !i_bHidden )
+ {
+ try
+ {
+ // if there is a backing component, use it
+ Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW );
+ ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT );
+
+ if ( aAnalyzer.m_xBackingComponent.is() )
+ xFrame = aAnalyzer.m_xBackingComponent;
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ if ( !xFrame.is() )
+ xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+
bOwnFrame = true;
}
@@ -2144,6 +2167,8 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc
aTransformLoadArgs.remove( "Hidden" );
::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
+ if ( !sURL.getLength() )
+ sURL = i_rDoc.GetFactory().GetFactoryURL();
Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW );
xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0,
@@ -2233,6 +2258,72 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c
//--------------------------------------------------------------------
+void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId )
+{
+ SfxViewShell* pCurrentShell = GetViewShell();
+ ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" );
+
+ // determine the logical (API) view name
+ const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() );
+ const sal_uInt16 nCurViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 );
+ const String sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName();
+ const sal_uInt16 nNewViewNo = rDocFactory.GetViewNo_Impl( i_nNewViewId, 0 );
+ const String sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName();
+ if ( ( sCurrentViewName.Len() == 0 ) || ( sNewViewName.Len() == 0 ) )
+ {
+ // can't say anything about the view, the respective application did not yet migrate its code to
+ // named view factories => bail out
+ OSL_ENSURE( false, "SfxViewFrame::SaveCurrentViewData_Impl: views without API names? Shouldn't happen anymore?" );
+ return;
+ }
+ OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" );
+
+ // save the view data only when we're moving from a non-print-preview to the print-preview view
+ if ( !sNewViewName.EqualsAscii( "PrintPreview" ) )
+ return;
+
+ // retrieve the view data from the view
+ Sequence< PropertyValue > aViewData;
+ pCurrentShell->WriteUserDataSequence( aViewData );
+
+ try
+ {
+ // retrieve view data (for *all* views) from the model
+ const Reference< XController > xController( pCurrentShell->GetController(), UNO_SET_THROW );
+ const Reference< XViewDataSupplier > xViewDataSupplier( xController->getModel(), UNO_QUERY_THROW );
+ const Reference< XIndexContainer > xViewData( xViewDataSupplier->getViewData(), UNO_QUERY_THROW );
+
+ // look up the one view data item which corresponds to our current view, and remove it
+ const sal_Int32 nCount = xViewData->getCount();
+ for ( sal_Int32 i=0; i<nCount; ++i )
+ {
+ const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) );
+ ::rtl::OUString sViewId( aCurViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+ if ( sViewId.getLength() == 0 )
+ continue;
+
+ const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
+ if ( pViewFactory == NULL )
+ continue;
+
+ if ( pViewFactory->GetOrdinal() == GetCurViewId() )
+ {
+ xViewData->removeByIndex(i);
+ break;
+ }
+ }
+
+ // then replace it with the most recent view data we just obtained
+ xViewData->insertByIndex( 0, makeAny( aViewData ) );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//--------------------------------------------------------------------
+
sal_Bool SfxViewFrame::SwitchToViewShell_Impl
(
sal_uInt16 nViewIdOrNo, /* > 0
@@ -2295,6 +2386,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl
SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory();
const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo;
+ // save the view data of the old view, so it can be restored later on (when needed)
+ SaveCurrentViewData_Impl( nViewId );
+
// create and load new ViewShell
SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(
*GetObjectShell(),
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index f6854f0f36..43c9c8bf20 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -700,6 +700,14 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
case SID_PRINTDOCDIRECT:
{
SfxObjectShell* pDoc = GetObjectShell();
+
+ // derived class may decide to abort this
+ if( !pDoc->QuerySlotExecutable( nId ) )
+ {
+ rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) );
+ return;
+ }
+
bool bDetectHidden = ( !bSilent && pDoc );
if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
break;
diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk
index 2d93e7692d..f520e2097e 100644
--- a/sfx2/util/makefile.mk
+++ b/sfx2/util/makefile.mk
@@ -162,3 +162,11 @@ SHL3NOCHECK=TRUE
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/sfx.component
+
+$(MISC)/sfx.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ sfx.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt sfx.component
diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component
new file mode 100644
index 0000000000..1c28afd417
--- /dev/null
+++ b/sfx2/util/sfx.component
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="SfxDocumentMetaData">
+ <service name="com.sun.star.document.DocumentProperties"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.desktop.QuickstartWrapper">
+ <service name="com.sun.star.office.Quickstart"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.document.OwnSubFilter">
+ <service name="com.sun.star.comp.document.OwnSubFilter"/>
+ <service name="com.sun.star.document.OwnSubFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.embed.PackageStructureCreator">
+ <service name="com.sun.star.comp.embed.PackageStructureCreator"/>
+ <service name="com.sun.star.embed.PackageStructureCreator"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.office.FrameLoader">
+ <service name="com.sun.star.frame.SynchronousFrameLoader"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.AppDispatchProvider">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.ApplicationDialogLibraryContainer">
+ <service name="com.sun.star.script.ApplicationDialogLibraryContainer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.ApplicationScriptLibraryContainer">
+ <service name="com.sun.star.script.ApplicationScriptLibraryContainer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.DocumentTemplates">
+ <service name="com.sun.star.frame.DocumentTemplates"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.GlobalEventBroadcaster">
+ <service name="com.sun.star.frame.GlobalEventBroadcaster"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.IFrameObject">
+ <service name="com.sun.star.frame.SpecialEmbeddedObject"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.PluginObject">
+ <service name="com.sun.star.frame.SpecialEmbeddedObject"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.SfxMacroLoader">
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.sfx2.StandaloneDocumentInfo">
+ <service name="com.sun.star.document.StandaloneDocumentInfo"/>
+ </implementation>
+</component>
diff --git a/shell/inc/internal/utilities.hxx b/shell/inc/internal/utilities.hxx
index 7ae7de59be..598eed3375 100755
--- a/shell/inc/internal/utilities.hxx
+++ b/shell/inc/internal/utilities.hxx
@@ -84,6 +84,12 @@ bool HasOnlySpaces(const std::wstring& String);
Windows Locale Identifier corresponding to input LocaleSet.
*/
+//---------------------------------
+/** Convert a long path name using Windows api call GetShortPathName
+*/
+std::wstring getShortPathName( const std::wstring& aLongName );
+
+
#ifndef OS2
LCID LocaleSetToLCID( const LocaleSet_t & Locale );
#endif
diff --git a/shell/prj/d.lst b/shell/prj/d.lst
index ea8be0bbaf..3ef183dbdf 100644
--- a/shell/prj/d.lst
+++ b/shell/prj/d.lst
@@ -10,6 +10,7 @@
..\%__SRC%\bin\x64\propertyhdl.dll %_DEST%\bin%_EXT%\propertyhdl_x64.dll
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
+..\%__SRC%\misc\cmdmail.component %_DEST%\xml%_EXT%\cmdmail.component
..\%__SRC%\bin\open-url %_DEST%\bin%_EXT%\open-url
..\%__SRC%\bin\cde-open-url %_DEST%\bin%_EXT%\cde-open-url
@@ -21,5 +22,13 @@
..\%__SRC%\misc\*.xml %_DEST%\xml%_EXT%\*.xml
-..\%__SRC%\misc\*-ucd.txt %_DEST%\bin%_EXT%\*-ucd.txt
+..\%__SRC%\misc\desktopbe1.component %_DEST%\xml%_EXT%\desktopbe1.component
+..\%__SRC%\misc\gconfbe1.component %_DEST%\xml%_EXT%\gconfbe1.component
+..\%__SRC%\misc\kde4be1.component %_DEST%\xml%_EXT%\kde4be1.component
+..\%__SRC%\misc\kdebe1.component %_DEST%\xml%_EXT%\kdebe1.component
..\inc\kde_headers.h %_DEST%\inc%_EXT%\shell\kde_headers.h
+..\%__SRC%\misc\localebe1.component %_DEST%\xml%_EXT%\localebe1.component
+..\%__SRC%\misc\macbe1.component %_DEST%\xml%_EXT%\macbe1.component
+..\%__SRC%\misc\smplmail.component %_DEST%\xml%_EXT%\smplmail.component
+..\%__SRC%\misc\syssh.component %_DEST%\xml%_EXT%\syssh.component
+..\%__SRC%\misc\wininetbe1.component %_DEST%\xml%_EXT%\wininetbe1.component
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
index 21371755b4..e628e8e1b8 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -282,9 +282,3 @@ component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey)
-{
- return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
-}
diff --git a/shell/source/backends/desktopbe/desktopbe1-ucd.txt b/shell/source/backends/desktopbe/desktopbe1-ucd.txt
deleted file mode 100644
index fd874a82ea..0000000000
--- a/shell/source/backends/desktopbe/desktopbe1-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.comp.configuration.backend.DesktopBackend
-ComponentName=desktopbe1.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.configuration.backend.DesktopBackend
diff --git a/shell/source/backends/desktopbe/desktopbe1.component b/shell/source/backends/desktopbe/desktopbe1.component
new file mode 100644
index 0000000000..9ef1421076
--- /dev/null
+++ b/shell/source/backends/desktopbe/desktopbe1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.DesktopBackend">
+ <service name="com.sun.star.configuration.backend.DesktopBackend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk
index 29260821d5..66ad8cf99e 100644
--- a/shell/source/backends/desktopbe/makefile.mk
+++ b/shell/source/backends/desktopbe/makefile.mk
@@ -48,6 +48,12 @@ SHL1TARGET = desktopbe1.uno
SHL1USE_EXPORTS = name
DEF1NAME = $(SHL1TARGET)
-UNIXTEXT = $(MISC)/desktopbe1-ucd.txt
-
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/desktopbe1.component
+
+$(MISC)/desktopbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ desktopbe1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt desktopbe1.component
diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx
index 122d1cad02..fb3fdb1143 100644
--- a/shell/source/backends/gconfbe/gconfbackend.cxx
+++ b/shell/source/backends/gconfbe/gconfbackend.cxx
@@ -231,9 +231,3 @@ component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey)
-{
- return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
-}
diff --git a/shell/source/backends/gconfbe/gconfbe1-ucd.txt b/shell/source/backends/gconfbe/gconfbe1-ucd.txt
deleted file mode 100644
index daa5444ff0..0000000000
--- a/shell/source/backends/gconfbe/gconfbe1-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.comp.configuration.backend.GconfBackend
-ComponentName=gconfbe1.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.configuration.backend.GconfBackend
diff --git a/shell/source/backends/gconfbe/gconfbe1.component b/shell/source/backends/gconfbe/gconfbe1.component
new file mode 100644
index 0000000000..7638e05b54
--- /dev/null
+++ b/shell/source/backends/gconfbe/gconfbe1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.GconfBackend">
+ <service name="com.sun.star.configuration.backend.GconfBackend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk
index a8d9b23aa9..9e77a0867a 100644
--- a/shell/source/backends/gconfbe/makefile.mk
+++ b/shell/source/backends/gconfbe/makefile.mk
@@ -39,7 +39,6 @@ VISIBILITY_HIDDEN=TRUE
# no "lib" prefix
DLLPRE =
-UCDSRCEXT = txt
.IF "$(ENABLE_LOCKDOWN)" == "YES"
CFLAGS+=-DENABLE_LOCKDOWN
@@ -89,8 +88,10 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
-ALLTAR : $(MISC)/$(TARGET)1-ucd.txt
-
-$(MISC)/$(TARGET)1-ucd.txt : $$(@:b).$(UCDSRCEXT)
- cat $< | tr -d "\015" > $@
+ALLTAR : $(MISC)/gconfbe1.component
+$(MISC)/gconfbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ gconfbe1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt gconfbe1.component
diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx
index 44ddb49bd0..2bf3d144a5 100644
--- a/shell/source/backends/kde4be/kde4backend.cxx
+++ b/shell/source/backends/kde4be/kde4backend.cxx
@@ -250,9 +250,3 @@ component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey)
-{
- return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
-}
diff --git a/shell/source/backends/kde4be/kde4be1-ucd.txt b/shell/source/backends/kde4be/kde4be1-ucd.txt
deleted file mode 100644
index 9671199b26..0000000000
--- a/shell/source/backends/kde4be/kde4be1-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend
-ComponentName=kde4be1.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.configuration.backend.KDE4Backend
diff --git a/shell/source/backends/kde4be/kde4be1.component b/shell/source/backends/kde4be/kde4be1.component
new file mode 100644
index 0000000000..8ea7ae1210
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4be1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.KDE4Backend">
+ <service name="com.sun.star.configuration.backend.KDE4Backend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk
index 1f9093a95a..477e47ca61 100644
--- a/shell/source/backends/kde4be/makefile.mk
+++ b/shell/source/backends/kde4be/makefile.mk
@@ -44,8 +44,6 @@ VISIBILITY_HIDDEN=TRUE
CFLAGSCXX+=-Wno-shadow
.ENDIF
-UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
-
# no "lib" prefix
DLLPRE =
@@ -79,3 +77,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ---
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/kde4be1.component
+
+$(MISC)/kde4be1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ kde4be1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt kde4be1.component
diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx
index 53a00cf359..ad38a6cfc8 100644
--- a/shell/source/backends/kdebe/kdebackend.cxx
+++ b/shell/source/backends/kdebe/kdebackend.cxx
@@ -250,9 +250,3 @@ component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey)
-{
- return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
-}
diff --git a/shell/source/backends/kdebe/kdebe1-ucd.txt b/shell/source/backends/kdebe/kdebe1-ucd.txt
deleted file mode 100644
index adf7e17431..0000000000
--- a/shell/source/backends/kdebe/kdebe1-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.comp.configuration.backend.KDEBackend
-ComponentName=kdebe1.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.configuration.backend.KDEBackend
diff --git a/shell/source/backends/kdebe/kdebe1.component b/shell/source/backends/kdebe/kdebe1.component
new file mode 100644
index 0000000000..393fbc80d5
--- /dev/null
+++ b/shell/source/backends/kdebe/kdebe1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.KDEBackend">
+ <service name="com.sun.star.configuration.backend.KDEBackend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk
index 31bf77b47b..b1b12ad3c6 100644
--- a/shell/source/backends/kdebe/makefile.mk
+++ b/shell/source/backends/kdebe/makefile.mk
@@ -44,8 +44,6 @@ VISIBILITY_HIDDEN=TRUE
CFLAGSCXX+=-Wno-shadow
.ENDIF
-UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
-
# no "lib" prefix
DLLPRE =
@@ -79,3 +77,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ---
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/kdebe1.component
+
+$(MISC)/kdebe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ kdebe1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt kdebe1.component
diff --git a/shell/source/backends/localebe/localebe1.component b/shell/source/backends/localebe/localebe1.component
new file mode 100644
index 0000000000..7236a61982
--- /dev/null
+++ b/shell/source/backends/localebe/localebe1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.LocaleBackend">
+ <service name="com.sun.star.configuration.backend.LocaleBackend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx
index 8326c65075..54eb55c80c 100644
--- a/shell/source/backends/localebe/localebecdef.cxx
+++ b/shell/source/backends/localebe/localebecdef.cxx
@@ -72,13 +72,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
- return cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, kImplementations_entries);
-}
-
-//------------------------------------------------------------------------------
-
extern "C" void *component_getFactory( const sal_Char *aImplementationName,
void *aServiceManager,
void *aRegistryKey) {
diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk
index bd12bcdb28..1efe3ed5e4 100644
--- a/shell/source/backends/localebe/makefile.mk
+++ b/shell/source/backends/localebe/makefile.mk
@@ -70,3 +70,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/localebe1.component
+
+$(MISC)/localebe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ localebe1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt localebe1.component
diff --git a/shell/source/backends/macbe/macbe1.component b/shell/source/backends/macbe/macbe1.component
new file mode 100644
index 0000000000..10bac2e2b6
--- /dev/null
+++ b/shell/source/backends/macbe/macbe1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.MacOSXBackend">
+ <service name="com.sun.star.configuration.backend.MacOSXBackend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx
index e0609dd06b..6f4e4d53f4 100644
--- a/shell/source/backends/macbe/macbecdef.cxx
+++ b/shell/source/backends/macbe/macbecdef.cxx
@@ -73,13 +73,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
- return cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, kImplementations_entries);
-}
-
-//------------------------------------------------------------------------------
-
extern "C" void *component_getFactory( const sal_Char *aImplementationName, void *aServiceManager, void *aRegistryKey)
{
diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk
index c3a58ec9f5..dd20834b26 100644
--- a/shell/source/backends/macbe/makefile.mk
+++ b/shell/source/backends/macbe/makefile.mk
@@ -76,3 +76,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
.ENDIF # "$(OS)" != "MACOSX"
+
+ALLTAR : $(MISC)/macbe1.component
+
+$(MISC)/macbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ macbe1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt macbe1.component
diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk
index 9f79fa706f..7d8a6be14b 100644
--- a/shell/source/backends/wininetbe/makefile.mk
+++ b/shell/source/backends/wininetbe/makefile.mk
@@ -66,3 +66,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/wininetbe1.component
+
+$(MISC)/wininetbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ wininetbe1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt wininetbe1.component
diff --git a/shell/source/backends/wininetbe/wininetbe1.component b/shell/source/backends/wininetbe/wininetbe1.component
new file mode 100644
index 0000000000..d8930280fb
--- /dev/null
+++ b/shell/source/backends/wininetbe/wininetbe1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.configuration.backend.WinInetBackend">
+ <service name="com.sun.star.configuration.backend.WinInetBackend"/>
+ </implementation>
+</component>
diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx b/shell/source/backends/wininetbe/wininetbecdef.cxx
index 7ecdbecf32..d325118ebf 100644
--- a/shell/source/backends/wininetbe/wininetbecdef.cxx
+++ b/shell/source/backends/wininetbe/wininetbecdef.cxx
@@ -73,13 +73,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
- return cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, kImplementations_entries);
-}
-
-//------------------------------------------------------------------------------
-
extern "C" void *component_getFactory( const sal_Char *aImplementationName,
void *aServiceManager,
void *aRegistryKey) {
diff --git a/shell/source/cmdmail/cmdmail.component b/shell/source/cmdmail/cmdmail.component
new file mode 100644
index 0000000000..7e56741d16
--- /dev/null
+++ b/shell/source/cmdmail/cmdmail.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.system.SimpleCommandMail">
+ <service name="com.sun.star.system.SimpleCommandMail"/>
+ </implementation>
+</component>
diff --git a/shell/source/cmdmail/cmdmailentry.cxx b/shell/source/cmdmail/cmdmailentry.cxx
index 63a0fa0517..61ae62fa85 100755
--- a/shell/source/cmdmail/cmdmailentry.cxx
+++ b/shell/source/cmdmail/cmdmailentry.cxx
@@ -54,7 +54,6 @@ using com::sun::star::system::XSimpleMailClientSupplier;
#define COMP_SERVICE_NAME "com.sun.star.system.SimpleCommandMail"
#define COMP_IMPL_NAME "com.sun.star.comp.system.SimpleCommandMail"
-#define COMP_REGKEY_NAME "/com.sun.star.comp.system.SimpleCommandMail/UNO/SERVICES/com.sun.star.system.SimpleCommandMail"
//-----------------------------------------------------------------------
//
@@ -85,29 +84,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-----------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( COMP_REGKEY_NAME ) ) );
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
//----------------------------------------------------------------------
// component_getFactory
//----------------------------------------------------------------------
diff --git a/shell/source/cmdmail/exports.dxp b/shell/source/cmdmail/exports.dxp
index 028ac41759..f0e1c69934 100644
--- a/shell/source/cmdmail/exports.dxp
+++ b/shell/source/cmdmail/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk
index 5781afe8f5..e4d5ec48b9 100644
--- a/shell/source/cmdmail/makefile.mk
+++ b/shell/source/cmdmail/makefile.mk
@@ -62,3 +62,10 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/cmdmail.component
+
+$(MISC)/cmdmail.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ cmdmail.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt cmdmail.component
diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk
index 4bf77436f6..1a26d377b1 100644
--- a/shell/source/unix/exec/makefile.mk
+++ b/shell/source/unix/exec/makefile.mk
@@ -88,3 +88,11 @@ run_test : $(BIN)$/$(TESTAPP1).sh
$(BIN)$/$(TESTAPP1).sh : $$(@:f)
$(COPY) $< $@
-chmod +x $@
+
+ALLTAR : $(MISC)/syssh.component
+
+$(MISC)/syssh.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ syssh.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt syssh.component
diff --git a/shell/source/unix/exec/shellexecentry.cxx b/shell/source/unix/exec/shellexecentry.cxx
index 134d750773..0d006cd2b9 100644
--- a/shell/source/unix/exec/shellexecentry.cxx
+++ b/shell/source/unix/exec/shellexecentry.cxx
@@ -83,29 +83,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-----------------------------------------------------------------------
-// component_writeInfo
-//-----------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( SHELLEXEC_REGKEY_NAME ) ) );
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
//----------------------------------------------------------------------
// component_getFactory
//----------------------------------------------------------------------
diff --git a/shell/source/unix/exec/syssh.component b/shell/source/unix/exec/syssh.component
new file mode 100644
index 0000000000..030240dff3
--- /dev/null
+++ b/shell/source/unix/exec/syssh.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.system.SystemShellExecute">
+ <service name="com.sun.star.system.SystemShellExecute"/>
+ </implementation>
+</component>
diff --git a/shell/source/win32/SysShentry.cxx b/shell/source/win32/SysShentry.cxx
index 18da51da6d..93c44387a5 100644
--- a/shell/source/win32/SysShentry.cxx
+++ b/shell/source/win32/SysShentry.cxx
@@ -85,32 +85,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine";
}
-//-----------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey(
- OUString::createFromAscii( SYSSHEXEC_REGKEY_NAME ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/shell/source/win32/exports.dxp b/shell/source/win32/exports.dxp
index 028ac41759..f0e1c69934 100644
--- a/shell/source/win32/exports.dxp
+++ b/shell/source/win32/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/shell/source/win32/makefile.mk b/shell/source/win32/makefile.mk
index 9a9564ed76..7a01eefed8 100644
--- a/shell/source/win32/makefile.mk
+++ b/shell/source/win32/makefile.mk
@@ -67,3 +67,11 @@ DEF1EXPORTFILE= exports.dxp
INCLUDE!:=$(subst,/stl, $(INCLUDE))
.EXPORT : INCLUDE
+
+ALLTAR : $(MISC)/syssh.component
+
+$(MISC)/syssh.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ syssh.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt syssh.component
diff --git a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
index f8db1e8eba..eccbf903b5 100644..100755
--- a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
+++ b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
@@ -152,14 +152,15 @@ HRESULT STDMETHODCALLTYPE CColumnInfo::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO
//
//-----------------------------
- HRESULT STDMETHODCALLTYPE CColumnInfo::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData)
+HRESULT STDMETHODCALLTYPE CColumnInfo::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData)
{
if (IsOOFileExtension(pscd->pwszExt))
{
try
{
+ std::wstring fname = getShortPathName( std::wstring( pscd->wszFile ) );
- CMetaInfoReader meta_info_accessor(WStringToString(pscd->wszFile));
+ CMetaInfoReader meta_info_accessor(WStringToString(fname));
VariantClear(pvarData);
diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx
index 58f8a877b2..6ef6b57d8f 100644..100755
--- a/shell/source/win32/shlxthandler/infotips/infotips.cxx
+++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx
@@ -352,14 +352,16 @@ HRESULT STDMETHODCALLTYPE CInfoTip::Load(LPCOLESTR pszFileName, DWORD /*dwMode*/
std::wstring::iterator end = fname.end();
m_FileNameOnly = std::wstring(begin, end);
-
+
+ fname = getShortPathName( fname );
+
std::string fnameA = WStringToString(fname);
// #115531#
// ZeroMemory because strncpy doesn't '\0'-terminates the destination
// string; reserve the last place in the buffer for the final '\0'
// that's why '(sizeof(m_szFileName) - 1)'
- ZeroMemory(m_szFileName, sizeof(m_szFileName));
+ ZeroMemory(m_szFileName, sizeof(m_szFileName));
strncpy(m_szFileName, fnameA.c_str(), (sizeof(m_szFileName) - 1));
return S_OK;
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index 89b0cc435d..07e1b06137 100755
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -657,7 +657,8 @@ SCODE STDMETHODCALLTYPE COooFilter::IsDirty()
SCODE STDMETHODCALLTYPE COooFilter::Load(LPCWSTR pszFileName, DWORD /*dwMode*/)
{
// Load just sets the filename for GetChunk to read and ignores the mode
- m_pwszFileName = pszFileName;
+ m_pwszFileName = getShortPathName( pszFileName );
+
// Open the file previously specified in call to IPersistFile::Load and get content.
try
{
diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
index cb5d7e2627..19699be01f 100644..100755
--- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
+++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
@@ -237,14 +237,14 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::Initialize( IStream *pStream, DWORD grfM
try
{
pMetaInfoReader = new CMetaInfoReader( (void*)pStream, &z_filefunc );
+ LoadProperties( pMetaInfoReader );
+ delete pMetaInfoReader;
}
catch (const std::exception& e)
{
OutputDebugStringFormat( "CPropertyHdl::Initialize: Caught exception [%s]", e.what() );
return E_FAIL;
}
-
- LoadProperties( pMetaInfoReader );
/*
// load extended properties and search content
_LoadExtendedProperties();
diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index b81461fcf9..536a49255c 100755
--- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -77,7 +77,7 @@ CPropertySheet::CPropertySheet(long RefCnt) :
//-----------------------------
CPropertySheet::~CPropertySheet()
-{
+{
OutputDebugStringFormat("CPropertySheet::DTor [%d], [%d]", m_RefCnt, g_DllRefCnt );
InterlockedDecrement(&g_DllRefCnt);
}
@@ -157,13 +157,26 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
NULL,
0)))
{
- DragQueryFileA(
- reinterpret_cast<HDROP>(medium.hGlobal),
- 0,
- m_szFileName,
- sizeof(m_szFileName));
-
- hr = S_OK;
+ UINT size = DragQueryFile( reinterpret_cast<HDROP>(medium.hGlobal), 0, 0, 0 );
+ if ( size != 0 )
+ {
+ TCHAR * buffer = new TCHAR[ size + 1 ];
+ UINT result_size = DragQueryFile( reinterpret_cast<HDROP>(medium.hGlobal),
+ 0, buffer, size + 1 );
+ if ( result_size != 0 )
+ {
+ std::wstring fname = getShortPathName( buffer );
+ std::string fnameA = WStringToString( fname );
+ ZeroMemory( m_szFileName, sizeof( m_szFileName ) );
+ strncpy( m_szFileName, fnameA.c_str(), ( sizeof( m_szFileName ) - 1 ) );
+ hr = S_OK;
+ }
+ else
+ hr = E_INVALIDARG;
+ delete [] buffer;
+ }
+ else
+ hr = E_INVALIDARG;
}
else
hr = E_INVALIDARG;
@@ -320,47 +333,53 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPAR
//##################################
void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
{
- CMetaInfoReader metaInfo(m_szFileName);
-
- SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() );
-
- // comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add
- // "\r" before "\n" to form "\r\n" in order to display return in Edit control.
- std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str();
- std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
- while (itor != std::wstring::npos)
+ try
+ {
+ CMetaInfoReader metaInfo(m_szFileName);
+
+ SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() );
+
+ // comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add
+ // "\r" before "\n" to form "\r\n" in order to display return in Edit control.
+ std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str();
+ std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
+ while (itor != std::wstring::npos)
+ {
+ tempStr.insert(itor, L"\r");
+ itor = tempStr.find(L"\n", itor + 2);
+ }
+ SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
+ }
+ catch (const std::exception&)
{
- tempStr.insert(itor, L"\r");
- itor = tempStr.find(L"\n", itor + 2);
}
- SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
-
}
//---------------------------------
/**
*/
void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
-{
- CMetaInfoReader metaInfo(m_szFileName);
-
- document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo);
-
- statistic_group_list_t sgl;
- doc_stat_reader->read(&sgl);
-
- list_view_builder_ptr lv_builder = create_list_view_builder(
- GetDlgItem(hwnd, IDC_STATISTICSLIST),
- GetResString(IDS_PROPERTY),
- GetResString(IDS_PROPERTY_VALUE));
-
- lv_builder->build(sgl);
-
-}
+{
+ try
+ {
+ CMetaInfoReader metaInfo(m_szFileName);
+ document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo);
+ statistic_group_list_t sgl;
+ doc_stat_reader->read(&sgl);
+ list_view_builder_ptr lv_builder = create_list_view_builder(
+ GetDlgItem(hwnd, IDC_STATISTICSLIST),
+ GetResString(IDS_PROPERTY),
+ GetResString(IDS_PROPERTY_VALUE));
+ lv_builder->build(sgl);
+ }
+ catch (const std::exception&)
+ {
+ }
+}
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index 23831d07be..180f5c2f60 100644..100755
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -367,7 +367,8 @@ HRESULT STDMETHODCALLTYPE CThumbviewer::Extract(HBITMAP *phBmpImage)
try
{
- std::auto_ptr<ZipFile> zipfile(new ZipFile(WStringToString(filename_)));
+ std::wstring fname = getShortPathName( filename_ );
+ std::auto_ptr<ZipFile> zipfile( new ZipFile( WStringToString( fname ) ) );
if (zipfile->HasContent(THUMBNAIL_CONTENT))
{
diff --git a/shell/source/win32/shlxthandler/util/fileextensions.cxx b/shell/source/win32/shlxthandler/util/fileextensions.cxx
index dd89a32853..16d537890c 100644..100755
--- a/shell/source/win32/shlxthandler/util/fileextensions.cxx
+++ b/shell/source/win32/shlxthandler/util/fileextensions.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
+#include "algorithm"
#include "internal/fileextensions.hxx"
//------------------------------------
@@ -87,10 +88,18 @@ std::string get_file_name_extension(const std::string& file_name)
/** Return the type of a file
*/
+char easytolower( char in )
+{
+ if( in<='Z' && in>='A' )
+ return in-('Z'-'z');
+ return in;
+}
+
File_Type_t get_file_type(const std::string& file_name)
{
std::string fext = get_file_name_extension(file_name);
-
+ std::transform(fext.begin(), fext.end(), fext.begin(), easytolower);
+
if (std::string::npos != WRITER_FILE_EXTENSIONS.find(fext))
return WRITER;
else if (std::string::npos != CALC_FILE_EXTENSIONS.find(fext))
diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx
index 55353e20f9..486abb0dd6 100644..100755
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -148,6 +148,28 @@ bool HasOnlySpaces(const std::wstring& String)
return true;
}
+//---------------------------------
+/** helper function to convert windows pathes to short form.
+ @returns
+ shortend path.
+*/
+
+std::wstring getShortPathName( const std::wstring& aLongName )
+{
+ std::wstring shortName = aLongName;
+ long length = GetShortPathName( aLongName.c_str(), NULL, 0 );
+
+ if ( length != 0 )
+ {
+ TCHAR* buffer = new TCHAR[ length+1 ];
+ length = GetShortPathName( aLongName.c_str(), buffer, length );
+ if ( length != 0 )
+ shortName = std::wstring( buffer );
+ delete [] buffer;
+ }
+ return shortName;
+}
+
/** convert LocaleSet pair into Microsoft List of Locale ID (LCID)
according to ISO-639 and ISO-3166.
http://etext.lib.virginia.edu/tei/iso639.html
diff --git a/shell/source/win32/simplemail/exports.dxp b/shell/source/win32/simplemail/exports.dxp
index 028ac41759..f0e1c69934 100644
--- a/shell/source/win32/simplemail/exports.dxp
+++ b/shell/source/win32/simplemail/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/shell/source/win32/simplemail/makefile.mk b/shell/source/win32/simplemail/makefile.mk
index 84a209e4c0..abd35e408e 100644
--- a/shell/source/win32/simplemail/makefile.mk
+++ b/shell/source/win32/simplemail/makefile.mk
@@ -77,3 +77,11 @@ APP1DEF=$(MISC)$/$(APP1TARGET).def
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/smplmail.component
+
+$(MISC)/smplmail.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ smplmail.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt smplmail.component
diff --git a/shell/source/win32/simplemail/smplmail.component b/shell/source/win32/simplemail/smplmail.component
new file mode 100644
index 0000000000..59246c6d15
--- /dev/null
+++ b/shell/source/win32/simplemail/smplmail.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.system.SimpleSystemMail">
+ <service name="com.sun.star.system.SimpleSystemMail"/>
+ </implementation>
+</component>
diff --git a/shell/source/win32/simplemail/smplmailentry.cxx b/shell/source/win32/simplemail/smplmailentry.cxx
index fd66e40a5f..c6cd80536e 100644
--- a/shell/source/win32/simplemail/smplmailentry.cxx
+++ b/shell/source/win32/simplemail/smplmailentry.cxx
@@ -85,32 +85,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-----------------------------------------------------------------------
-//
-//-----------------------------------------------------------------------
-
-sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
-{
- sal_Bool bRetVal = sal_True;
-
- if ( pRegistryKey )
- {
- try
- {
- Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
- pXNewKey->createKey(
- OUString::createFromAscii( COMP_REGKEY_NAME ) );
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
-
- return bRetVal;
-}
-
//----------------------------------------------------------------------
// component_getFactory
// returns a factory to create XFilePicker-Services
diff --git a/shell/source/win32/syssh.component b/shell/source/win32/syssh.component
new file mode 100644
index 0000000000..1e783f5221
--- /dev/null
+++ b/shell/source/win32/syssh.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.system.SystemShellExecute">
+ <service name="com.sun.star.system.SystemShellExecute"/>
+ </implementation>
+</component>
diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc
index 46417de887..f5997b030b 100644
--- a/svx/inc/svdstr.hrc
+++ b/svx/inc/svdstr.hrc
@@ -756,6 +756,7 @@
//BFS01#define SIP_SDRATTRSET_GRAF (SIP_Begin + 258)
#define SIP_SA_MARKERS (SIP_Begin + 258)
+#define SIP_SA_PAGESHADOW35X35 (SIP_Begin + 259)
#define SIP_SA_FINE_MARKERS (SIP_Begin + 260)
// #100499#
diff --git a/svx/inc/svimbase.hxx b/svx/inc/svimbase.hxx
index 58fb0c969c..7f4b4710f8 100644
--- a/svx/inc/svimbase.hxx
+++ b/svx/inc/svimbase.hxx
@@ -36,11 +36,7 @@
// - Defines -
// -----------
-#ifdef WIN
-#define _SVHUGE huge
-#else
#define _SVHUGE
-#endif
// ----------------
// - SimDepthType -
diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index eb304d09f3..26cd56c2ef 100755
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -956,7 +956,9 @@
#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_6 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 6)//?
#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_7 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 7)//?
-#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1190)
+#define RID_SVXSTR_FINDBAR_FIND (RID_SVX_START + 1190)
+
+#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1191)
// ----------------------------------------------------------------------------
// if we have _a_lot_ time, we should group the resource ids by type, instead
diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx
index 29446b8a22..1aef4e4bbf 100644
--- a/svx/inc/svx/sdrmasterpagedescriptor.hxx
+++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx
@@ -35,6 +35,7 @@
// predeclarations
class SdrObject;
class SfxItemSet;
+class SdrPageProperties;
namespace sdr
{
@@ -89,6 +90,8 @@ namespace sdr
// operators
sal_Bool operator==(const MasterPageDescriptor& rCandidate) const;
sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const;
+
+ const SdrPageProperties* getCorrectSdrPageProperties() const;
};
} // end of namespace sdr
diff --git a/svx/inc/svx/svdedtv.hxx b/svx/inc/svx/svdedtv.hxx
index 6a3bbd1f75..88ea8fc715 100644
--- a/svx/inc/svx/svdedtv.hxx
+++ b/svx/inc/svx/svdedtv.hxx
@@ -208,7 +208,6 @@ public:
// verwendet. NotifyNewUndoAction() wird in diesem Fall erst beim letzten
// EndUndo() gerufen. NotifyNewUndoAction() wird nicht gerufen bei einer
// leeren Klammerung.
-#ifndef WIN
void BegUndo() { pMod->BegUndo(); } // Undo-Klammerung auf
void BegUndo(const String& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf
void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf
@@ -218,17 +217,6 @@ public:
// nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
void SetUndoComment(const String& rComment) { pMod->SetUndoComment(rComment); }
void SetUndoComment(const String& rComment, const String& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); }
-#else // ifndef WIN
- void BegUndo();
- void BegUndo(const String& rComment);
- void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE);
- void BegUndo(SdrUndoGroup* pUndoGrp);
- void EndUndo(); // Undo-Klammerung zu (inkl BroadcastEdges)
- void AddUndo(SdrUndoAction* pUndo);
- // nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
- void SetUndoComment(const String& rComment);
- void SetUndoComment(const String& rComment, const String& rObjDescr);
-#endif
bool IsUndoEnabled() const;
std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO );
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 39411eafd9..a80908756f 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -53,11 +53,11 @@ class OutputDevice;
#include <vos/ref.hxx>
-#if defined(UNX) || defined(WIN) || defined(WNT)
+#if defined(UNX) || defined(WNT)
#define DEGREE_CHAR ((sal_Unicode)176) /* 0xB0 = Ansi */
#endif
-#if defined(DOS) || defined(OS2)
+#if defined(OS2)
#define DEGREE_CHAR ((sal_Unicode)248) /* 0xF8 = IBM PC (Erw. ASCII) */
#endif
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index 435ab2fda1..c65c5eb5a6 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -448,6 +448,7 @@ private:
public:
SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
+ const SdrPageProperties* getCorrectSdrPageProperties() const;
protected:
// new MasterPageDescriptorVector
diff --git a/svx/inc/svx/xpoly.hxx b/svx/inc/svx/xpoly.hxx
index 837d681afd..a8ccd34713 100644
--- a/svx/inc/svx/xpoly.hxx
+++ b/svx/inc/svx/xpoly.hxx
@@ -45,11 +45,7 @@ class OutputDevice;
#define XPOLYPOLY_APPEND 0xFFFF
#define XPOLY_APPEND 0xFFFF
-#ifdef WIN // Windows 16 Bit
-#define XPOLY_MAXPOINTS 8160 /* =0xFF00/sizeof(Point), also mit etwas Platz! */
-#else
#define XPOLY_MAXPOINTS 0xFFF0 /* Auch fuer die 32-Bitter etwas Luft lassen */
-#endif
/************************************************************************/
// Punktstile im XPolygon:
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 2403c04c43..f8b71ea694 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -552,3 +552,6 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\table
..\inc\svx\helperhittest3d.hxx %_DEST%\inc%_EXT%\svx\helperhittest3d.hxx
..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.*
+..\%__SRC%\misc\svx.component %_DEST%\xml%_EXT%\svx.component
+..\%__SRC%\misc\svxcore.component %_DEST%\xml%_EXT%\svxcore.component
+..\%__SRC%\misc\textconversiondlgs.component %_DEST%\xml%_EXT%\textconversiondlgs.component
diff --git a/svx/source/core/coreservices.cxx b/svx/source/core/coreservices.cxx
index 2df0bf05a1..fb39434d60 100644
--- a/svx/source/core/coreservices.cxx
+++ b/svx/source/core/coreservices.cxx
@@ -77,44 +77,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-static void writeInfo (
- XRegistryKey * pRegistryKey,
- const OUString& rImplementationName,
- const Sequence< OUString >& rServices)
-{
- Reference< XRegistryKey > xNewKey(
- pRegistryKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) );
-
- for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
- xNewKey->createKey( rServices.getConstArray()[i]);
-}
-
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * , void * pRegistryKey)
-{
- if( pRegistryKey )
- {
- try
- {
- XRegistryKey *pKey = reinterpret_cast< XRegistryKey * >( pRegistryKey );
-
- writeInfo( pKey, ::svx::ExtrusionDepthController_getImplementationName(),::svx::ExtrusionDepthController_getSupportedServiceNames() );
- writeInfo( pKey, ::svx::ExtrusionDirectionControl_getImplementationName(),::svx::ExtrusionDirectionControl_getSupportedServiceNames() );
- writeInfo( pKey, ::svx::ExtrusionLightingControl_getImplementationName(),::svx::ExtrusionLightingControl_getSupportedServiceNames() );
- writeInfo( pKey, ::svx::ExtrusionSurfaceControl_getImplementationName(),::svx::ExtrusionSurfaceControl_getSupportedServiceNames() );
- writeInfo( pKey, ::svx::FontWorkAlignmentControl_getImplementationName(),::svx::FontWorkAlignmentControl_getSupportedServiceNames() );
- writeInfo( pKey, ::svx::FontWorkCharacterSpacingControl_getImplementationName(),::svx::FontWorkCharacterSpacingControl_getSupportedServiceNames() );
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return sal_True;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 06730c4bf6..2e070cacdd 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -212,7 +212,7 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeft() )
{
- Point aPnt = rMEvt.GetPosPixel();
+ const Point aPnt = rMEvt.GetPosPixel();
SvLBoxEntry* pEntry = GetEntry( aPnt );
if ( pEntry )
@@ -230,6 +230,13 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
{
ToggleCheckButton( pEntry );
SvTreeListBox::MouseButtonDown( rMEvt );
+
+ // check if the entry below the mouse changed during the base method call. This is possible if,
+ // for instance, a handler invoked by the base class tampers with the list entries.
+ const SvLBoxEntry* pNewEntry = GetEntry( aPnt );
+ if ( pNewEntry != pEntry )
+ return;
+
if ( bCheck != ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) )
CheckButtonHdl();
return;
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 7e8d41b71e..ca3ffc5e80 100644..100755
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -59,6 +59,28 @@
#define RULER_TAB_RTL ((USHORT)0x0010)
#endif
+#include <comphelper/uieventslogger.hxx>
+
+namespace
+{
+ void lcl_logRulerUse(const ::rtl::OUString& sURL) //#i99729#
+ {
+ using namespace ::com::sun::star;
+ util::URL aTargetURL;
+ aTargetURL.Complete = sURL;
+ aTargetURL.Main = sURL;
+ if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
+ {
+ ::rtl::OUString sAppName;
+ uno::Sequence<beans::PropertyValue> source;
+ ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString::createFromAscii("SfxRuler"));
+ ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source);
+ }
+ }
+}
+
+
+
// STATIC DATA -----------------------------------------------------------
#define CTRL_ITEM_COUNT 14
@@ -2806,6 +2828,7 @@ void __EXPORT SvxRuler::Click()
*/
{
+ lcl_logRulerUse(::rtl::OUString::createFromAscii(".special://SfxRuler/Click"));
Ruler::Click();
if( bActive )
{
@@ -3440,6 +3463,7 @@ long __EXPORT SvxRuler::StartDrag()
*/
{
+ lcl_logRulerUse(::rtl::OUString::createFromAscii(".special://SfxRuler/StartDrag"));
BOOL bContentProtected = pRuler_Imp->aProtectItem.IsCntntProtected();
if(!bValid)
return FALSE;
@@ -3559,6 +3583,7 @@ void __EXPORT SvxRuler::EndDrag()
*/
{
+ lcl_logRulerUse(::rtl::OUString::createFromAscii(".special://SfxRuler/EndDrag"));
const BOOL bUndo = IsDragCanceled();
const long lPos = GetDragPos();
DrawLine_Impl(lTabPos, 6, bHorz);
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 0bd03d0229..e5a55a6964 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -240,7 +240,7 @@ void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/)
#endif
// Fuer WIN95/NT die FP-Exceptions abschalten
-#if defined(WNT) || defined(WIN)
+#if defined(WNT)
#define SC_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 )
#define SC_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM )
SC_FPEXCEPTIONS_OFF();
diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src
index d70e69ea99..77ef840d60 100644
--- a/svx/source/items/svxitems.src
+++ b/svx/source/items/svxitems.src
@@ -32,7 +32,7 @@
StringArray RID_ATTR_NAMES
{
- ItemList =
+ ItemList [ en-US ] =
{
< "Scale" ; SID_ATTR_ZOOM ; > ;
< "Brush" ; SID_ATTR_BRUSH ; > ;
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index 1f6801f394..15a22cdaae 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -62,23 +62,7 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
drawinglayer::attribute::SdrFillAttribute aFill;
- const SdrPage* pCorrectPage = &GetMasterPageDescriptor().GetOwnerPage();
- const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties();
-
- if(XFILL_NONE == ((const XFillStyleItem&)pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue())
- {
- pCorrectPage = &GetMasterPageDescriptor().GetUsedPage();
- pCorrectProperties = &pCorrectPage->getSdrPageProperties();
- }
-
- if(pCorrectPage->IsMasterPage() && !pCorrectProperties->GetStyleSheet())
- {
- // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets,
- // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all
- // MasterPages should have a StyleSheet excactly for this reason, but historically
- // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others).
- pCorrectProperties = 0;
- }
+ const SdrPageProperties* pCorrectProperties = GetMasterPageDescriptor().getCorrectSdrPageProperties();
if(pCorrectProperties)
{
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index 2eacc9083d..b8467266de 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -44,6 +44,10 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
+#include <vcl/lazydelete.hxx>
+#include "svdstr.hrc"
+#include "svdglob.hxx"
+#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
#include <drawinglayer/attribute/sdrfillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -131,31 +135,54 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const
{
+ static bool bUseOldPageShadow(false);
const SdrPage& rPage = getPage();
basegfx::B2DHomMatrix aPageMatrix;
aPageMatrix.set(0, 0, (double)rPage.GetWdt());
aPageMatrix.set(1, 1, (double)rPage.GetHgt());
- // create page shadow polygon
- const double fPageBorderFactor(1.0 / 256.0);
- basegfx::B2DPolygon aPageShadowPolygon;
- aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor));
- aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor));
- aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor));
- aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor));
- aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0));
- aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0));
- aPageShadowPolygon.setClosed(true);
- aPageShadowPolygon.transform(aPageMatrix);
-
- // We have only the page information, not the view information. Use the
- // svtools::FONTCOLOR color for initialisation
- const svtools::ColorConfig aColorConfig;
- const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
- const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageShadowPolygon), aRGBShadowColor));
-
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ if(bUseOldPageShadow)
+ {
+ // create page shadow polygon
+ const double fPageBorderFactor(1.0 / 256.0);
+ basegfx::B2DPolygon aPageShadowPolygon;
+ aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor));
+ aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor));
+ aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor));
+ aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor));
+ aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0));
+ aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0));
+ aPageShadowPolygon.setClosed(true);
+ aPageShadowPolygon.transform(aPageMatrix);
+
+ // We have only the page information, not the view information. Use the
+ // svtools::FONTCOLOR color for initialisation
+ const svtools::ColorConfig aColorConfig;
+ const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
+ const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aPageShadowPolygon),
+ aRGBShadowColor));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+ else
+ {
+ static vcl::DeleteOnDeinit<drawinglayer::primitive2d::DiscreteShadow>
+ aDiscreteShadow(new drawinglayer::primitive2d::DiscreteShadow(
+ BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr()))));
+ if (aDiscreteShadow.get() != NULL)
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::DiscreteShadowPrimitive2D(
+ aPageMatrix,
+ *aDiscreteShadow.get()));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+ return drawinglayer::primitive2d::Primitive2DSequence();
+ }
}
ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
@@ -313,11 +340,17 @@ namespace sdr
const SdrPage& rPage = getPage();
const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
- // We have only the page information, not the view information. Use the
- // svtools::FONTCOLOR color for initialisation
- const svtools::ColorConfig aColorConfig;
- const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
- const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor());
+ // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used.
+ // Added old case as fallback for HighContrast.
+ basegfx::BColor aRGBBorderColor(0x94 / (double)0xff, 0x95 / (double)0xff, 0x99 / (double)0xff);
+
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ const svtools::ColorConfig aColorConfig;
+ const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
+
+ aRGBBorderColor = aBorderColor.getBColor();
+ }
if(rPage.getPageBorderOnlyLeftRight())
{
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index 803f9ef9b2..7b84753999 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -320,6 +320,12 @@ namespace sdr
return false;
}
+ // no page shadow for high contrast mode
+ if(GetObjectContact().isDrawModeHighContrast())
+ {
+ return false;
+ }
+
return true;
}
} // end of namespace contact
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 9d6ba449d0..e3f5f34845 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -113,6 +113,29 @@ namespace sdr
|| &maUsedPage != &rCandidate.maUsedPage
|| maVisibleLayers != rCandidate.maVisibleLayers);
}
+
+ const SdrPageProperties* MasterPageDescriptor::getCorrectSdrPageProperties() const
+ {
+ const SdrPage* pCorrectPage = &GetOwnerPage();
+ const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties();
+
+ if(XFILL_NONE == ((const XFillStyleItem&)pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue())
+ {
+ pCorrectPage = &GetUsedPage();
+ pCorrectProperties = &pCorrectPage->getSdrPageProperties();
+ }
+
+ if(pCorrectPage->IsMasterPage() && !pCorrectProperties->GetStyleSheet())
+ {
+ // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets,
+ // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all
+ // MasterPages should have a StyleSheet excactly for this reason, but historically
+ // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others).
+ pCorrectProperties = 0;
+ }
+
+ return pCorrectProperties;
+ }
} // end of namespace sdr
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index de7a564ff1..08cf1ada74 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -1039,46 +1039,6 @@ void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrO
////////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef WIN
-void SdrEditView::BegUndo() // Undo-Klammerung auf
-{
- pMod->BegUndo();
-}
-
-void SdrEditView::BegUndo(const String& rComment) // Undo-Klammerung auf
-{
- pMod->BegUndo(rComment);
-}
-
-void SdrEditView::BegUndo(const String& rComment, const String& rObjDescr,
- SdrRepeatFunc eFunc) // Undo-Klammerung auf
-{
- pMod->BegUndo(rComment,rObjDescr,eFunc);
-}
-
-void SdrEditView::BegUndo(SdrUndoGroup* pUndoGrp) // Undo-Klammerung auf
-{
- pMod->BegUndo(pUndoGrp);
-}
-
-void SdrEditView::AddUndo(SdrUndoAction* pUndo) // Action hinzufuegen
-{
- pMod->AddUndo(pUndo);
-}
- // nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
-void SdrEditView::SetUndoComment(const String& rComment)
-{
- pMod->SetUndoComment(rComment);
-}
-
-
-void SdrEditView::SetUndoComment(const String& rComment,
- const String& rObjDescr)
-{
- pMod->SetUndoComment(rComment,rObjDescr);
-}
-#endif
-
bool SdrEditView::IsUndoEnabled() const
{
return pMod->IsUndoEnabled();
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 3d72ef276c..418a54925a 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1063,8 +1063,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
/** handle mouse over effects for handles */
BOOL SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
{
- const ULONG nHdlCount = aHdl.GetHdlCount();
- if( nHdlCount )
+ if(aHdl.GetHdlCount())
{
SdrHdl* pMouseOverHdl = 0;
if( !rMEvt.IsLeaveWindow() && pWin )
@@ -1074,6 +1073,8 @@ BOOL SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
}
// notify last mouse over handle that he lost the mouse
+ const ULONG nHdlCount = aHdl.GetHdlCount();
+
for(ULONG nHdl = 0; nHdl < nHdlCount; nHdl++ )
{
SdrHdl* pCurrentHdl = GetHdl(nHdl);
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 288cfcc593..58f4c6950d 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -171,10 +171,8 @@ FASTBOOL SdrCircObj::PaintNeedsXPolyCirc() const
// und wenn nicht WIN dann (erstmal) auch fuer Kreis-/Ellipsenausschnitte
// und Kreis-/Ellipsenboegen (wg. Genauigkeit)
FASTBOOL bNeed=aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || meCircleKind==OBJ_CCUT;
-#ifndef WIN
// Wenn nicht Win, dann fuer alle ausser Vollkreis (erstmal!!!)
if (meCircleKind!=OBJ_CIRC) bNeed=TRUE;
-#endif
const SfxItemSet& rSet = GetObjectItemSet();
if(!bNeed)
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index f9dc3c313d..dcf1543adb 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1979,6 +1979,18 @@ void SdrPage::ReplaceCommentByIndex(sal_uInt32 nIndex, const sdr::Comment& rNew)
}
}
+const SdrPageProperties* SdrPage::getCorrectSdrPageProperties() const
+{
+ if(mpMasterPageDescriptor)
+ {
+ return mpMasterPageDescriptor->getCorrectSdrPageProperties();
+ }
+ else
+ {
+ return &getSdrPageProperties();
+ }
+}
+
//////////////////////////////////////////////////////////////////////////////
// use new redirector instead of pPaintProc
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 669ec8c49b..1ca0b0623f 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -580,10 +580,6 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C
rOut.SetLineColor( aColor );
bool bMap0=rOut.IsMapModeEnabled();
-#ifdef WIN // SetPixel-Profiling fuer Windows
- COLORREF aWinColRef=PALETTERGB(aColor.GetRed()>>8,aColor.GetGreen()>>8,aColor.GetBlue()>>8);
- HDC aWinhDC=Sysdepen::GethDC(rOut);
-#endif
long nWrX=0;//aWriterPageOffset.X();
long nWrY=0;//aWriterPageOffset.Y();
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index 6250983305..f665501a43 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -2746,6 +2746,11 @@ String SIP_SA_GRAFRESERVE4 { Text = "" ; };
String SIP_SA_GRAFRESERVE5 { Text = "" ; };
String SIP_SA_GRAFRESERVE6 { Text = "" ; };
+Bitmap SIP_SA_PAGESHADOW35X35
+{
+ File = "pageshadow35x35.png";
+};
+
Bitmap SIP_SA_MARKERS
{
File = "markers.bmp";
diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk
index 73a178d975..a9ea745f3c 100644
--- a/svx/source/tbxctrls/makefile.mk
+++ b/svx/source/tbxctrls/makefile.mk
@@ -74,6 +74,7 @@ SRC1FILES = \
lboxctrl.src \
linectrl.src \
tbcontrl.src \
+ tbunosearchcontrollers.src \
tbxdraw.src \
grafctrl.src
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 25c0576e64..5000f7e240 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -29,6 +29,8 @@
#include "precompiled_svx.hxx"
#include "tbunosearchcontrollers.hxx"
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -91,7 +93,7 @@ FindTextFieldControl::~FindTextFieldControl()
void FindTextFieldControl::InitControls_Impl()
{
- SetText( String( ::rtl::OUString::createFromAscii("Find") ) );
+ SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) );
SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor());
EnableAutocomplete(TRUE, TRUE);
@@ -174,7 +176,7 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
case EVENT_LOSEFOCUS:
if ( GetText().Len() == 0 )
{
- SetText( String( ::rtl::OUString::createFromAscii("Find") ) );
+ SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) );
SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor());
m_bToClearTextField = sal_True;
}
diff --git a/idl/source/prj/idldll.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.src
index f5fc8dab9c..ff1565e2d2 100644
--- a/idl/source/prj/idldll.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.src
@@ -25,55 +25,9 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_idl.hxx"
+#include <svx/dialogs.hrc>
-#ifdef WIN
-#include <svwin.h>
-
-#ifndef _SYSDEP_HXX
-#include <sysdep.hxx>
-#endif
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-
-/***************************************************************************
-|*
-|* LibMain()
-|*
-|* Beschreibung Initialisierungsfunktion der DLL
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+String RID_SVXSTR_FINDBAR_FIND
{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-/***************************************************************************
-|*
-|* WEP()
-|*
-|* Beschreibung DLL-Deinitialisierung
-|* Ersterstellung TH 05.05.93
-|* Letzte Aenderung TH 05.05.93
-|*
-***************************************************************************/
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
+ Text [ en-US ] = "Find" ;
+};
diff --git a/svx/source/unodialogs/textconversiondlgs/makefile.mk b/svx/source/unodialogs/textconversiondlgs/makefile.mk
index b5013ca9d1..ec0cdca262 100644
--- a/svx/source/unodialogs/textconversiondlgs/makefile.mk
+++ b/svx/source/unodialogs/textconversiondlgs/makefile.mk
@@ -88,3 +88,11 @@ $(SRS)$/$(TARGET).srs: $(INCCOM)$/chinese_direction.hrc
$(SLO)$/chinese_dictionarydialog.obj: $(INCCOM)$/chinese_direction.hrc
$(SLO)$/chinese_translationdialog.obj: $(INCCOM)$/chinese_direction.hrc
+
+ALLTAR : $(MISC)/textconversiondlgs.component
+
+$(MISC)/textconversiondlgs.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt textconversiondlgs.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt textconversiondlgs.component
diff --git a/svx/source/unodialogs/textconversiondlgs/services.cxx b/svx/source/unodialogs/textconversiondlgs/services.cxx
index f54d77c910..c80795a175 100644
--- a/svx/source/unodialogs/textconversiondlgs/services.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/services.cxx
@@ -53,13 +53,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, g_entries_unodialogs_chinesetranslation );
-}
-//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component b/svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component
new file mode 100644
index 0000000000..1847435836
--- /dev/null
+++ b/svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.linguistic2.ChineseTranslationDialog">
+ <service name="com.sun.star.linguistic2.ChineseTranslationDialog"/>
+ </implementation>
+</component>
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 1c6a0a17eb..389db0454d 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -634,10 +634,16 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
{
if( rSettings.mbExportOnlyBackground )
{
- pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize()));
- pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet());
- pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE));
- aShapes.push_back(pTempBackgroundShape);
+ const SdrPageProperties* pCorrectProperties = pPage->getCorrectSdrPageProperties();
+
+ if(pCorrectProperties)
+ {
+ pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize()));
+ pTempBackgroundShape->SetMergedItemSet(pCorrectProperties->GetItemSet());
+ pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ pTempBackgroundShape->NbcSetStyleSheet(pCorrectProperties->GetStyleSheet(), true);
+ aShapes.push_back(pTempBackgroundShape);
+ }
}
else
{
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 060ab89ffc..44b63a88a0 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -261,60 +261,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-static void writeInfo (
- registry::XRegistryKey * pRegistryKey,
- const OUString& rImplementationName,
- const uno::Sequence< OUString >& rServices)
-{
- uno::Reference< registry::XRegistryKey > xNewKey(
- pRegistryKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) );
-
- for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
- xNewKey->createKey( rServices.getConstArray()[i]);
-}
-
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
- void * , void * pRegistryKey)
-{
- if( pRegistryKey )
- {
- try
- {
- registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey );
-
- writeInfo( pKey, SvxShapeCollection::getImplementationName_Static(), SvxShapeCollection::getSupportedServiceNames_Static() );
- writeInfo( pKey, SvxUnoColorTable::getImplementationName_Static(), SvxUnoColorTable::getSupportedServiceNames_Static() );
- writeInfo( pKey, EnhancedCustomShapeEngine_getImplementationName(), EnhancedCustomShapeEngine_getSupportedServiceNames() );
- writeInfo( pKey, svx::RecoveryUI::st_getImplementationName(), svx::RecoveryUI::st_getSupportedServiceNames() );
- writeInfo( pKey, svx::GraphicExporter_getImplementationName(), svx::GraphicExporter_getSupportedServiceNames() );
- writeInfo( pKey, svx::FontHeightToolBoxControl::getImplementationName_Static(), svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
-
- writeInfo( pKey, svx::FindTextToolbarController::getImplementationName_Static(), svx::FindTextToolbarController::getSupportedServiceNames_Static() );
- writeInfo( pKey, svx::DownSearchToolboxController::getImplementationName_Static(), svx::DownSearchToolboxController::getSupportedServiceNames_Static() );
- writeInfo( pKey, svx::UpSearchToolboxController::getImplementationName_Static(), svx::UpSearchToolboxController::getSupportedServiceNames_Static() );
- writeInfo( pKey, svx::FindbarDispatcher::getImplementationName_Static(), svx::FindbarDispatcher::getSupportedServiceNames_Static() );
-
- writeInfo( pKey, ::unogallery::GalleryThemeProvider_getImplementationName(),::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
-
- // XPrimitiveFactory2D
- writeInfo( pKey,
- drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(),
- drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() );
-
- writeInfo( pKey, ::svx::SvXMLGraphicImportHelper_getImplementationName(),::svx::SvXMLGraphicImportHelper_getSupportedServiceNames() );
- writeInfo( pKey, ::svx::SvXMLGraphicExportHelper_getImplementationName(),::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() );
-// writeInfo( pKey, ::svx::ExtrusionDepthController_getImplementationName(),::svx::ExtrusionDepthController_getSupportedServiceNames() );
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return sal_True;
-}
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 8b5004334e..4eaa22e866 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -708,6 +708,7 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet&
// next entry
++aSrcIt;
}
+ const_cast< SvxItemPropertySet& >(rPropSet).ClearAllUsrAny();
}
}
diff --git a/svx/util/gal.dxp b/svx/util/gal.dxp
index 227006cc4e..e8f2e0a948 100644
--- a/svx/util/gal.dxp
+++ b/svx/util/gal.dxp
@@ -17,5 +17,4 @@ Gallery_InsertSdrObj
Gallery_GetThemeNameFromId
Gallery_BeginLocking
Gallery_EndLocking
-component_writeInfo
component_getFactory
diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk
index 050decc8d4..18f52487e4 100644
--- a/svx/util/makefile.mk
+++ b/svx/util/makefile.mk
@@ -196,3 +196,17 @@ RESLIB1SRSFILES= $(SRSFILELIST)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/svx.component $(MISC)/svxcore.component
+
+$(MISC)/svx.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ svx.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt svx.component
+
+$(MISC)/svxcore.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ svxcore.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt svxcore.component
diff --git a/svx/util/svx.component b/svx/util/svx.component
new file mode 100644
index 0000000000..5907d69fef
--- /dev/null
+++ b/svx/util/svx.component
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Draw.GraphicExporter">
+ <service name="com.sun.star.drawing.GraphicExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Svx.GraphicExportHelper">
+ <service name="com.sun.star.document.BinaryStreamResolver"/>
+ <service name="com.sun.star.document.GraphicObjectResolver"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Svx.GraphicImportHelper">
+ <service name="com.sun.star.document.BinaryStreamResolver"/>
+ <service name="com.sun.star.document.GraphicObjectResolver"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.gallery.GalleryThemeProvider">
+ <service name="com.sun.star.gallery.GalleryThemeProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.graphic.PrimitiveFactory2D">
+ <service name="com.sun.star.graphic.PrimitiveFactory2D"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.Impl.FindbarDispatcher">
+ <service name="com.sun.star.comp.svx.FindbarDispatcher"/>
+ <service name="com.sun.star.frame.ProtocolHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.RecoveryUI">
+ <service name="com.sun.star.dialog.RecoveryUI"/>
+ </implementation>
+ <implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine">
+ <service name="com.sun.star.drawing.CustomShapeEngine"/>
+ </implementation>
+ <implementation name="com.sun.star.drawing.SvxShapeCollection">
+ <service name="com.sun.star.drawing.ShapeCollection"/>
+ </implementation>
+ <implementation name="com.sun.star.drawing.SvxUnoColorTable">
+ <service name="com.sun.star.drawing.ColorTable"/>
+ </implementation>
+ <implementation name="com.sun.star.svx.DownSearchToolboxController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.svx.FindTextToolboxController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.svx.FontHeightToolBoxController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.svx.UpSearchToolboxController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+</component>
diff --git a/svx/util/svx.dxp b/svx/util/svx.dxp
index 9630d7e067..f0e1c69934 100644
--- a/svx/util/svx.dxp
+++ b/svx/util/svx.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/svx/util/svxcore.component b/svx/util/svxcore.component
new file mode 100644
index 0000000000..2f829cb52a
--- /dev/null
+++ b/svx/util/svxcore.component
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.svx.ExtrusionDepthController">
+ <service name="com.sun.star.frame.PopupMenuController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.ExtrusionDirectionController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.ExtrusionLightingController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.ExtrusionSurfaceController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.FontWorkAlignmentController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.svx.FontWorkCharacterSpacingController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+</component>
diff --git a/svx/util/svxpch.cxx b/svx/util/svxpch.cxx
index 9e35443965..819fbfd7f4 100644
--- a/svx/util/svxpch.cxx
+++ b/svx/util/svxpch.cxx
@@ -29,7 +29,7 @@
#include "precompiled_svx.hxx"
#include <thread.hxx>
#include <sysdep.hxx>
-#if defined(WNT) || defined (WIN)
+#if defined(WNT)
#include <svwin.h>
#endif
#include <tlintl.hxx>
diff --git a/sysui/desktop/cleanversion/makefile.mk b/sysui/desktop/cleanversion/makefile.mk
index 71a0d7e3df..40651af2d1 100644
--- a/sysui/desktop/cleanversion/makefile.mk
+++ b/sysui/desktop/cleanversion/makefile.mk
@@ -43,7 +43,7 @@ ALLTAR: $(MISC)$/cleanup.flag
# version changed - bin previous trees
$(MISC)$/cleanup.flag : ..$/productversion.mk
- rm -rf `ls $(MISC) | grep -v -x $(MISC)$/logs` && $(TOUCH) $@
+ rm -rf `ls -d $(MISC)$/* | sed '/\/logs$/d'` && $(TOUCH) $@
.ENDIF # "$(MISC)"!=""
diff --git a/sysui/util/exports.dxp b/sysui/util/exports.dxp
index 028ac41759..f0e1c69934 100644
--- a/sysui/util/exports.dxp
+++ b/sysui/util/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/ucb/prj/d.lst b/ucb/prj/d.lst
index b02c8184a6..65a32e21fb 100644
--- a/ucb/prj/d.lst
+++ b/ucb/prj/d.lst
@@ -31,5 +31,16 @@
..\source\ucp\gvfs\ucpgvfs.xml %_DEST%\xml%_EXT%\ucpgvfs.xml
..\source\ucp\tdoc\ucptdoc.xml %_DEST%\xml%_EXT%\ucptdoc.xml
-..\%__SRC%\misc\ucpgvfs-ucd.txt %_DEST%\bin%_EXT%\ucpgvfs-ucd.txt
-..\%__SRC%\misc\ucpgio-ucd.txt %_DEST%\bin%_EXT%\ucpgio-ucd.txt
+..\%__SRC%\misc\ucpgvfs.component %_DEST%\xml%_EXT%\ucpgvfs.component
+..\%__SRC%\misc\ucpgio.component %_DEST%\xml%_EXT%\ucpgio.component
+..\%__SRC%\misc\cached1.component %_DEST%\xml%_EXT%\cached1.component
+..\%__SRC%\misc\srtrs1.component %_DEST%\xml%_EXT%\srtrs1.component
+..\%__SRC%\misc\ucb1.component %_DEST%\xml%_EXT%\ucb1.component
+..\%__SRC%\misc\ucpdav1.component %_DEST%\xml%_EXT%\ucpdav1.component
+..\%__SRC%\misc\ucpexpand1.component %_DEST%\xml%_EXT%\ucpexpand1.component
+..\%__SRC%\misc\ucpext.component %_DEST%\xml%_EXT%\ucpext.component
+..\%__SRC%\misc\ucpfile1.component %_DEST%\xml%_EXT%\ucpfile1.component
+..\%__SRC%\misc\ucpftp1.component %_DEST%\xml%_EXT%\ucpftp1.component
+..\%__SRC%\misc\ucphier1.component %_DEST%\xml%_EXT%\ucphier1.component
+..\%__SRC%\misc\ucppkg1.component %_DEST%\xml%_EXT%\ucppkg1.component
+..\%__SRC%\misc\ucptdoc1.component %_DEST%\xml%_EXT%\ucptdoc1.component
diff --git a/ucb/source/cacher/cached1.component b/ucb/source/cacher/cached1.component
new file mode 100644
index 0000000000..aa19e54b5d
--- /dev/null
+++ b/ucb/source/cacher/cached1.component
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.CachedContentResultSetFactory">
+ <service name="com.sun.star.ucb.CachedContentResultSetFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.CachedContentResultSetStubFactory">
+ <service name="com.sun.star.ucb.CachedContentResultSetStubFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.CachedDynamicResultSetFactory">
+ <service name="com.sun.star.ucb.CachedDynamicResultSetFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.CachedDynamicResultSetStubFactory">
+ <service name="com.sun.star.ucb.CachedDynamicResultSetStubFactory"/>
+ </implementation>
+</component>
diff --git a/ucb/source/cacher/cacheserv.cxx b/ucb/source/cacher/cacheserv.cxx
index 031276472b..b9ed8e369a 100644
--- a/ucb/source/cacher/cacheserv.cxx
+++ b/ucb/source/cacher/cacheserv.cxx
@@ -41,45 +41,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::registry;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
-{
- OUString aKeyName( OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< XRegistryKey > xKey;
- try
- {
- xKey = static_cast< XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** )
{
@@ -87,44 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // CachedContentResultSetFactory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- CachedContentResultSetFactory::getImplementationName_Static(),
- CachedContentResultSetFactory::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // CachedContentResultSetStubFactory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- CachedContentResultSetStubFactory::getImplementationName_Static(),
- CachedContentResultSetStubFactory::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // CachedDynamicResultSetFactory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- CachedDynamicResultSetFactory::getImplementationName_Static(),
- CachedDynamicResultSetFactory::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // CachedDynamicResultSetStubFactory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- CachedDynamicResultSetStubFactory::getImplementationName_Static(),
- CachedDynamicResultSetStubFactory::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/ucb/source/cacher/makefile.mk b/ucb/source/cacher/makefile.mk
index 600fefc174..24d245ec6c 100644
--- a/ucb/source/cacher/makefile.mk
+++ b/ucb/source/cacher/makefile.mk
@@ -66,3 +66,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/cached1.component
+
+$(MISC)/cached1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ cached1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt cached1.component
diff --git a/ucb/source/core/exports2.dxp b/ucb/source/core/exports2.dxp
index a1936474f7..8091459f4d 100644
--- a/ucb/source/core/exports2.dxp
+++ b/ucb/source/core/exports2.dxp
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
_ZTIN3com3sun4star3ucb34InteractiveBadTransferURLExceptionE
diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk
index 34765eb742..6360f82320 100644
--- a/ucb/source/core/makefile.mk
+++ b/ucb/source/core/makefile.mk
@@ -74,3 +74,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucb1.component
+
+$(MISC)/ucb1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucb1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucb1.component
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index e44956b2a0..75a7f8bfc0 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
#include <com/sun/star/ucb/XContentProviderFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <ucbhelper/cancelcommandexecution.hxx>
@@ -182,6 +183,63 @@ void makeAndAppendXMLName(
}
}
+bool createContentProviderData(
+ const rtl::OUString & rProvider,
+ const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess,
+ ContentProviderData & rInfo)
+{
+ // Obtain service name.
+ rtl::OUStringBuffer aKeyBuffer (rProvider);
+ aKeyBuffer.appendAscii( "/ServiceName" );
+
+ rtl::OUString aValue;
+ try
+ {
+ if ( !( rxHierNameAccess->getByHierarchicalName(
+ aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
+ {
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - "
+ "Error getting item value!" );
+ }
+ }
+ catch (container::NoSuchElementException &)
+ {
+ return false;
+ }
+
+ rInfo.ServiceName = aValue;
+
+ // Obtain URL Template.
+ aKeyBuffer.append(rProvider);
+ aKeyBuffer.appendAscii( "/URLTemplate" );
+
+ if ( !( rxHierNameAccess->getByHierarchicalName(
+ aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
+ {
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - "
+ "Error getting item value!" );
+ }
+
+ rInfo.URLTemplate = aValue;
+
+ // Obtain Arguments.
+ aKeyBuffer.append(rProvider);
+ aKeyBuffer.appendAscii( "/Arguments" );
+
+ if ( !( rxHierNameAccess->getByHierarchicalName(
+ aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
+ {
+ OSL_ENSURE( false,
+ "UniversalContentBroker::getContentProviderData - "
+ "Error getting item value!" );
+ }
+
+ rInfo.Arguments = aValue;
+ return true;
+}
+
}
//=========================================================================
@@ -647,28 +705,10 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent&
sal_Int32 nCount = Event.Changes.getLength();
if ( nCount )
{
-
- uno::Reference< lang::XMultiServiceFactory > xConfigProv(
- m_xSMgr->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.configuration.ConfigurationProvider" ) ),
- uno::UNO_QUERY_THROW );
-
- uno::Sequence< uno::Any > aArguments( 1 );
- beans::PropertyValue aProperty;
- aProperty.Name
- = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
- aProperty.Value <<= Event.Base;
- aArguments[ 0 ] <<= aProperty;
-
- uno::Reference< uno::XInterface > xInterface(
- xConfigProv->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" ) ),
- aArguments ) );
-
- uno::Reference< container::XHierarchicalNameAccess >
- xHierNameAccess( xInterface, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess;
+ Event.Base >>= xHierNameAccess;
+
+ OSL_ASSERT( xHierNameAccess.is() );
const util::ElementChange* pElementChanges
= Event.Changes.getConstArray();
@@ -682,9 +722,18 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent&
ContentProviderData aInfo;
- createContentProviderData(aKey, xHierNameAccess, aInfo);
-
- aData.push_back(aInfo);
+ // Removal of UCPs from the configuration leads to changesOccurred
+ // notifications, too, but it is hard to tell for a given
+ // ElementChange whether it is an addition or a removal, so as a
+ // heuristic consider as removals those that cause a
+ // NoSuchElementException in createContentProviderData.
+ //
+ // For now, removal of UCPs from the configuration is simply ignored
+ // (and not reflected in the UCB's data structures):
+ if (createContentProviderData(aKey, xHierNameAccess, aInfo))
+ {
+ aData.push_back(aInfo);
+ }
}
prepareAndRegister(aData);
@@ -852,7 +901,10 @@ bool UniversalContentBroker::getContentProviderData(
makeAndAppendXMLName( aElemBuffer, pElems[ n ] );
aElemBuffer.appendAscii( "']" );
- createContentProviderData(aElemBuffer.makeStringAndClear(), xHierNameAccess, aInfo);
+ OSL_VERIFY(
+ createContentProviderData(
+ aElemBuffer.makeStringAndClear(), xHierNameAccess,
+ aInfo));
rListToFill.push_back( aInfo );
}
@@ -884,55 +936,6 @@ bool UniversalContentBroker::getContentProviderData(
return true;
}
-void UniversalContentBroker::createContentProviderData(
- const rtl::OUString & rProvider,
- const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess,
- ContentProviderData & rInfo)
-{
- // Obtain service name.
- rtl::OUStringBuffer aKeyBuffer (rProvider);
- aKeyBuffer.appendAscii( "/ServiceName" );
-
- rtl::OUString aValue;
- if ( !( rxHierNameAccess->getByHierarchicalName(
- aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
- {
- OSL_ENSURE( false,
- "UniversalContentBroker::getContentProviderData - "
- "Error getting item value!" );
- }
-
- rInfo.ServiceName = aValue;
-
- // Obtain URL Template.
- aKeyBuffer.append(rProvider);
- aKeyBuffer.appendAscii( "/URLTemplate" );
-
- if ( !( rxHierNameAccess->getByHierarchicalName(
- aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
- {
- OSL_ENSURE( false,
- "UniversalContentBroker::getContentProviderData - "
- "Error getting item value!" );
- }
-
- rInfo.URLTemplate = aValue;
-
- // Obtain Arguments.
- aKeyBuffer.append(rProvider);
- aKeyBuffer.appendAscii( "/Arguments" );
-
- if ( !( rxHierNameAccess->getByHierarchicalName(
- aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
- {
- OSL_ENSURE( false,
- "UniversalContentBroker::getContentProviderData - "
- "Error getting item value!" );
- }
-
- rInfo.Arguments = aValue;
-}
-
//=========================================================================
//
// ProviderListEntry_Impl implementation.
diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx
index db54af4688..f7318ad27d 100644
--- a/ucb/source/core/ucb.hxx
+++ b/ucb/source/core/ucb.hxx
@@ -40,7 +40,6 @@
#include <com/sun/star/util/XChangesListener.hpp>
#include <com/sun/star/util/XChangesNotifier.hpp>
#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/weak.hxx>
@@ -204,11 +203,6 @@ private:
void prepareAndRegister( const ucbhelper::ContentProviderDataList& rData);
- void createContentProviderData(
- const rtl::OUString& rProvider,
- const com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >& rxHierNameAccess,
- ucbhelper::ContentProviderData& rInfo);
-
com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
diff --git a/ucb/source/core/ucb1.component b/ucb/source/core/ucb1.component
new file mode 100644
index 0000000000..e9d408822c
--- /dev/null
+++ b/ucb/source/core/ucb1.component
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.CommandEnvironment">
+ <service name="com.sun.star.ucb.CommandEnvironment"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.UcbContentProviderProxyFactory">
+ <service name="com.sun.star.ucb.ContentProviderProxyFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.UcbPropertiesManager">
+ <service name="com.sun.star.ucb.PropertiesManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.UcbStore">
+ <service name="com.sun.star.ucb.Store"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.UniversalContentBroker">
+ <service name="com.sun.star.ucb.UniversalContentBroker"/>
+ </implementation>
+</component>
diff --git a/ucb/source/core/ucbserv.cxx b/ucb/source/core/ucbserv.cxx
index 9c22dabe18..a0f28b8c55 100644
--- a/ucb/source/core/ucbserv.cxx
+++ b/ucb/source/core/ucbserv.cxx
@@ -29,7 +29,6 @@
#include "precompiled_ucb.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include "ucb.hxx"
#include "ucbstore.hxx"
#include "ucbprops.hxx"
@@ -39,46 +38,6 @@
using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
-using namespace com::sun::star::registry;
-
-//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
-{
- OUString aKeyName( OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< XRegistryKey > xKey;
- try
- {
- xKey = static_cast< XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
@@ -88,52 +47,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // Universal Content Broker.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- UniversalContentBroker::getImplementationName_Static(),
- UniversalContentBroker::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // UCB Store.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- UcbStore::getImplementationName_Static(),
- UcbStore::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // UCB PropertiesManager.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- UcbPropertiesManager::getImplementationName_Static(),
- UcbPropertiesManager::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // UCP Proxy Factory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- UcbContentProviderProxyFactory::getImplementationName_Static(),
- UcbContentProviderProxyFactory::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // Command Environment.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static(),
- ucb_cmdenv::UcbCommandEnvironment::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 7bf58a2001..9b4be3d28b 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -274,8 +274,9 @@ UcbStore::createPropertySetRegistry( const OUString& )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
if ( !m_pImpl->m_xTheRegistry.is() )
- m_pImpl->m_xTheRegistry = new PropertySetRegistry( m_xSMgr, *this );
+ m_pImpl->m_xTheRegistry = new PropertySetRegistry( m_xSMgr, getInitArgs() );
}
+
return m_pImpl->m_xTheRegistry;
}
@@ -294,22 +295,6 @@ void SAL_CALL UcbStore::initialize( const Sequence< Any >& aArguments )
}
//=========================================================================
-//
-// New methods.
-//
-//=========================================================================
-
-void UcbStore::removeRegistry()
-{
- if ( m_pImpl->m_xTheRegistry.is() )
- {
- osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( m_pImpl->m_xTheRegistry.is() )
- m_pImpl->m_xTheRegistry = 0;
- }
-}
-
-//=========================================================================
const Sequence< Any >& UcbStore::getInitArgs() const
{
return m_pImpl->m_aInitArgs;
@@ -323,7 +308,7 @@ const Sequence< Any >& UcbStore::getInitArgs() const
struct PropertySetRegistry_Impl
{
- UcbStore* m_pCreator;
+ const Sequence< Any > m_aInitArgs;
PropertySetMap_Impl m_aPropSets;
Reference< XMultiServiceFactory > m_xConfigProvider;
Reference< XInterface > m_xRootReadAccess;
@@ -332,18 +317,11 @@ struct PropertySetRegistry_Impl
sal_Bool m_bTriedToGetRootReadAccess; // #82494#
sal_Bool m_bTriedToGetRootWriteAccess; // #82494#
- PropertySetRegistry_Impl( UcbStore& rCreator )
- : m_pCreator( &rCreator ),
+ PropertySetRegistry_Impl( const Sequence< Any > &rInitArgs )
+ : m_aInitArgs( rInitArgs ),
m_bTriedToGetRootReadAccess( sal_False ),
m_bTriedToGetRootWriteAccess( sal_False )
{
- m_pCreator->acquire();
- }
-
- ~PropertySetRegistry_Impl()
- {
- m_pCreator->removeRegistry();
- m_pCreator->release();
}
};
@@ -359,9 +337,9 @@ struct PropertySetRegistry_Impl
PropertySetRegistry::PropertySetRegistry(
const Reference< XMultiServiceFactory >& rXSMgr,
- UcbStore& rCreator )
+ const Sequence< Any > &rInitArgs )
: m_xSMgr( rXSMgr ),
- m_pImpl( new PropertySetRegistry_Impl( rCreator ) )
+ m_pImpl( new PropertySetRegistry_Impl( rInitArgs ) )
{
}
@@ -1094,8 +1072,7 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
if ( !m_pImpl->m_xConfigProvider.is() )
{
- const Sequence< Any >& rInitArgs
- = m_pImpl->m_pCreator->getInitArgs();
+ const Sequence< Any >& rInitArgs = m_pImpl->m_aInitArgs;
if ( rInitArgs.getLength() > 0 )
{
diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx
index a28a016724..e1043adf0a 100644
--- a/ucb/source/core/ucbstore.hxx
+++ b/ucb/source/core/ucbstore.hxx
@@ -93,9 +93,6 @@ public:
throw( ::com::sun::star::uno::Exception,
::com::sun::star::uno::RuntimeException );
- // New
- void removeRegistry();
-
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&
getInitArgs() const;
};
@@ -132,7 +129,8 @@ public:
PropertySetRegistry(
const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rXSMgr,
- UcbStore& rCreator );
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rInitArgs);
virtual ~PropertySetRegistry();
// XInterface
diff --git a/ucb/source/sorter/makefile.mk b/ucb/source/sorter/makefile.mk
index 68a9959589..008e39b4bc 100644
--- a/ucb/source/sorter/makefile.mk
+++ b/ucb/source/sorter/makefile.mk
@@ -61,3 +61,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/srtrs1.component
+
+$(MISC)/srtrs1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ srtrs1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt srtrs1.component
diff --git a/ucb/source/sorter/sortmain.cxx b/ucb/source/sorter/sortmain.cxx
index a1c781c4d4..1f533c3948 100644
--- a/ucb/source/sorter/sortmain.cxx
+++ b/ucb/source/sorter/sortmain.cxx
@@ -30,51 +30,10 @@
#include <sortdynres.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
-using namespace com::sun::star::registry;
-
-//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
-{
- OUString aKeyName( OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< XRegistryKey > xKey;
- try
- {
- xKey = static_cast< XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
@@ -84,20 +43,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // SortedDynamicResultSetFactory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- SortedDynamicResultSetFactory::getImplementationName_Static(),
- SortedDynamicResultSetFactory::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/ucb/source/sorter/srtrs1.component b/ucb/source/sorter/srtrs1.component
new file mode 100644
index 0000000000..c32705160c
--- /dev/null
+++ b/ucb/source/sorter/srtrs1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.SortedDynamicResultSetFactory">
+ <service name="com.sun.star.ucb.SortedDynamicResultSetFactory"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/expand/makefile.mk b/ucb/source/ucp/expand/makefile.mk
index 32de160318..70e441171a 100644
--- a/ucb/source/ucp/expand/makefile.mk
+++ b/ucb/source/ucp/expand/makefile.mk
@@ -59,3 +59,11 @@ DEF1NAME = $(SHL1TARGET)
.ENDIF # L10N_framework
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/ucpexpand1.component
+
+$(MISC)/ucpexpand1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpexpand1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpexpand1.component
diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx
index ea72dedbc9..7f691ece8c 100644
--- a/ucb/source/ucp/expand/ucpexpand.cxx
+++ b/ucb/source/ucp/expand/ucpexpand.cxx
@@ -273,14 +273,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, s_entries );
-}
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName,
lang::XMultiServiceFactory * pServiceManager,
diff --git a/ucb/source/ucp/expand/ucpexpand1.component b/ucb/source/ucp/expand/ucpexpand1.component
new file mode 100644
index 0000000000..c8a7e8e18c
--- /dev/null
+++ b/ucb/source/ucp/expand/ucpexpand1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.ExpandContentProvider">
+ <service name="com.sun.star.ucb.ExpandContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/ext/makefile.mk b/ucb/source/ucp/ext/makefile.mk
index 23c30b3bda..e106b8e1ba 100644
--- a/ucb/source/ucp/ext/makefile.mk
+++ b/ucb/source/ucp/ext/makefile.mk
@@ -63,3 +63,11 @@ SHL1DEF = $(MISC)$/$(SHL1TARGET).def
DEF1NAME = $(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/ucpext.component
+
+$(MISC)/ucpext.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpext.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpext.component
diff --git a/ucb/source/ucp/ext/ucpext.component b/ucb/source/ucp/ext/ucpext.component
new file mode 100644
index 0000000000..2982529e53
--- /dev/null
+++ b/ucb/source/ucp/ext/ucpext.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="org.openoffice.comp.ucp.ext.ContentProvider">
+ <service name="com.sun.star.ucb.ExtensionContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/ext/ucpext_services.cxx b/ucb/source/ucp/ext/ucpext_services.cxx
index 5e2d995d39..26897b5b76 100644
--- a/ucb/source/ucp/ext/ucpext_services.cxx
+++ b/ucb/source/ucp/ext/ucpext_services.cxx
@@ -80,12 +80,6 @@ extern "C"
}
//------------------------------------------------------------------------------------------------------------------
- sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, ::ucb::ucp::ext::s_aServiceEntries );
- }
-
- //------------------------------------------------------------------------------------------------------------------
void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::ucb::ucp::ext::s_aServiceEntries );
diff --git a/ucb/source/ucp/file/exports2.dxp b/ucb/source/ucp/file/exports2.dxp
index 6c42314f22..4804c8d0ae 100644
--- a/ucb/source/ucp/file/exports2.dxp
+++ b/ucb/source/ucp/file/exports2.dxp
@@ -1,5 +1,4 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
_ZTIN3com3sun4star3ucb31InteractiveAugmentedIOExceptionE
diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk
index 8007a24923..3d97cb2387 100644
--- a/ucb/source/ucp/file/makefile.mk
+++ b/ucb/source/ucp/file/makefile.mk
@@ -78,3 +78,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucpfile1.component
+
+$(MISC)/ucpfile1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpfile1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpfile1.component
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 1c4f268e93..04a51d7f70 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -31,7 +31,6 @@
#include <osl/file.hxx>
#include <osl/socket.h>
#include <cppuhelper/factory.hxx>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBBUTE_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
@@ -53,45 +52,6 @@ using namespace com::sun::star::ucb;
using namespace com::sun::star::container;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** )
{
@@ -99,20 +59,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // File Content Provider.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- fileaccess::shell::getImplementationName_static(),
- fileaccess::shell::getSupportedServiceNames_static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * )
{
diff --git a/ucb/source/ucp/file/ucpfile1.component b/ucb/source/ucp/file/ucpfile1.component
new file mode 100644
index 0000000000..2803245122
--- /dev/null
+++ b/ucb/source/ucp/file/ucpfile1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.FileProvider">
+ <service name="com.sun.star.ucb.FileContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/ftp/ftpservices.cxx b/ucb/source/ucp/ftp/ftpservices.cxx
index ca2cf3823d..1eb9feca51 100644
--- a/ucb/source/ucp/ftp/ftpservices.cxx
+++ b/ucb/source/ucp/ftp/ftpservices.cxx
@@ -36,45 +36,6 @@ using namespace com::sun::star;
using namespace ftp;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- uno::Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
@@ -82,21 +43,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // FTP Content Provider.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- FTPContentProvider::getImplementationName_Static(),
- FTPContentProvider::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/ucb/source/ucp/ftp/makefile.mk b/ucb/source/ucp/ftp/makefile.mk
index a0f1410040..c2f1ce154a 100644
--- a/ucb/source/ucp/ftp/makefile.mk
+++ b/ucb/source/ucp/ftp/makefile.mk
@@ -104,3 +104,11 @@ DEF1NAME=$(SHL1TARGET)
+
+ALLTAR : $(MISC)/ucpftp1.component
+
+$(MISC)/ucpftp1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpftp1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpftp1.component
diff --git a/ucb/source/ucp/ftp/ucpftp1.component b/ucb/source/ucp/ftp/ucpftp1.component
new file mode 100644
index 0000000000..fa4cfe6e75
--- /dev/null
+++ b/ucb/source/ucp/ftp/ucpftp1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.FTPContentProvider">
+ <service name="com.sun.star.ucb.FTPContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/gio/gio_provider.cxx b/ucb/source/ucp/gio/gio_provider.cxx
index 9921f3a118..d84ea35bd3 100644
--- a/ucb/source/ucp/gio/gio_provider.cxx
+++ b/ucb/source/ucp/gio/gio_provider.cxx
@@ -102,41 +102,6 @@ ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider );
}
-static sal_Bool writeInfo( void *pRegistryKey,
- const rtl::OUString &rImplementationName, uno::Sequence< rtl::OUString > const &rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * > (pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {}
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char **ppEnvTypeName, uno_Environment **)
{
diff --git a/ucb/source/ucp/gio/makefile.mk b/ucb/source/ucp/gio/makefile.mk
index 86b32fbc07..4cca611c7e 100644
--- a/ucb/source/ucp/gio/makefile.mk
+++ b/ucb/source/ucp/gio/makefile.mk
@@ -37,8 +37,6 @@ NO_BSYMBOLIC=TRUE
.INCLUDE: settings.mk
.IF "$(L10N_framework)"==""
-UNIXTEXT=$(MISC)/$(TARGET)-ucd.txt
-
.IF "$(ENABLE_GIO)"!=""
COMPILER_WARN_ALL=TRUE
PKGCONFIG_MODULES=gio-2.0
@@ -79,3 +77,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF # L10N_framework
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucpgio.component
+
+$(MISC)/ucpgio.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpgio.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpgio.component
diff --git a/ucb/source/ucp/gio/ucpgio-ucd.txt b/ucb/source/ucp/gio/ucpgio-ucd.txt
deleted file mode 100644
index ce7657fa73..0000000000
--- a/ucb/source/ucp/gio/ucpgio-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.comp.GIOContentProvider
-ComponentName=ucpgio1.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ucb.GIOContentProvider
diff --git a/ucb/source/ucp/gio/ucpgio.component b/ucb/source/ucp/gio/ucpgio.component
new file mode 100644
index 0000000000..caa8fc361f
--- /dev/null
+++ b/ucb/source/ucp/gio/ucpgio.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.GIOContentProvider">
+ <service name="com.sun.star.ucb.GIOContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/gvfs/gvfs_provider.cxx b/ucb/source/ucp/gvfs/gvfs_provider.cxx
index 92fa95c0e6..07e232317a 100644
--- a/ucb/source/ucp/gvfs/gvfs_provider.cxx
+++ b/ucb/source/ucp/gvfs/gvfs_provider.cxx
@@ -143,42 +143,6 @@ ContentProvider::queryContent(
//============================ shlib entry points =============================================
-
-// cut and paste verbatim from webdav (that sucks).
-static sal_Bool
-writeInfo( void *pRegistryKey,
- const rtl::OUString &rImplementationName,
- uno::Sequence< rtl::OUString > const &rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try {
- xKey = static_cast< registry::XRegistryKey * >
- (pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & ) {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) {
- try {
- xKey->createKey( rServiceNames[ n ] );
-
- } catch ( registry::InvalidRegistryException const & ) {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
extern "C" void SAL_CALL
component_getImplementationEnvironment( const sal_Char **ppEnvTypeName,
uno_Environment **/*ppEnv*/ )
@@ -186,15 +150,6 @@ component_getImplementationEnvironment( const sal_Char **ppEnvTypeName,
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-extern "C" sal_Bool SAL_CALL
-component_writeInfo( void */*pServiceManager*/,
- void *pRegistryKey )
-{
- return pRegistryKey &&
- writeInfo( pRegistryKey,
- ::gvfs::ContentProvider::getImplementationName_Static(),
- ::gvfs::ContentProvider::getSupportedServiceNames_Static() );
-}
extern "C" void * SAL_CALL
component_getFactory( const sal_Char *pImplName,
void *pServiceManager,
diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk
index a0e8a0bda3..87fcca87cf 100644
--- a/ucb/source/ucp/gvfs/makefile.mk
+++ b/ucb/source/ucp/gvfs/makefile.mk
@@ -37,8 +37,6 @@ NO_BSYMBOLIC=TRUE
.INCLUDE: settings.mk
.IF "$(L10N_framework)"==""
-UNIXTEXT=$(MISC)/$(TARGET)-ucd.txt
-
.IF "$(ENABLE_GNOMEVFS)"!=""
COMPILER_WARN_ALL=TRUE
PKGCONFIG_MODULES=gnome-vfs-2.0
@@ -84,3 +82,10 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.INCLUDE: target.mk
+ALLTAR : $(MISC)/ucpgvfs.component
+
+$(MISC)/ucpgvfs.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpgvfs.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpgvfs.component
diff --git a/ucb/source/ucp/gvfs/ucpgvfs-ucd.txt b/ucb/source/ucp/gvfs/ucpgvfs-ucd.txt
deleted file mode 100644
index e9ecce6eff..0000000000
--- a/ucb/source/ucp/gvfs/ucpgvfs-ucd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[ComponentDescriptor]
-ImplementationName=com.sun.star.comp.GnomeVFSContentProvider
-ComponentName=ucpgvfs1.uno.so
-LoaderName=com.sun.star.loader.SharedLibrary
-[SupportedServices]
-com.sun.star.ucb.GnomeVFSContentProvider
diff --git a/ucb/source/ucp/gvfs/ucpgvfs.component b/ucb/source/ucp/gvfs/ucpgvfs.component
new file mode 100644
index 0000000000..cec3e4d1e2
--- /dev/null
+++ b/ucb/source/ucp/gvfs/ucpgvfs.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.GnomeVFSContentProvider">
+ <service name="com.sun.star.ucb.GnomeVFSContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/hierarchy/hierarchyservices.cxx b/ucb/source/ucp/hierarchy/hierarchyservices.cxx
index 3249334d90..d884b29366 100644
--- a/ucb/source/ucp/hierarchy/hierarchyservices.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyservices.cxx
@@ -29,7 +29,6 @@
#include "precompiled_ucb.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include "hierarchyprovider.hxx"
#include "hierarchydatasource.hxx"
@@ -37,45 +36,6 @@ using namespace com::sun::star;
using namespace hierarchy_ucp;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- uno::Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
@@ -83,29 +43,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // Hierarchy Content Provider.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- HierarchyContentProvider::getImplementationName_Static(),
- HierarchyContentProvider::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // Hierarchy Data Source.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- HierarchyDataSource::getImplementationName_Static(),
- HierarchyDataSource::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/ucb/source/ucp/hierarchy/makefile.mk b/ucb/source/ucp/hierarchy/makefile.mk
index 00b481b5e7..9263faa24b 100644
--- a/ucb/source/ucp/hierarchy/makefile.mk
+++ b/ucb/source/ucp/hierarchy/makefile.mk
@@ -82,3 +82,11 @@ DEF1NAME=$(SHL1TARGET)
.ENDIF # L10N_framework
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucphier1.component
+
+$(MISC)/ucphier1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucphier1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucphier1.component
diff --git a/ucb/source/ucp/hierarchy/ucphier1.component b/ucb/source/ucp/hierarchy/ucphier1.component
new file mode 100644
index 0000000000..5483187d86
--- /dev/null
+++ b/ucb/source/ucp/hierarchy/ucphier1.component
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.HierarchyContentProvider">
+ <service name="com.sun.star.ucb.HierarchyContentProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.HierarchyDataSource">
+ <service name="com.sun.star.ucb.DefaultHierarchyDataSource"/>
+ <service name="com.sun.star.ucb.HierarchyDataSource"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/odma/odma_lib.cxx b/ucb/source/ucp/odma/odma_lib.cxx
index b6a0d3ada1..69142a7b0e 100644
--- a/ucb/source/ucp/odma/odma_lib.cxx
+++ b/ucb/source/ucp/odma/odma_lib.cxx
@@ -78,10 +78,6 @@ namespace odma
if (bLoaded)
return sal_True;
::rtl::OUString sPath;
- #ifdef WIN
- sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA.DLL"));
-
- #endif
#ifdef WNT
sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL"));
#endif
diff --git a/ucb/source/ucp/odma/odma_services.cxx b/ucb/source/ucp/odma/odma_services.cxx
index 1140083942..42fc7e4cdd 100644
--- a/ucb/source/ucp/odma/odma_services.cxx
+++ b/ucb/source/ucp/odma/odma_services.cxx
@@ -40,45 +40,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::registry;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
-{
- OUString aKeyName( OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< XRegistryKey > xKey;
- try
- {
- xKey = static_cast< XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk
index 8c6dcda318..b78150aed2 100644
--- a/ucb/source/ucp/package/makefile.mk
+++ b/ucb/source/ucp/package/makefile.mk
@@ -68,6 +68,7 @@ SHL1IMPLIB=i$(TARGET)
SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
+ $(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALLIB) \
@@ -86,3 +87,11 @@ DEF1NAME=$(SHL1TARGET)
.ENDIF # L10N_framework
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucppkg1.component
+
+$(MISC)/ucppkg1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucppkg1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucppkg1.component
diff --git a/ucb/source/ucp/package/pkgservices.cxx b/ucb/source/ucp/package/pkgservices.cxx
index 61edd11642..b287536f33 100644
--- a/ucb/source/ucp/package/pkgservices.cxx
+++ b/ucb/source/ucp/package/pkgservices.cxx
@@ -34,50 +34,6 @@
using namespace com::sun::star;
-namespace {
-
-//=========================================================================
-sal_Bool writeInfo(
- void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- uno::Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-} // namespace
-
//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
@@ -86,21 +42,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // Write info into registry.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- ::package_ucp::ContentProvider::getImplementationName_Static(),
- ::package_ucp::ContentProvider::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/ucb/source/ucp/package/pkguri.cxx b/ucb/source/ucp/package/pkguri.cxx
index 12a54eeda5..4fa7418432 100644
--- a/ucb/source/ucp/package/pkguri.cxx
+++ b/ucb/source/ucp/package/pkguri.cxx
@@ -36,6 +36,7 @@
#include "rtl/ustrbuf.hxx"
#include "osl/diagnose.h"
+#include "comphelper/storagehelper.hxx"
#include "../inc/urihelper.hxx"
@@ -85,7 +86,7 @@ void PackageUri::init() const
if ( ( m_aUri.getLength() < PACKAGE_URL_SCHEME_LENGTH + 4 ) )
{
// error, but remember that we did a init().
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
return;
}
@@ -100,7 +101,7 @@ void PackageUri::init() const
!= sal_Unicode( '/' ) ) )
{
// error, but remember that we did a init().
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
return;
}
@@ -128,8 +129,8 @@ void PackageUri::init() const
{
m_aParam +=
( m_aParam.getLength()
- ? ::rtl::OUString::createFromAscii( "&purezip" )
- : ::rtl::OUString::createFromAscii( "?purezip" ) );
+ ? ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "&purezip" ) )
+ : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "?purezip" ) ) );
}
aPureUri = aPureUri.replaceAt( 0,
@@ -143,7 +144,7 @@ void PackageUri::init() const
// Only <scheme>:/// - Empty authority
// error, but remember that we did a init().
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
return;
}
else if ( nEnd == ( aPureUri.getLength() - 1 ) )
@@ -154,7 +155,7 @@ void PackageUri::init() const
// Only <scheme>://// or <scheme>://<something>//
// error, but remember that we did a init().
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
return;
}
@@ -175,7 +176,7 @@ void PackageUri::init() const
nStart, aPureUri.getLength() - nStart, aNormPackage );
m_aPackage
= ::ucb_impl::urihelper::decodeSegment( aNormPackage );
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
m_aUri = m_aUri.replaceAt( 0,
( nParam >= 0 )
? nParam
@@ -193,16 +194,19 @@ void PackageUri::init() const
{
m_aPath = aPureUri.copy( nEnd + 1 );
- // Empty path segments or encoded slashes?
- if ( m_aPath.indexOf(
- rtl::OUString::createFromAscii( "//" ) ) != -1
- || m_aPath.indexOf(
- rtl::OUString::createFromAscii( "%2F" ) ) != -1
- || m_aPath.indexOf(
- rtl::OUString::createFromAscii( "%2f" ) ) != -1 )
+ // Unexpected sequences of characters:
+ // - empty path segments
+ // - encoded slashes
+ // - parent folder segments ".."
+ // - current folder segments "."
+ if ( m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "//" ) ) ) != -1
+ || m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%2F" ) ) ) != -1
+ || m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%2f" ) ) ) != -1
+ || ::comphelper::OStorageHelper::PathHasSegment( m_aPath, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) )
+ || ::comphelper::OStorageHelper::PathHasSegment( m_aPath, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) )
{
// error, but remember that we did a init().
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
return;
}
@@ -239,7 +243,7 @@ void PackageUri::init() const
else
{
// error, but remember that we did a init().
- m_aPath = rtl::OUString::createFromAscii( "/" );
+ m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) );
}
}
}
diff --git a/ucb/source/ucp/package/ucppkg1.component b/ucb/source/ucp/package/ucppkg1.component
new file mode 100644
index 0000000000..a2e2418b56
--- /dev/null
+++ b/ucb/source/ucp/package/ucppkg1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.PackageContentProvider">
+ <service name="com.sun.star.ucb.PackageContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/tdoc/makefile.mk b/ucb/source/ucp/tdoc/makefile.mk
index 83e9599eed..82c76b34b2 100644
--- a/ucb/source/ucp/tdoc/makefile.mk
+++ b/ucb/source/ucp/tdoc/makefile.mk
@@ -92,3 +92,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucptdoc1.component
+
+$(MISC)/ucptdoc1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucptdoc1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucptdoc1.component
diff --git a/ucb/source/ucp/tdoc/tdoc_services.cxx b/ucb/source/ucp/tdoc/tdoc_services.cxx
index 26b1d8a2de..cc60b72394 100644
--- a/ucb/source/ucp/tdoc/tdoc_services.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_services.cxx
@@ -39,45 +39,6 @@ using namespace com::sun::star;
using namespace tdoc_ucp;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- uno::Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
@@ -85,29 +46,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // Transient Documents Content Provider.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- ContentProvider::getImplementationName_Static(),
- ContentProvider::getSupportedServiceNames_Static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // Transient Documents Document Content Factory.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- DocumentContentFactory::getImplementationName_Static(),
- DocumentContentFactory::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/ucb/source/ucp/tdoc/ucptdoc1.component b/ucb/source/ucp/tdoc/ucptdoc1.component
new file mode 100644
index 0000000000..8ba1471bd9
--- /dev/null
+++ b/ucb/source/ucp/tdoc/ucptdoc1.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.TransientDocumentsContentProvider">
+ <service name="com.sun.star.ucb.TransientDocumentsContentProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ucb.TransientDocumentsDocumentContentFactory">
+ <service name="com.sun.star.frame.TransientDocumentsDocumentContentFactory"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk
index 73ee298697..162d582664 100644
--- a/ucb/source/ucp/webdav/makefile.mk
+++ b/ucb/source/ucp/webdav/makefile.mk
@@ -158,3 +158,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ----------------------------------------------------------
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucpdav1.component
+
+$(MISC)/ucpdav1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpdav1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpdav1.component
diff --git a/ucb/source/ucp/webdav/ucpdav1.component b/ucb/source/ucp/webdav/ucpdav1.component
new file mode 100644
index 0000000000..4e18b566e1
--- /dev/null
+++ b/ucb/source/ucp/webdav/ucpdav1.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.WebDAVContentProvider">
+ <service name="com.sun.star.ucb.WebDAVContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/webdav/webdavservices.cxx b/ucb/source/ucp/webdav/webdavservices.cxx
index 288772231a..af09f8734e 100644
--- a/ucb/source/ucp/webdav/webdavservices.cxx
+++ b/ucb/source/ucp/webdav/webdavservices.cxx
@@ -35,45 +35,6 @@
using namespace com::sun::star;
//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- uno::Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
@@ -81,21 +42,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // WebDAV Content Provider.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- ::webdav_ucp::ContentProvider::getImplementationName_Static(),
- ::webdav_ucp::ContentProvider::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
diff --git a/uui/prj/d.lst b/uui/prj/d.lst
index 30c6f812fd..46b0118319 100644
--- a/uui/prj/d.lst
+++ b/uui/prj/d.lst
@@ -7,3 +7,4 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid
..\%__SRC%\lib\iuui.lib %_DEST%\lib%_EXT%\iuui.lib
..\util\uui.xml %_DEST%\xml%_EXT%\uui.xml
+..\%__SRC%\misc\uui.component %_DEST%\xml%_EXT%\uui.component
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index 57c9ead3ad..8aea8c6b89 100755..100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -52,7 +52,6 @@
#include "logindlg.hxx"
#include "masterpasscrtdlg.hxx"
#include "masterpassworddlg.hxx"
-#include "passcrtdlg.hxx"
#include "passworddlg.hxx"
#include "iahndl.hxx"
@@ -270,7 +269,7 @@ handleAuthenticationRequest_(
aInfo.SetCanRememberPassword(
ePreferredRememberMode != eAlternateRememberMode);
aInfo.SetIsRememberPassword(
- eDefaultRememberMode != ucb::RememberAuthentication_NO);
+ ePreferredRememberMode == eDefaultRememberMode);
aInfo.SetIsRememberPersistent(
ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT);
@@ -520,7 +519,8 @@ executePasswordDialog(
task::PasswordRequestMode nMode,
::rtl::OUString aDocName,
bool bMSCryptoMode,
- bool bIsPasswordToModify )
+ bool bIsPasswordToModify,
+ bool bIsSimplePasswordRequest )
SAL_THROW((uno::RuntimeException))
{
try
@@ -531,21 +531,36 @@ executePasswordDialog(
ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
if( nMode == task::PasswordRequestMode_PASSWORD_CREATE )
{
- const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length
+ if (bIsSimplePasswordRequest)
+ {
+ std::auto_ptr< PasswordDialog > pDialog(
+ new PasswordDialog( pParent, nMode, xManager.get(), aDocName,
+ bIsPasswordToModify, bIsSimplePasswordRequest ) );
+ pDialog->SetMinLen(0);
+
+ rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
+ rInfo.SetPassword( pDialog->GetPassword() );
+ }
+ else
+ {
+ const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length
- VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create();
- AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen, bIsPasswordToModify );
- std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp );
+ VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create();
+ AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen, bIsPasswordToModify );
+ std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp );
- rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
- rInfo.SetPassword( pDialog->GetPasswordToOpen() );
- rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() );
- rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() );
+ rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
+ rInfo.SetPassword( pDialog->GetPasswordToOpen() );
+ rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() );
+ rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() );
+ }
}
- else
+ else // enter password or reenter password
{
std::auto_ptr< PasswordDialog > pDialog(
- new PasswordDialog( pParent, nMode, xManager.get(), aDocName, bIsPasswordToModify ) );
+ new PasswordDialog( pParent, nMode, xManager.get(), aDocName,
+ bIsPasswordToModify, bIsSimplePasswordRequest ) );
+ pDialog->SetMinLen(0);
rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
rInfo.SetPassword( bIsPasswordToModify ? String() : pDialog->GetPassword() );
@@ -568,7 +583,8 @@ handlePasswordRequest_(
rContinuations,
::rtl::OUString aDocumentName,
bool bMSCryptoMode,
- bool bIsPasswordToModify )
+ bool bIsPasswordToModify,
+ bool bIsSimplePasswordRequest = false )
SAL_THROW((uno::RuntimeException))
{
uno::Reference< task::XInteractionRetry > xRetry;
@@ -583,7 +599,7 @@ handlePasswordRequest_(
LoginErrorInfo aInfo;
executePasswordDialog( pParent, aInfo, nMode,
- aDocumentName, bMSCryptoMode, bIsPasswordToModify );
+ aDocumentName, bMSCryptoMode, bIsPasswordToModify, bIsSimplePasswordRequest );
switch (aInfo.GetResult())
{
@@ -743,7 +759,8 @@ UUIInteractionHelper::handlePasswordRequest(
rRequest->getContinuations(),
rtl::OUString(),
false /* bool bMSCryptoMode */,
- false /* bool bIsPasswordToModify */);
+ false /* bool bIsPasswordToModify */,
+ true /* bool bIsSimplePasswordRequest */ );
return true;
}
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index e90a064993..7cfcc3688b 100644..100755
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -89,6 +89,7 @@
#include "newerverwarn.hxx"
#include "iahndl.hxx"
+#include "nameclashdlg.hxx"
/** === begin UNO using === **/
using ::com::sun::star::uno::Sequence;
@@ -867,8 +868,6 @@ UUIInteractionHelper::handleRequest_impl(
if ( handleCertificateValidationRequest( rRequest ) )
return true;
-// @@@ Todo #i29340#: activate!
-#if 0
ucb::NameClashResolveRequest aNameClashResolveRequest;
if (aAnyRequest >>= aNameClashResolveRequest)
{
@@ -876,7 +875,7 @@ UUIInteractionHelper::handleRequest_impl(
rRequest->getContinuations());
return true;
}
-#endif
+
if ( handleMasterPasswordRequest( rRequest ) )
return true;
@@ -1188,40 +1187,26 @@ executeMessageBox(
return aResult;
}
-// @@@ Todo #i29340#: activate!
-#if 0
-enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE };
-
-NameClashResolveDialogResult
-executeNameClashResolveDialog(
- Window * /*pParent*/,
- rtl::OUString const & /*rTargetFolderURL*/,
- rtl::OUString const & /*rClashingName*/,
- rtl::OUString & /*rProposedNewName*/)
+NameClashResolveDialogResult executeSimpleNameClashResolveDialog( Window *pParent,
+ rtl::OUString const & rTargetFolderURL,
+ rtl::OUString const & rClashingName,
+ rtl::OUString & rProposedNewName,
+ bool bAllowOverwrite )
{
- // @@@ Todo DV: execute overwrite-rename dialog, deliver result
- OSL_ENSURE( false,
- "executeNameClashResolveDialog not yet implemented!" );
- return ABORT;
-}
+ std::auto_ptr< ResMgr > xManager( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
+ if ( !xManager.get() )
+ return ABORT;
-NameClashResolveDialogResult
-executeSimpleNameClashResolveDialog(
- Window * /*pParent*/,
- rtl::OUString const & /*rTargetFolderURL*/,
- rtl::OUString const & /*rClashingName*/,
- rtl::OUString & /*rProposedNewName*/)
-{
- // @@@ Todo DV: execute rename-only dialog, deliver result
- OSL_ENSURE( false,
- "executeSimpleNameClashResolveDialog not yet implemented!" );
- return ABORT;
+ NameClashDialog aDialog( pParent, xManager.get(), rTargetFolderURL,
+ rClashingName, rProposedNewName, bAllowOverwrite );
+
+ NameClashResolveDialogResult eResult = (NameClashResolveDialogResult) aDialog.Execute();
+ rProposedNewName = aDialog.getNewName();
+ return eResult;
}
-#endif
+
} // namespace
-// @@@ Todo #i29340#: activate!
-#if 0
void
UUIInteractionHelper::handleNameClashResolveRequest(
ucb::NameClashResolveRequest const & rRequest,
@@ -1251,18 +1236,12 @@ UUIInteractionHelper::handleNameClashResolveRequest(
NameClashResolveDialogResult eResult = ABORT;
rtl::OUString aProposedNewName( rRequest.ProposedNewName );
- if ( xReplaceExistingData.is() )
- eResult = executeNameClashResolveDialog(
- getParentProperty(),
- rRequest.TargetFolderURL,
- rRequest.ClashingName,
- aProposedNewName);
- else
- eResult = executeSimpleNameClashResolveDialog(
- getParentProperty(),
- rRequest.TargetFolderURL,
- rRequest.ClashingName,
- aProposedNewName);
+
+ eResult = executeSimpleNameClashResolveDialog( getParentProperty(),
+ rRequest.TargetFolderURL,
+ rRequest.ClashingName,
+ aProposedNewName,
+ xReplaceExistingData.is() );
switch ( eResult )
{
@@ -1282,14 +1261,8 @@ UUIInteractionHelper::handleNameClashResolveRequest(
"No ReplaceExistingData continuation available!" );
xReplaceExistingData->select();
break;
-
- default:
- OSL_ENSURE( false, "Unknown NameClashResolveDialogResult value. "
- "Interaction Request not handled!" );
- break;
}
}
-#endif
void
UUIInteractionHelper::handleGenericErrorRequest(
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 0f54e9ee8a..b77032e3cf 100755
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -215,8 +215,6 @@ private:
com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
-// @@@ Todo #i29340#: activate!
-#if 0
void
handleNameClashResolveRequest(
com::sun::star::ucb::NameClashResolveRequest const & rRequest,
@@ -225,7 +223,6 @@ private:
com::sun::star::task::XInteractionContinuation > > const &
rContinuations)
SAL_THROW((com::sun::star::uno::RuntimeException));
-#endif
bool
handleMasterPasswordRequest(
diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc
index 2641c5d329..58bc69ee4a 100755
--- a/uui/source/ids.hrc
+++ b/uui/source/ids.hrc
@@ -48,13 +48,15 @@
#define DLG_FILTER_SELECT (RID_UUI_START + 10)
// RID_UUI_START + 11 moved to ERRCODE_UUI_WRONGMEDIUM
#define DLG_UUI_MASTERPASSWORD (RID_UUI_START + 12)
+#define DLG_SIMPLE_NAME_CLASH (RID_UUI_START + 13)
#define STR_ERROR_PASSWORDS_NOT_IDENTICAL (RID_UUI_START + 13)
#define STR_ERROR_MASTERPASSWORD_WRONG (RID_UUI_START + 14)
// RID_UUI_START + 15, 16, 17 are misused by syncaccess/source/ui/resids.hrc
+
#define RID_UUI_ERRHDL (RID_UUI_START + 20)
#define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21)
#define DLG_UUI_PASSWORD (RID_UUI_START + 22)
-#define DLG_UUI_PASSWORD_CRT (RID_UUI_START + 23)
+#define STR_ERROR_SIMPLE_PASSWORD_WRONG (RID_UUI_START + 23)
#define STR_ERROR_PASSWORD_TO_OPEN_WRONG (RID_UUI_START + 24)
#define STR_ERROR_PASSWORD_TO_MODIFY_WRONG (RID_UUI_START + 25)
#define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26)
@@ -89,6 +91,11 @@
#define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 55)
#define STR_ENTER_PASSWORD_TO_OPEN (RID_UUI_START + 56)
#define STR_ENTER_PASSWORD_TO_MODIFY (RID_UUI_START + 57)
+#define STR_RENAME_OR_REPLACE (RID_UUI_START + 58)
+#define STR_NAME_CLASH_RENAME_ONLY (RID_UUI_START + 59)
+#define STR_SAME_NAME_USED (RID_UUI_START + 60)
+#define STR_ENTER_SIMPLE_PASSWORD (RID_UUI_START + 61)
+#define STR_CONFIRM_SIMPLE_PASSWORD (RID_UUI_START + 62)
#define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0)
#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1)
@@ -176,7 +183,6 @@
#define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START + 3)
#define HID_DLG_FILTER_SELECT (HID_UUI_START + 4)
#define HID_DLG_PASSWORD_UUI (HID_UUI_START + 5)
-#define HID_DLG_PASSWORD_CRT (HID_UUI_START + 6)
#define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START + 7)
#define HID_DLG_SSLWARN_UUI (HID_UUI_START + 8)
#define HID_XMLSECDLG_MACROWARN (HID_UUI_START + 9)
@@ -189,6 +195,7 @@
#define HID_LOGIN_DLG_ACCOUNT (HID_UUI_START +15)
#define HID_LOGIN_DLG_REMEMBER_PASSWORD (HID_UUI_START +16)
#define HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS (HID_UUI_START +17)
+#define HID_DLG_SIMPLE_NAME_CLASH (HID_UUI_START +18)
// HID_UUI_END (aka HID_CHAOS_NEW_DATABASE) is reserved in
// sfx2/util/hidother.src
diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src
index d9a0e538c9..822547faf3 100755
--- a/uui/source/logindlg.src
+++ b/uui/source/logindlg.src
@@ -174,21 +174,21 @@ ModalDialog DLG_UUI_LOGIN
Pos = MAP_APPFONT( 0 , 216 ) ;
Size = MAP_APPFONT( 177 , 8 ) ;
};
-
- OKButton BTN_LOGIN_OK
+
+ HelpButton BTN_LOGIN_HELP
{
Pos = MAP_APPFONT( 6 , 227 ) ;
Size = MAP_APPFONT( 50 , 14 ) ;
- DefButton = TRUE ;
};
-
- CancelButton BTN_LOGIN_CANCEL
+
+ OKButton BTN_LOGIN_OK
{
Pos = MAP_APPFONT( 66 , 227 ) ;
Size = MAP_APPFONT( 50 , 14 ) ;
+ DefButton = TRUE ;
};
- HelpButton BTN_LOGIN_HELP
+ CancelButton BTN_LOGIN_CANCEL
{
Pos = MAP_APPFONT( 121 , 227 ) ;
Size = MAP_APPFONT( 50 , 14 ) ;
diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk
index 5c20e59304..e09f5c01e9 100644..100755
--- a/uui/source/makefile.mk
+++ b/uui/source/makefile.mk
@@ -48,7 +48,6 @@ SLOFILES = \
$(SLO)$/masterpasscrtdlg.obj \
$(SLO)$/openlocked.obj \
$(SLO)$/passworddlg.obj \
- $(SLO)$/passcrtdlg.obj \
$(SLO)$/fltdlg.obj \
$(SLO)$/interactionhandler.obj \
$(SLO)$/requeststringresolver.obj \
@@ -60,6 +59,7 @@ SLOFILES = \
$(SLO)$/lockfailed.obj \
$(SLO)$/trylater.obj \
$(SLO)$/newerverwarn.obj \
+ $(SLO)$/nameclashdlg.obj \
$(SLO)$/passwordcontainer.obj
SRS1NAME=$(TARGET)
@@ -71,7 +71,6 @@ SRC1FILES = \
masterpasscrtdlg.src \
openlocked.src \
passworddlg.src \
- passcrtdlg.src \
passworderrs.src \
fltdlg.src \
unknownauthdlg.src\
@@ -81,6 +80,7 @@ SRC1FILES = \
alreadyopen.src\
lockfailed.src\
trylater.src\
+ nameclashdlg.src\
newerverwarn.src
.INCLUDE: target.mk
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index b9e82b862f..b7e70233ce 100644..100755
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -93,7 +93,7 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog
aHelpBtn ( this, ResId( BTN_MASTERPASSCRT_HELP, *pResMgr ) ),
pResourceMgr ( pResMgr ),
- nMinLen ( 5 )
+ nMinLen ( 1 )
{
FreeResource();
diff --git a/uui/source/masterpasscrtdlg.src b/uui/source/masterpasscrtdlg.src
index 65e24205a5..7f933fd0c2 100644..100755
--- a/uui/source/masterpasscrtdlg.src
+++ b/uui/source/masterpasscrtdlg.src
@@ -86,7 +86,7 @@ ModalDialog DLG_UUI_MASTERPASSWORD_CRT
Pos = MAP_APPFONT ( COL_0 , ROW_6 ) ;
Size = MAP_APPFONT ( CTRL_WIDTH , 8*RSC_CD_FIXEDTEXT_HEIGHT ) ;
WordBreak = TRUE ;
- Text [ en-US ] = "Caution: Make sure you remember the Master Password you have set. If you forget your Master Password, you will be unable to access any of the information protected by it. Passwords are case-sensitive and at least five characters long.";
+ Text [ en-US ] = "Caution: If you forget the master password, you will be unable to access any of the information protected by it. Passwords are case-sensitive.";
};
FixedLine FL_CAUTIONTEXT
{
diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx
new file mode 100755
index 0000000000..3393dff289
--- /dev/null
+++ b/uui/source/nameclashdlg.cxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "vcl/msgbox.hxx"
+#include "osl/file.hxx"
+
+#include "ids.hrc"
+#include "nameclashdlg.hrc"
+#include "nameclashdlg.hxx"
+
+// NameClashDialog ---------------------------------------------------------
+
+IMPL_LINK( NameClashDialog, ButtonHdl_Impl, PushButton *, pBtn )
+{
+ long nRet = (long) ABORT;
+ if ( &maBtnRename == pBtn )
+ {
+ nRet = (long) RENAME;
+ rtl::OUString aNewName = maEDNewName.GetText();
+ if ( ( aNewName == maNewName ) || !aNewName.getLength() )
+ {
+ ErrorBox aError( NULL, WB_OK, maSameName );
+ aError.Execute();
+ return 1;
+ }
+ maNewName = aNewName;
+ }
+ else if ( &maBtnOverwrite == pBtn )
+ nRet = (long) OVERWRITE;
+
+ EndDialog( nRet );
+
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr,
+ rtl::OUString const & rTargetFolderURL,
+ rtl::OUString const & rClashingName,
+ rtl::OUString const & rProposedNewName,
+ bool bAllowOverwrite )
+ : ModalDialog( pParent, ResId( DLG_SIMPLE_NAME_CLASH, *pResMgr ) ),
+ maFTMessage ( this, ResId( FT_FILE_EXISTS_WARNING, *pResMgr ) ),
+ maEDNewName ( this, ResId( EDIT_NEW_NAME, *pResMgr ) ),
+ maBtnOverwrite ( this, ResId( BTN_OVERWRITE, *pResMgr ) ),
+ maBtnRename ( this, ResId( BTN_RENAME, *pResMgr ) ),
+ maBtnCancel ( this, ResId( BTN_CANCEL, *pResMgr ) ),
+ maBtnHelp ( this, ResId( BTN_HELP, *pResMgr ) ),
+ maNewName ( rClashingName )
+{
+ FreeResource();
+
+ Link aLink( LINK( this, NameClashDialog, ButtonHdl_Impl ) );
+ maBtnOverwrite.SetClickHdl( aLink );
+ maBtnRename.SetClickHdl( aLink );
+ maBtnCancel.SetClickHdl( aLink );
+
+ String aInfo;
+ if ( bAllowOverwrite )
+ {
+ aInfo = String( ResId( STR_RENAME_OR_REPLACE, *pResMgr ) );
+ }
+ else
+ {
+ aInfo = String( ResId( STR_NAME_CLASH_RENAME_ONLY, *pResMgr ) );
+ maBtnOverwrite.Hide();
+ }
+
+ rtl::OUString aPath;
+ if ( osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL( rTargetFolderURL, aPath ) )
+ aPath = rTargetFolderURL;
+
+ maSameName = String ( ResId( STR_SAME_NAME_USED, *pResMgr ) );
+
+ aInfo.SearchAndReplaceAscii( "%NAME", rClashingName );
+ aInfo.SearchAndReplaceAscii( "%FOLDER", aPath );
+ maFTMessage.SetText( aInfo );
+ if ( rProposedNewName.getLength() )
+ maEDNewName.SetText( rProposedNewName );
+ else
+ maEDNewName.SetText( rClashingName );
+}
+
diff --git a/uui/source/passcrtdlg.hrc b/uui/source/nameclashdlg.hrc
index 8e3740abf0..81d112f25d 100644..100755
--- a/uui/source/passcrtdlg.hrc
+++ b/uui/source/nameclashdlg.hrc
@@ -25,19 +25,17 @@
*
************************************************************************/
-#ifndef UUI_PASSCRTDLG_HRC
-#define UUI_PASSCRTDLG_HRC
+#ifndef UUI_NAMECLASHDLG_HRC
+#define UUI_NAMECLASHDLG_HRC
-// local identifiers
-#define BTN_PASSCRT_CANCEL 1
-#define ED_PASSWORD_CRT 2
-#define FT_PASSWORD_REPEAT 3
-#define FT_PASSWORD_WARNING 4
-#define ED_PASSWORD_REPEAT 5
-#define FL_FIXED_LINE_1 6
-#define BTN_PASSCRT_OK 7
-#define BTN_PASSCRT_HELP 8
-#define FT_PASSWORD_CRT 9
-#define FT_MSPASSWORD_WARNING 10
+//============================================================================
+
+#define FT_FILE_EXISTS_WARNING 20
+#define EDIT_NEW_NAME 21
+#define BTN_OVERWRITE 22
+#define BTN_RENAME 23
+#define BTN_CANCEL 24
+#define BTN_HELP 25
+
+#endif // UUI_NAMECLASHDLG_HRC
-#endif // UUI_PASSCRTDLG_HRC
diff --git a/uui/source/passcrtdlg.hxx b/uui/source/nameclashdlg.hxx
index 4e9d065ee1..346b1faafd 100644..100755
--- a/uui/source/passcrtdlg.hxx
+++ b/uui/source/nameclashdlg.hxx
@@ -25,39 +25,39 @@
*
************************************************************************/
-#ifndef UUI_PASSCRTDLG_HXX
-#define UUI_PASSCRTDLG_HXX
+#ifndef UUI_NAMECLASHDLG_HXX
+#define UUI_NAMECLASHDLG_HXX
-#include <com/sun/star/task/PasswordRequestMode.hpp>
-#include <svtools/stdctrl.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
+#include "vcl/button.hxx"
+#include "vcl/dialog.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/edit.hxx"
//============================================================================
-class PasswordCreateDialog : public ModalDialog
+
+enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE };
+
+class NameClashDialog : public ModalDialog
{
- FixedText aFTPasswordCrt;
- Edit aEDPasswordCrt;
- FixedText aFTPasswordRepeat;
- Edit aEDPasswordRepeat;
- FixedText aFTWarning;
- FixedLine aFixedLine1;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
- ResMgr* pResourceMgr;
- sal_uInt16 nMinLen;
-
- DECL_LINK( OKHdl_Impl, OKButton * );
- DECL_LINK( EditHdl_Impl, Edit * );
+ FixedText maFTMessage;
+ Edit maEDNewName;
+ PushButton maBtnOverwrite;
+ PushButton maBtnRename;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+ rtl::OUString maSameName;
+ rtl::OUString maNewName;
-public:
- PasswordCreateDialog( Window* pParent, ResMgr * pResMgr, bool bMSCryptoMode = false );
+ DECL_LINK( ButtonHdl_Impl, PushButton * );
- String GetPassword() const { return aEDPasswordCrt.GetText(); }
+public:
+ NameClashDialog( Window* pParent, ResMgr* pResMgr,
+ rtl::OUString const & rTargetFolderURL,
+ rtl::OUString const & rClashingName,
+ rtl::OUString const & rProposedNewName,
+ bool bAllowOverwrite );
+ rtl::OUString getNewName() const { return maNewName; }
};
-#endif // UUI_PASSCRTDLG_HXX
+#endif // UUI_COOKIEDG_HXX
+
diff --git a/uui/source/nameclashdlg.src b/uui/source/nameclashdlg.src
new file mode 100755
index 0000000000..fe6276e2a7
--- /dev/null
+++ b/uui/source/nameclashdlg.src
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#define __RSC
+
+#ifndef UUI_IDS_HRC
+#include "ids.hrc"
+#endif
+
+#ifndef UUI_NAMECLASHDLG_HRC
+#include "nameclashdlg.hrc"
+#endif
+
+#define DLG_WIDTH 250
+#define DLG_HEIGTH 75
+#define BORDER_OFFSET 6
+#define EDIT_HEIGTH 12
+#define BTN_WIDTH 50
+#define BTN_HEIGTH 14
+
+ModalDialog DLG_SIMPLE_NAME_CLASH
+{
+ HelpId = HID_DLG_SIMPLE_NAME_CLASH ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGTH ) ;
+ Moveable = TRUE ;
+ Text [ en-US ] = "File Exists" ;
+
+ FixedText FT_FILE_EXISTS_WARNING
+ {
+ Pos = MAP_APPFONT ( BORDER_OFFSET, BORDER_OFFSET ) ;
+ Size = MAP_APPFONT ( DLG_WIDTH - 2*BORDER_OFFSET, DLG_HEIGTH - EDIT_HEIGTH - BTN_HEIGTH - 4*BORDER_OFFSET ) ;
+ WordBreak = TRUE ;
+ };
+
+ Edit EDIT_NEW_NAME
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( BORDER_OFFSET, DLG_HEIGTH - EDIT_HEIGTH - BTN_HEIGTH - 2*BORDER_OFFSET ) ;
+ Size = MAP_APPFONT ( DLG_WIDTH - 2*BORDER_OFFSET , EDIT_HEIGTH ) ;
+ };
+
+ PushButton BTN_OVERWRITE
+ {
+ Pos = MAP_APPFONT ( DLG_WIDTH - 3*(BTN_WIDTH + BORDER_OFFSET) , DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ;
+ Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Replace" ;
+ };
+
+ PushButton BTN_RENAME
+ {
+ Pos = MAP_APPFONT ( DLG_WIDTH - 2*(BTN_WIDTH + BORDER_OFFSET) , DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ;
+ Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Rename" ;
+ DefButton = TRUE ;
+ };
+
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( DLG_WIDTH - BTN_WIDTH - BORDER_OFFSET, DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ;
+ Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ;
+ TabStop = TRUE ;
+ };
+
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( BORDER_OFFSET, DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ;
+ Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ;
+ TabStop = TRUE ;
+ };
+};
+
+String STR_RENAME_OR_REPLACE
+{
+ Text = "A file with the name \"%NAME\" already exists in the location \"%FOLDER\".\nChoose Replace to overwrite the existing file or provide a new name.";
+};
+
+String STR_NAME_CLASH_RENAME_ONLY
+{
+ Text = "A file with the name \"%NAME\" already exists in the location \"%FOLDER\".\nPlease enter a new name.";
+};
+
+String STR_SAME_NAME_USED
+{
+ Text = "Please provide a different file name!";
+};
diff --git a/uui/source/passcrtdlg.cxx b/uui/source/passcrtdlg.cxx
deleted file mode 100644
index 6dbaeedd93..0000000000
--- a/uui/source/passcrtdlg.cxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * 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.
- *
- ************************************************************************/
-
-#include <svtools/filedlg.hxx>
-#include <vcl/msgbox.hxx>
-
-#ifndef UUI_IDS_HRC
-#include <ids.hrc>
-#endif
-#ifndef UUI_PASSCRTDLG_HRC
-#include <passcrtdlg.hrc>
-#endif
-#include <passcrtdlg.hxx>
-
-// PasswordCreateDialog---------------------------------------------------
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PasswordCreateDialog, EditHdl_Impl, Edit *, EMPTYARG )
-{
- aOKBtn.Enable( aEDPasswordCrt.GetText().Len() >= nMinLen );
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( PasswordCreateDialog, OKHdl_Impl, OKButton *, EMPTYARG )
-{
- // compare both passwords and show message box if there are not equal!!
- if( aEDPasswordCrt.GetText() == aEDPasswordRepeat.GetText() )
- EndDialog( RET_OK );
- else
- {
- String aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
- ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
- aErrorBox.Execute();
- aEDPasswordCrt.SetText( String() );
- aEDPasswordRepeat.SetText( String() );
- aEDPasswordCrt.GrabFocus();
- }
- return 1;
-}
-
-// -----------------------------------------------------------------------
-
-PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr, bool bMSCryptoMode)
- :ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD_CRT, *pResMgr ) )
- ,aFTPasswordCrt ( this, ResId( FT_PASSWORD_CRT, *pResMgr ) )
- ,aEDPasswordCrt ( this, ResId( ED_PASSWORD_CRT, *pResMgr ) )
- ,aFTPasswordRepeat ( this, ResId( FT_PASSWORD_REPEAT, *pResMgr ) )
- ,aEDPasswordRepeat ( this, ResId( ED_PASSWORD_REPEAT, *pResMgr ) )
- ,aFTWarning ( this, ResId( bMSCryptoMode ? FT_MSPASSWORD_WARNING : FT_PASSWORD_WARNING, *pResMgr ) )
- ,aFixedLine1 ( this, ResId( FL_FIXED_LINE_1, *pResMgr ) )
- ,aOKBtn ( this, ResId( BTN_PASSCRT_OK, *pResMgr ) )
- ,aCancelBtn ( this, ResId( BTN_PASSCRT_CANCEL, *pResMgr ) )
- ,aHelpBtn ( this, ResId( BTN_PASSCRT_HELP, *pResMgr ) )
- ,pResourceMgr ( pResMgr )
- ,nMinLen(1) // if it should be changed for ODF, it must stay 1 for bMSCryptoMode
-{
- FreeResource();
-
- aOKBtn.SetClickHdl( LINK( this, PasswordCreateDialog, OKHdl_Impl ) );
- aEDPasswordCrt.SetModifyHdl( LINK( this, PasswordCreateDialog, EditHdl_Impl ) );
-
- aOKBtn.Enable( sal_False );
-
- if ( bMSCryptoMode )
- {
- aEDPasswordCrt.SetMaxTextLen( 15 );
- aEDPasswordRepeat.SetMaxTextLen( 15 );
- }
-
- long nLabelWidth = aFTWarning.GetSizePixel().Width();
- long nLabelHeight = aFTWarning.GetSizePixel().Height();
- long nTextWidth = aFTWarning.GetCtrlTextWidth( aFTWarning.GetText() );
- long nTextHeight = aFTWarning.GetTextHeight();
-
- Rectangle aLabelRect( aFTWarning.GetPosPixel(), aFTWarning.GetSizePixel() );
- Rectangle aRect = aFTWarning.GetTextRect( aLabelRect, aFTWarning.GetText() );
-
- long nNewLabelHeight = 0;
- for( nNewLabelHeight = ( nTextWidth / nLabelWidth + 1 ) * nTextHeight;
- nNewLabelHeight < aRect.GetHeight();
- nNewLabelHeight += nTextHeight ) {} ;
-
- long nDelta = nNewLabelHeight - nLabelHeight;
-
- Size aNewDlgSize = GetSizePixel();
- aNewDlgSize.Height() += nDelta;
- SetSizePixel( aNewDlgSize );
-
- Size aNewWarningSize = aFTWarning.GetSizePixel();
- aNewWarningSize.Height() = nNewLabelHeight;
- aFTWarning.SetPosSizePixel( aFTWarning.GetPosPixel(), aNewWarningSize );
-
- Window* pControls[] = { &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn };
- const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] );
- for ( int i = 0; i < nCCount; ++i )
- {
- Point aNewPos =(*pControls[i]).GetPosPixel();
- aNewPos.Y() += nDelta;
- pControls[i]->SetPosSizePixel( aNewPos, pControls[i]->GetSizePixel() );
- }
-}
diff --git a/uui/source/passcrtdlg.src b/uui/source/passcrtdlg.src
deleted file mode 100644
index b4ba3f2125..0000000000
--- a/uui/source/passcrtdlg.src
+++ /dev/null
@@ -1,108 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * 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.
- *
- ************************************************************************/
-
-#define __RSC
-
-#ifndef UUI_IDS_HRC
-#include <ids.hrc>
-#endif
-#ifndef UUI_PASSCRTDLG_HRC
-#include "passcrtdlg.hrc"
-#endif
-
-ModalDialog DLG_UUI_PASSWORD_CRT
-{
- HelpId = HID_DLG_PASSWORD_CRT ;
- Border = TRUE ;
- Moveable = TRUE ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT( 145, 129 );
- FixedText FT_PASSWORD_CRT
- {
- Pos = MAP_APPFONT( 3, 4 );
- Size = MAP_APPFONT( 139, 9 );
- Text [ en-US ] = "Enter password";
- };
- Edit ED_PASSWORD_CRT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( 3, 17 );
- Size = MAP_APPFONT( 139, 13 );
- PassWord = TRUE ;
- };
- Edit ED_PASSWORD_REPEAT
- {
- Border = TRUE ;
- Pos = MAP_APPFONT( 3, 47 );
- Size = MAP_APPFONT( 139, 13 );
- PassWord = TRUE ;
- };
- OKButton BTN_PASSCRT_OK
- {
- Pos = MAP_APPFONT( 27, 110 );
- Size = MAP_APPFONT( 37, 15 );
- DefButton = TRUE ;
- };
- CancelButton BTN_PASSCRT_CANCEL
- {
- Pos = MAP_APPFONT( 66, 110 );
- Size = MAP_APPFONT( 37, 15 );
- };
- HelpButton BTN_PASSCRT_HELP
- {
- Pos = MAP_APPFONT( 105, 110 );
- Size = MAP_APPFONT( 37, 15 );
- };
- FixedText FT_PASSWORD_REPEAT
- {
- Pos = MAP_APPFONT( 3, 34 );
- Size = MAP_APPFONT( 139, 9 );
- Text [ en-US ] = "Reenter password";
- };
- FixedText FT_PASSWORD_WARNING
- {
- Pos = MAP_APPFONT( 4, 64 );
- Size = MAP_APPFONT( 137, 40 );
- Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive.";
- WordBreak = TRUE;
- };
- FixedText FT_MSPASSWORD_WARNING
- {
- Pos = MAP_APPFONT( 4, 64 );
- Size = MAP_APPFONT( 137, 40 );
- Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive and at most fifteen characters long.";
- WordBreak = TRUE;
- };
- FixedLine FL_FIXED_LINE_1
- {
- Pos = MAP_APPFONT( 0, 104 );
- Size = MAP_APPFONT( 145, 6 );
- };
- Text [ en-US ] = "Enter Password";
-};
-
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index b66659ff6e..5c584a559f 100755
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -25,67 +25,119 @@
*
************************************************************************/
+#include "passworddlg.hxx"
+#include "passworddlg.hrc"
+#include "ids.hrc"
+
#include <svtools/filedlg.hxx>
#include <vcl/msgbox.hxx>
-#ifndef UUI_IDS_HRC
-#include <ids.hrc>
-#endif
-#ifndef UUI_PASSWORDDLG_HRC
-#include <passworddlg.hrc>
-#endif
-#include <passworddlg.hxx>
-// PasswordDialog---------------------------------------------------------
+using namespace ::com::sun::star;
+
// -----------------------------------------------------------------------
-IMPL_LINK( PasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG )
+static void lcl_Move( Window &rWin, long nOffset )
{
- EndDialog( RET_OK );
- return 1;
+ Point aTmp( rWin.GetPosPixel() );
+ aTmp.Y() += nOffset;
+ rWin.SetPosPixel( aTmp );
}
// -----------------------------------------------------------------------
PasswordDialog::PasswordDialog(
Window* _pParent,
- ::com::sun::star::task::PasswordRequestMode nDlgMode,
+ task::PasswordRequestMode nDlgMode,
ResMgr * pResMgr,
rtl::OUString& aDocURL,
- bool bOpenToModify )
+ bool bOpenToModify,
+ bool bIsSimplePasswordRequest )
:ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD, *pResMgr ) )
,aFTPassword( this, ResId( FT_PASSWORD, *pResMgr ))
,aEDPassword( this, ResId( ED_PASSWORD, *pResMgr ))
+ ,aFTConfirmPassword( this, ResId( FT_CONFIRM_PASSWORD, *pResMgr ))
+ ,aEDConfirmPassword( this, ResId( ED_CONFIRM_PASSWORD, *pResMgr ))
,aOKBtn ( this, ResId( BTN_PASSWORD_OK, *pResMgr ))
,aCancelBtn ( this, ResId( BTN_PASSWORD_CANCEL, *pResMgr ))
,aHelpBtn ( this, ResId( BTN_PASSWORD_HELP, *pResMgr ))
,aFixedLine1( this, ResId( FL_FIXED_LINE_1, *pResMgr ))
+ ,nMinLen(1)
+ ,aPasswdMismatch( ResId( STR_PASSWORD_MISMATCH, *pResMgr ))
,nDialogMode( nDlgMode )
,pResourceMgr ( pResMgr )
{
- if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
+ if( nDialogMode == task::PasswordRequestMode_PASSWORD_REENTER )
{
- USHORT nErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
+ const USHORT nOpenToModifyErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
+ const USHORT nErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG : nOpenToModifyErrStrId;
String aErrorMsg( ResId( nErrStrId, *pResourceMgr ));
- ErrorBox aErrorBox( _pParent, WB_OK, aErrorMsg );
+ ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
aErrorBox.Execute();
}
+ // default settings for enter password or reenter passwd...
+ String aTitle( ResId( STR_TITLE_ENTER_PASSWORD, *pResourceMgr ) );
+ aFTConfirmPassword.Hide();
+ aEDConfirmPassword.Hide();
+ aFTConfirmPassword.Enable( FALSE );
+ aEDConfirmPassword.Enable( FALSE );
+
+ // settings for create password
+ if (nDialogMode == task::PasswordRequestMode_PASSWORD_CREATE)
+ {
+ aTitle = String( ResId( STR_TITLE_CREATE_PASSWORD, *pResourceMgr ) );
+
+ aFTConfirmPassword.SetText( String( ResId( STR_CONFIRM_SIMPLE_PASSWORD, *pResourceMgr ) ) );
+
+ aFTConfirmPassword.Show();
+ aEDConfirmPassword.Show();
+ aFTConfirmPassword.Enable( TRUE );
+ aEDConfirmPassword.Enable( TRUE );
+ }
+ else
+ {
+ // shrink dialog by size of hidden controls and move rest up accordingly
+
+ long nDelta = aFixedLine1.GetPosPixel().Y() - aFTConfirmPassword.GetPosPixel().Y();
+
+ lcl_Move( aFixedLine1, -nDelta );
+ lcl_Move( aOKBtn, -nDelta );
+ lcl_Move( aCancelBtn, -nDelta );
+ lcl_Move( aHelpBtn, -nDelta );
+
+ Size aNewDlgSize = GetSizePixel();
+ aNewDlgSize.Height() -= nDelta;
+ SetSizePixel( aNewDlgSize );
+ }
+
+ SetText( aTitle );
+
USHORT nStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN;
aFTPassword.SetText( String( ResId( nStrId, *pResourceMgr ) ) );
+ aFTPassword.SetText( aFTPassword.GetText() + aDocURL );
+ if (bIsSimplePasswordRequest)
+ {
+ DBG_ASSERT( aDocURL.getLength() == 0, "A simple password request should not have a document URL! Use document password request instead." );
+ aFTPassword.SetText( String( ResId( STR_ENTER_SIMPLE_PASSWORD, *pResourceMgr ) ) );
+ }
FreeResource();
- aFTPassword.SetText( aFTPassword.GetText() + aDocURL );
-
aOKBtn.SetClickHdl( LINK( this, PasswordDialog, OKHdl_Impl ) );
- long nLabelWidth = aFTPassword.GetSizePixel().Width();
- long nLabelHeight = aFTPassword.GetSizePixel().Height();
- long nTextWidth = aFTPassword.GetCtrlTextWidth( aFTPassword.GetText() );
- long nTextHeight = aFTPassword.GetTextHeight();
+
+ //
+ // move controls down by extra height needed for aFTPassword
+ // (usually only needed if a URL was provided)
+ //
+
+ long nLabelWidth = aFTPassword.GetSizePixel().Width();
+ long nLabelHeight = aFTPassword.GetSizePixel().Height();
+ long nTextWidth = aFTPassword.GetCtrlTextWidth( aFTPassword.GetText() );
+ long nTextHeight = aFTPassword.GetTextHeight();
Rectangle aLabelRect( aFTPassword.GetPosPixel(), aFTPassword.GetSizePixel() );
Rectangle aRect = aFTPassword.GetTextRect( aLabelRect, aFTPassword.GetText() );
@@ -105,13 +157,31 @@ PasswordDialog::PasswordDialog(
aNewLabelSize.Height() = nNewLabelHeight;
aFTPassword.SetPosSizePixel( aFTPassword.GetPosPixel(), aNewLabelSize );
- Window* pControls[] = { &aEDPassword, &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn };
- const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] );
- for ( int i = 0; i < nCCount; ++i )
+ lcl_Move( aEDPassword, nDelta );
+ lcl_Move( aFTConfirmPassword, nDelta );
+ lcl_Move( aEDConfirmPassword, nDelta );
+ lcl_Move( aFixedLine1, nDelta );
+ lcl_Move( aOKBtn, nDelta );
+ lcl_Move( aCancelBtn, nDelta );
+ lcl_Move( aHelpBtn, nDelta );
+}
+
+
+IMPL_LINK( PasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG )
+{
+ bool bEDPasswdValid = aEDPassword.GetText().Len() >= nMinLen;
+ bool bPasswdMismatch = aEDConfirmPassword.GetText() != aEDPassword.GetText();
+ bool bValid = (!aEDConfirmPassword.IsVisible() && bEDPasswdValid) ||
+ (aEDConfirmPassword.IsVisible() && bEDPasswdValid && !bPasswdMismatch);
+
+ if (aEDConfirmPassword.IsVisible() && bPasswdMismatch)
{
- Point aNewPos =(*pControls[i]).GetPosPixel();
- aNewPos.Y() += nDelta;
- pControls[i]->SetPosSizePixel( aNewPos, pControls[i]->GetSizePixel() );
+ ErrorBox aErrorBox( this, WB_OK, aPasswdMismatch );
+ aErrorBox.Execute();
}
+ else if (bValid)
+ EndDialog( RET_OK );
+ return 1;
}
+
diff --git a/uui/source/passworddlg.hrc b/uui/source/passworddlg.hrc
index edda2504c1..24ec8aca9d 100644..100755
--- a/uui/source/passworddlg.hrc
+++ b/uui/source/passworddlg.hrc
@@ -29,12 +29,18 @@
#define PASSWORDDLG_HRC
// local identifiers
-#define BTN_PASSWORD_OK 1
-#define ED_PASSWORD 2
-#define FT_PASSWORD 3
-#define FL_FIXED_LINE_1 4
-#define BTN_PASSWORD_HELP 5
-#define BTN_PASSWORD_CANCEL 6
+#define BTN_PASSWORD_OK 1
+#define ED_PASSWORD 2
+#define FT_PASSWORD 3
+#define FT_CONFIRM_PASSWORD 4
+#define ED_CONFIRM_PASSWORD 5
+#define FL_FIXED_LINE_1 6
+#define BTN_PASSWORD_HELP 7
+#define BTN_PASSWORD_CANCEL 8
+
+#define STR_TITLE_CREATE_PASSWORD 9
+#define STR_TITLE_ENTER_PASSWORD 10
+#define STR_PASSWORD_MISMATCH 11
#endif // PASSWORDDLG_HRC
diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx
index e5a0a7885b..9e959a6aba 100755
--- a/uui/source/passworddlg.hxx
+++ b/uui/source/passworddlg.hxx
@@ -37,21 +37,28 @@
#include <vcl/fixed.hxx>
//============================================================================
+
class PasswordDialog : public ModalDialog
{
FixedText aFTPassword;
Edit aEDPassword;
+ FixedText aFTConfirmPassword;
+ Edit aEDConfirmPassword;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
FixedLine aFixedLine1;
+ USHORT nMinLen;
+ String aPasswdMismatch;
DECL_LINK( OKHdl_Impl, OKButton * );
public:
- PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL, bool bOpenToModify = false );
+ PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL,
+ bool bOpenToModify = false, bool bIsSimplePasswordRequest = false );
+ void SetMinLen( USHORT nMin ) { nMinLen = nMin; }
String GetPassword() const { return aEDPassword.GetText(); }
private:
@@ -60,3 +67,4 @@ private:
};
#endif // PASSWORDDLG_HXX
+
diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src
index 7a96c4aa5a..ba6c2ad9fd 100755
--- a/uui/source/passworddlg.src
+++ b/uui/source/passworddlg.src
@@ -41,48 +41,61 @@ ModalDialog DLG_UUI_PASSWORD
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT( 145, 91 );
- Text [ en-US ] = "Enter password";
+ Size = MAP_APPFONT( 165, 95 );
FixedText FT_PASSWORD
{
- Pos = MAP_APPFONT( 3, 4 );
- Size = MAP_APPFONT( 139, 28 );
+ Pos = MAP_APPFONT( 3, 6 );
+ Size = MAP_APPFONT( 159, 8 );
WordBreak = TRUE;
};
Edit ED_PASSWORD
{
- Pos = MAP_APPFONT( 3, 51 );
- Size = MAP_APPFONT( 139, 13 );
+ Pos = MAP_APPFONT( 3, 17 );
+ Size = MAP_APPFONT( 159, 12 );
Border = TRUE ;
PassWord = TRUE ;
};
- FixedLine FL_FIXED_LINE_1
+ FixedText FT_CONFIRM_PASSWORD
{
- Pos = MAP_APPFONT( 0, 66 );
- Size = MAP_APPFONT( 145, 6 );
+ Pos = MAP_APPFONT( 3, 34 );
+ Size = MAP_APPFONT( 159, 8 );
+ WordBreak = TRUE;
};
- OKButton BTN_PASSWORD_OK
+ Edit ED_CONFIRM_PASSWORD
{
- Pos = MAP_APPFONT( 27, 72 );
- Size = MAP_APPFONT( 37, 15 );
- DefButton = TRUE ;
- DefButton = TRUE;
+ Pos = MAP_APPFONT( 3, 45 );
+ Size = MAP_APPFONT( 159, 12 );
+ Border = TRUE ;
+ PassWord = TRUE ;
};
- CancelButton BTN_PASSWORD_CANCEL
+ FixedLine FL_FIXED_LINE_1
{
- Pos = MAP_APPFONT( 66, 72 );
- Size = MAP_APPFONT( 37, 15 );
+ Pos = MAP_APPFONT( 0, 63 );
+ Size = MAP_APPFONT( 165, 8 );
};
HelpButton BTN_PASSWORD_HELP
{
- Pos = MAP_APPFONT( 105, 72 );
- Size = MAP_APPFONT( 37, 15 );
+ Pos = MAP_APPFONT( 3, 76 );
+ Size = MAP_APPFONT( 50, 14 );
+ };
+
+ OKButton BTN_PASSWORD_OK
+ {
+ Pos = MAP_APPFONT( 59, 76 );
+ Size = MAP_APPFONT( 50, 14 );
+ DefButton = TRUE ;
+ };
+
+ CancelButton BTN_PASSWORD_CANCEL
+ {
+ Pos = MAP_APPFONT( 112, 76 );
+ Size = MAP_APPFONT( 50, 14 );
};
String STR_ENTER_PASSWORD_TO_OPEN
@@ -94,5 +107,30 @@ ModalDialog DLG_UUI_PASSWORD
{
Text [ en-US ] = "Enter password to modify file: \n";
};
+
+ String STR_ENTER_SIMPLE_PASSWORD
+ {
+ Text [ en-US ] = "Enter password: ";
+ };
+
+ String STR_CONFIRM_SIMPLE_PASSWORD
+ {
+ Text [ en-US ] = "Confirm password: ";
+ };
+
+ String STR_TITLE_CREATE_PASSWORD
+ {
+ Text [ en-US ] = "Set Password";
+ };
+
+ String STR_TITLE_ENTER_PASSWORD
+ {
+ Text [ en-US ] = "Enter Password";
+ };
+
+ String STR_PASSWORD_MISMATCH
+ {
+ Text [ en-US ] = "The confirmation password did not match the password. Set the password again by entering the same password in both boxes." ;
+ };
};
diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src
index 6476e28319..249aa1f559 100755
--- a/uui/source/passworderrs.src
+++ b/uui/source/passworderrs.src
@@ -43,7 +43,12 @@ String STR_ERROR_PASSWORD_TO_MODIFY_WRONG
String STR_ERROR_MASTERPASSWORD_WRONG
{
- Text [ en-US ] = "The wrong Master Password has been entered. %PRODUCTNAME could not access web login information protected by Master Password.\n\nNote: Passwords are case-sensitive and at least five characters long.";
+ Text [ en-US ] = "The master password is incorrect.";
+};
+
+String STR_ERROR_SIMPLE_PASSWORD_WRONG
+{
+ Text [ en-US ] = "The password is incorrect.";
};
String STR_ERROR_PASSWORDS_NOT_IDENTICAL
diff --git a/uui/source/services.cxx b/uui/source/services.cxx
index 7ec7c34056..30af064df6 100644
--- a/uui/source/services.cxx
+++ b/uui/source/services.cxx
@@ -41,49 +41,6 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::registry;
-namespace {
-
-sal_Bool writeInfo( void * pRegistryKey,
- const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
-{
- OUString aKeyName( OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< XRegistryKey > xKey;
- try
- {
- xKey = static_cast< XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- {
- return sal_False;
- }
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-} // namespace
-
//============================================================================
//
// component_getImplementationEnvironment
@@ -99,43 +56,6 @@ component_getImplementationEnvironment(sal_Char const ** pEnvTypeName,
//============================================================================
//
-// component_writeInfo
-//
-//============================================================================
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *, void * pRegistryKey)
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // UUI Interaction Handler.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- OUString::createFromAscii(
- UUIInteractionHandler::m_aImplementationName ),
- UUIInteractionHandler::getSupportedServiceNames_static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // UUI Interaction Request String Resolver.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- OUString::createFromAscii(
- UUIInteractionRequestStringResolver::m_aImplementationName ),
- UUIInteractionRequestStringResolver::getSupportedServiceNames_static() ) &&
-
- //////////////////////////////////////////////////////////////////////
- // UUI Password Container Interaction Handler.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- uui::PasswordContainerInteractionHandler::getImplementationName_Static(),
- uui::PasswordContainerInteractionHandler::getSupportedServiceNames_Static() );
-}
-
-//============================================================================
-//
// component_getFactory
//
//============================================================================
diff --git a/uui/util/makefile.mk b/uui/util/makefile.mk
index 163a7bb550..8a77e71b5e 100644
--- a/uui/util/makefile.mk
+++ b/uui/util/makefile.mk
@@ -62,3 +62,11 @@ RESLIB1SRSFILES = \
$(SRS)$/source.srs
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/uui.component
+
+$(MISC)/uui.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ uui.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt uui.component
diff --git a/uui/util/uui.component b/uui/util/uui.component
new file mode 100644
index 0000000000..0a15ad6eb8
--- /dev/null
+++ b/uui/util/uui.component
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation
+ name="com.sun.star.comp.uui.PasswordContainerInteractionHandler">
+ <service name="com.sun.star.task.PasswordContainerInteractionHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.uui.UUIInteractionHandler">
+ <service name="com.sun.star.configuration.backend.InteractionHandler"/>
+ <service name="com.sun.star.task.InteractionHandler"/>
+ <service name="com.sun.star.uui.InteractionHandler"/>
+ </implementation>
+ <implementation
+ name="com.sun.star.comp.uui.UUIInteractionRequestStringResolver">
+ <service name="com.sun.star.task.InteractionRequestStringResolver"/>
+ </implementation>
+</component>
diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
index afbd896b2b..4ba494f83b 100644
--- a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx
@@ -53,18 +53,21 @@ public:
virtual void SAL_CALL setScreenUpdating(sal_Bool bUpdate) throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL getDisplayStatusBar() throw (css::uno::RuntimeException);
virtual void SAL_CALL setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (css::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL getInteractive() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setInteractive( ::sal_Bool bInteractive ) throw (::com::sun::star::uno::RuntimeException);
- virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getInteractive() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setInteractive( ::sal_Bool bInteractive ) throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool bVisible ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL getVBProjects() throw (css::uno::RuntimeException);
+
virtual void SAL_CALL Run( const ::rtl::OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL OnTime( const ::com::sun::star::uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const ::com::sun::star::uno::Any& aLatestTime, const ::com::sun::star::uno::Any& aSchedule ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL OnTime( const css::uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const css::uno::Any& aLatestTime, const css::uno::Any& aSchedule ) throw (css::uno::RuntimeException);
virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL Undo( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL Quit( ) throw (::com::sun::star::uno::RuntimeException);
- virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException);
- virtual css::uno::Any SAL_CALL SAL_CALL getVBProjects() throw (css::uno::RuntimeException);
-
+ virtual void SAL_CALL Undo() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL Quit() throw (css::uno::RuntimeException);
+
// XHelperInterface
virtual rtl::OUString& getServiceImplName();
virtual css::uno::Sequence<rtl::OUString> getServiceNames();
diff --git a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
index 20b220c1f5..27ffa25eeb 100644
--- a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
+++ b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx
@@ -133,11 +133,12 @@ protected:
class VBAHELPER_DLLPUBLIC EnumerationHelperImpl : public EnumerationHelper_BASE
{
protected:
+ css::uno::WeakReference< ov::XHelperInterface > m_xParent;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::container::XEnumeration > m_xEnumeration;
public:
- EnumerationHelperImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xContext( xContext ), m_xEnumeration( xEnumeration ) { }
+ EnumerationHelperImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) { }
virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException) { return m_xEnumeration->hasMoreElements(); }
};
diff --git a/vbahelper/inc/vbahelper/vbadocumentbase.hxx b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
index 29335304db..b68eb06815 100644
--- a/vbahelper/inc/vbahelper/vbadocumentbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadocumentbase.hxx
@@ -52,9 +52,7 @@ public:
virtual ::rtl::OUString SAL_CALL getFullName() throw (css::uno::RuntimeException);
virtual sal_Bool SAL_CALL getSaved() throw (css::uno::RuntimeException);
virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException);
-
- virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException); // Michhael E. Bohn
-
+ virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException);
// Methods
virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges,
diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
new file mode 100755
index 0000000000..b0dd184c1a
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef VBAHELPER_VBAEVENTSHELPERBASE_HXX
+#define VBAHELPER_VBAEVENTSHELPERBASE_HXX
+
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <map>
+#include <deque>
+#include "vbahelper/vbahelper.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace uno { class XComponentContext; }
+} } }
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper2< css::script::vba::XVBAEventProcessor, css::lang::XEventListener > VbaEventsHelperBase_BASE;
+
+class VBAHELPER_DLLPUBLIC VbaEventsHelperBase : public VbaEventsHelperBase_BASE
+{
+public:
+ VbaEventsHelperBase(
+ const css::uno::Sequence< css::uno::Any >& rArgs,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~VbaEventsHelperBase();
+
+ // XVBAEventProcessor
+ virtual sal_Bool SAL_CALL hasVbaEventHandler( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ virtual void SAL_CALL processVbaEvent( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::script::provider::ScriptFrameworkErrorException, css::util::VetoException, css::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& aSource ) throw (css::uno::RuntimeException);
+
+protected:
+ // ------------------------------------------------------------------------
+
+ enum EventHandlerType { EVENTHANDLER_GLOBAL, EVENTHANDLER_DOCUMENT };
+ struct EventHandlerInfo
+ {
+ sal_Int32 mnEventId;
+ ::rtl::OUString maMacroName;
+ EventHandlerType meType;
+ sal_Int32 mnCancelIndex;
+ css::uno::Any maUserData;
+ };
+
+ /** Registers a supported event handler.
+
+ @param nEventId Event identifier from com.sun.star.script.vba.EventIdentifier.
+ @param pcMacroName Name of the associated VBA event handler macro.
+ @param eType Document event or global event.
+ @param nCancelIndex 0-based index of Cancel parameter, or -1.
+ @param rUserData User data for free usage in derived implementations. */
+ void registerEventHandler(
+ sal_Int32 nEventId,
+ const sal_Char* pcMacroName,
+ EventHandlerType eType = EVENTHANDLER_DOCUMENT,
+ sal_Int32 nCancelIndex = -1,
+ const css::uno::Any& rUserData = css::uno::Any() );
+
+ /** Throws, if the passed sequence does not contain a value at the specified index. */
+ static inline void checkArgument( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException)
+ { if( rArgs.getLength() <= nIndex ) throw css::lang::IllegalArgumentException(); }
+
+ /** Throws, if the passed sequence does not contain a value of a specific at the specified index. */
+ template< typename Type >
+ static inline void checkArgumentType( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException)
+ { if( (rArgs.getLength() <= nIndex) || !rArgs[ nIndex ].has< Type >() ) throw css::lang::IllegalArgumentException(); }
+
+ // ------------------------------------------------------------------------
+
+ struct EventQueueEntry
+ {
+ sal_Int32 mnEventId;
+ css::uno::Sequence< css::uno::Any > maArgs;
+ inline /*implicit*/ EventQueueEntry( sal_Int32 nEventId ) : mnEventId( nEventId ) {}
+ inline EventQueueEntry( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) : mnEventId( nEventId ), maArgs( rArgs ) {}
+ };
+ typedef ::std::deque< EventQueueEntry > EventQueue;
+
+ /** Derived classes return whether event processing is enabled. Throws if
+ the instance is in an invalid state. */
+ virtual bool implEventsEnabled() throw (css::uno::RuntimeException) = 0;
+
+ /** Derived classes do additional prpeparations and return whether the
+ event handler has to be called. */
+ virtual bool implPrepareEvent(
+ EventQueue& rEventQueue,
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::uno::RuntimeException) = 0;
+
+ /** Derived classes have to return the argument list for the specified VBA event handler. */
+ virtual css::uno::Sequence< css::uno::Any > implBuildArgumentList(
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException) = 0;
+
+ /** Derived classes may do additional postprocessing. Called even if the
+ event handler does not exist, or if an error occured during execution. */
+ virtual void implPostProcessEvent(
+ EventQueue& rEventQueue,
+ const EventHandlerInfo& rInfo,
+ bool bSuccess,
+ bool bCancel ) throw (css::uno::RuntimeException) = 0;
+
+ /** Derived classes have to return the name of the Basic document module. */
+ virtual ::rtl::OUString implGetDocumentModuleName(
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException) = 0;
+
+private:
+ /** Returns the event handler info struct for the specified event, or throws. */
+ const EventHandlerInfo& getEventHandlerInfo( sal_Int32 nEventId ) const throw (css::lang::IllegalArgumentException);
+
+ /** Searches the event handler in the document and returns its full script path. */
+ ::rtl::OUString getEventHandlerPath(
+ const EventHandlerInfo& rInfo,
+ const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException);
+
+ /** Removes this instance from all broadcasters. */
+ void stopListening();
+
+protected:
+ css::uno::Reference< css::frame::XModel > mxModel;
+ SfxObjectShell* mpShell;
+
+private:
+ typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerMap;
+
+ EventHandlerMap maEvents;
+ bool mbDisposed;
+};
+
+// ============================================================================
+
+#endif
diff --git a/vbahelper/inc/vbahelper/vbaglobalbase.hxx b/vbahelper/inc/vbahelper/vbaglobalbase.hxx
index d2d0399c11..1394a7c749 100644
--- a/vbahelper/inc/vbahelper/vbaglobalbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaglobalbase.hxx
@@ -32,16 +32,16 @@
typedef InheritedHelperInterfaceImpl1< ov::XGlobalsBase > Globals_BASE;
class VBAHELPER_DLLPUBLIC VbaGlobalsBase : public Globals_BASE
-
{
protected:
-
+ rtl::OUString msDocCtxName;
+
bool hasServiceName( const rtl::OUString& serviceName );
void init( const css::uno::Sequence< css::beans::PropertyValue >& aInitArgs );
public:
VbaGlobalsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName );
- virtual ~VbaGlobalsBase(){};
+ virtual ~VbaGlobalsBase();
// XMultiServiceFactory
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (css::uno::Exception, css::uno::RuntimeException);
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) throw (css::uno::Exception, css::uno::RuntimeException);
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx
index 024b0d3aa8..77c5338442 100644
--- a/vbahelper/inc/vbahelper/vbahelper.hxx
+++ b/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -63,6 +63,7 @@ namespace ooo
throw css::lang::IllegalArgumentException();
return aSomething;
}
+ VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > getUnoDocModule( const String& aModName, SfxObjectShell* pShell );
VBAHELPER_DLLPUBLIC SfxObjectShell* getSfxObjShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException);
@@ -89,6 +90,13 @@ namespace ooo
VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection );
VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* );
+ /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value.
+ Returns false, if the Any is empty or contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC bool extractBoolFromAny( bool& rbValue, const css::uno::Any& rAny );
+ /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value.
+ Throws, if the Any is empty or contains an incompatible type. */
+ VBAHELPER_DLLPUBLIC bool extractBoolFromAny( const css::uno::Any& rAny ) throw (css::uno::RuntimeException);
+
VBAHELPER_DLLPUBLIC rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
VBAHELPER_DLLPUBLIC rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
VBAHELPER_DLLPUBLIC double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical);
diff --git a/vbahelper/inc/vbahelper/vbahelperinterface.hxx b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
index 45fb518572..315d28d093 100644
--- a/vbahelper/inc/vbahelper/vbahelperinterface.hxx
+++ b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
@@ -28,6 +28,8 @@
#define OOVBAAPI_VBA_HELPERINTERFACE_HXX
#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
#include <ooo/vba/XHelperInterface.hpp>
#include <vbahelper/vbahelper.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -68,6 +70,7 @@ protected:
css::uno::Reference< css::uno::XComponentContext > mxContext;
public:
InheritedHelperInterfaceImpl() {}
+ InheritedHelperInterfaceImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxContext( xContext ) {}
InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {}
virtual rtl::OUString& getServiceImplName() = 0;
virtual css::uno::Sequence<rtl::OUString> getServiceNames() = 0;
@@ -86,7 +89,6 @@ public:
return xNameAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Application" ) ) );
}
-
// XServiceInfo Methods
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) { return getServiceImplName(); }
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException)
@@ -101,19 +103,39 @@ public:
}
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException)
{
- css::uno::Sequence< rtl::OUString > aNames = getServiceNames();;
+ css::uno::Sequence< rtl::OUString > aNames = getServiceNames();
return aNames;
}
};
template< typename Ifc1 >
class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > >
+{
+ typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base;
+public:
+ InheritedHelperInterfaceImpl1< Ifc1 >() {}
+ InheritedHelperInterfaceImpl1< Ifc1 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {}
+ InheritedHelperInterfaceImpl1< Ifc1 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+};
+template< typename Ifc1, typename Ifc2 >
+class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl2 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper2< Ifc1, Ifc2 > >
{
-typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base;
+ typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper2< Ifc1, Ifc2 > > Base;
public:
- InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+ InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >() {}
+ InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {}
+ InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
+};
+template< typename Ifc1, typename Ifc2, typename Ifc3 >
+class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl3 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 > >
+{
+ typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 > > Base;
+public:
+ InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >() {}
+ InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {}
+ InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}
};
// ============================================================================
diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst
index d683e97c8b..a5457b7304 100644
--- a/vbahelper/prj/d.lst
+++ b/vbahelper/prj/d.lst
@@ -26,3 +26,5 @@ mkdir: %_DEST%\inc%_EXT%\basic
..\inc\vbahelper\vbatextframe.hxx %_DEST%\inc%_EXT%\vbahelper\vbatextframe.hxx
..\inc\vbahelper\vbashaperange.hxx %_DEST%\inc%_EXT%\vbahelper\vbashaperange.hxx
..\inc\vbahelper\vbapagesetupbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbapagesetupbase.hxx
+..\%__SRC%\misc\msforms.component %_DEST%\xml%_EXT%\msforms.component
+..\inc\vbahelper\vbaeventshelperbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaeventshelperbase.hxx
diff --git a/vbahelper/source/msforms/service.cxx b/vbahelper/source/msforms/service.cxx
index 22d99f24ea..01e6014a37 100644
--- a/vbahelper/source/msforms/service.cxx
+++ b/vbahelper/source/msforms/service.cxx
@@ -57,16 +57,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey )
- {
- OSL_TRACE("In component_writeInfo");
-
- // Component registration
- return component_writeInfoHelper( pServiceManager, pRegistryKey,
- controlprovider::serviceDecl, userform::serviceDecl );
- }
-
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx
index a273bb1952..78c8b25885 100644
--- a/vbahelper/source/msforms/vbacontrols.cxx
+++ b/vbahelper/source/msforms/vbacontrols.cxx
@@ -74,12 +74,20 @@ private:
public:
ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog )
{
- mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
- uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls();
-
- msNames.realloc( sXControls.getLength() );
- for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i )
- SetArrayElementTo( sXControls[ i ], i );
+ try
+ {
+ mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
+ uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls();
+
+ msNames.realloc( sXControls.getLength() );
+ for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i )
+ SetArrayElementTo( sXControls[ i ], i );
+ }
+ catch( uno::Exception& )
+ {
+ // accept the case when the dialog already does not exist
+ // in this case the wrapper should work in dummy mode
+ }
}
static rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl )
@@ -186,7 +194,7 @@ ScVbaControls::ScVbaControls( const uno::Reference< XHelperInterface >& xParent,
const css::uno::Reference< awt::XControl >& xDialog )
: ControlsImpl_BASE( xParent, xContext, lcl_controlsWrapper( xDialog ) )
{
- mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
+ mxDialog.set( xDialog, uno::UNO_QUERY );
}
uno::Reference< container::XEnumeration >
@@ -349,13 +357,16 @@ void SAL_CALL ScVbaControls::Remove( const uno::Any& StringKeyOrIndex )
}
catch( uno::RuntimeException& )
{
- throw;
+ // the exceptions are not rethrown, impossibility to find or remove the control is currently not reported
+ // since in most cases it means just that the controls is already not there, the VBA seems to do it in the same way
+
+ // throw;
}
catch( uno::Exception& e )
{
- throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ),
- uno::Reference< uno::XInterface >(),
- uno::makeAny( e ) );
+ // throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ),
+ // uno::Reference< uno::XInterface >(),
+ // uno::makeAny( e ) );
}
}
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 2c04ea6759..33e357b00c 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -153,28 +153,41 @@ void SAL_CALL
ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
{
uno::Any aObject = getValue( aPropertyName );
- // The Object *must* support XDefaultProperty here because getValue will
- // only return properties that are Objects ( e.g. controls )
- // e.g. Userform1.aControl = something
- // 'aControl' has to support XDefaultProperty to make sense here
- uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
- rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
- uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
- uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
- xPropSet->setPropertyValue( aDfltPropName, aValue );
+
+ // in case the dialog is already closed the VBA implementation should not throw exceptions
+ if ( aObject.hasValue() )
+ {
+ // The Object *must* support XDefaultProperty here because getValue will
+ // only return properties that are Objects ( e.g. controls )
+ // e.g. Userform1.aControl = something
+ // 'aControl' has to support XDefaultProperty to make sense here
+ uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
+ rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
+ uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
+ uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
+ xPropSet->setPropertyValue( aDfltPropName, aValue );
+ }
}
uno::Any SAL_CALL
ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
- uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
- uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
- ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
- uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
- ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
- pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
- return uno::makeAny( xVBAControl );
+ uno::Any aResult;
+
+ // in case the dialog is already closed the VBA implementation should not throw exceptions
+ if ( m_xDialog.is() )
+ {
+ uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
+ ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
+ uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
+ ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
+ pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
+ aResult = uno::makeAny( xVBAControl );
+ }
+
+ return aResult;
}
::sal_Bool SAL_CALL
@@ -185,7 +198,9 @@ ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::Runtime
uno::Any SAL_CALL
ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException)
{
- uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
+ // if the dialog already closed we should do nothing, but the VBA will call methods of the Controls objects
+ // thus we have to provide a dummy object in this case
+ uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY );
uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, xDialogControl ) );
if ( index.hasValue() )
return uno::makeAny( xControls->Item( index, uno::Any() ) );
diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk
index 47ad44b3d0..22ed40a3ad 100644
--- a/vbahelper/source/vbahelper/makefile.mk
+++ b/vbahelper/source/vbahelper/makefile.mk
@@ -65,6 +65,8 @@ SLOFILES=\
$(SLO)$/vbashaperange.obj \
$(SLO)$/vbatextframe.obj \
$(SLO)$/vbapagesetupbase.obj \
+ $(SLO)$/vbaeventshelperbase.obj
+
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 13aa451a31..57e303893e 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -24,39 +24,37 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#include "vbahelper/vbaapplicationbase.hxx"
+
#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp> //Michael E. Bohn
-#include <com/sun/star/lang/XMultiComponentFactory.hpp> //Michael E. Bohn
-#include <com/sun/star/lang/XComponent.hpp> //Michael E. Bohn
-#include <com/sun/star/container/XEnumeration.hpp> //Michael E. Bohn
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/document/XEmbeddedScripts.hpp> //Michael E. Bohn
-#include <ooo/vba/XVBAAppService.hpp> //Michael E. Bohn
+#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
-
-#include "vbacommandbars.hxx"
+#include <hash_map>
#include <filter/msfilter/msvbahelper.hxx>
#include <tools/datetime.hxx>
-// start basic includes
#include <basic/sbx.hxx>
#include <basic/sbstar.hxx>
#include <basic/sbuno.hxx>
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
-// end basic includes
-#include <hash_map>
+#include "vbacommandbars.hxx"
-using namespace com::sun::star;
-using namespace ooo::vba;
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
#define OFFICEVERSION "11.0"
@@ -162,6 +160,9 @@ typedef ::std::hash_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash, ::std::equal
struct VbaApplicationBase_Impl
{
VbaTimerHashMap m_aTimerHash;
+ sal_Bool mbVisible;
+
+ inline VbaApplicationBase_Impl() : mbVisible( sal_True ) {}
virtual ~VbaApplicationBase_Impl()
{
@@ -185,7 +186,6 @@ VbaApplicationBase::VbaApplicationBase( const uno::Reference< uno::XComponentCon
VbaApplicationBase::~VbaApplicationBase()
{
- m_pImpl = 0;
delete m_pImpl;
}
@@ -268,6 +268,16 @@ void SAL_CALL VbaApplicationBase::setInteractive( ::sal_Bool bInteractive )
xWindow->setEnable( bInteractive );
}
+sal_Bool SAL_CALL VbaApplicationBase::getVisible() throw (uno::RuntimeException)
+{
+ return m_pImpl->mbVisible; // dummy implementation
+}
+
+void SAL_CALL VbaApplicationBase::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
+{
+ m_pImpl->mbVisible = bVisible; // dummy implementation
+}
+
uno::Any SAL_CALL
VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException)
{
@@ -407,63 +417,50 @@ float SAL_CALL VbaApplicationBase::CentimetersToPoints( float _Centimeters ) thr
return ( _Centimeters * rate );
}
-// inserted by Michael E. Bohn
uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException)
{
- uno::Any aAny;
- uno::Reference< ::lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager();
- try
- {
- uno::Reference < ::uno::XInterface > xInterface = xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAAppService" )),mxContext);
- uno::Reference < ::ooo::vba::XVBAAppService > xVBAAppService (xInterface, ::uno::UNO_QUERY_THROW );
- if (xVBAAppService.is()){
- uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
- return xVBAAppService->getVBE( this, mxContext, xModel);
- }
-
- }catch(uno::Exception* e)
- {
- }
- return aAny;
+ try // return empty object on error
+ {
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this );
+ aArgs[ 1 ] <<= getCurrentDocument();
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
+ uno::Reference< uno::XInterface > xVBE = xServiceManager->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBE" ) ), aArgs, mxContext );
+ return uno::Any( xVBE );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ return uno::Any();
}
uno::Any SAL_CALL
VbaApplicationBase::getVBProjects() throw (uno::RuntimeException)
{
- uno::Any aAny;
- uno::Reference< ::lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager();
- try
- {
- uno::Reference < ::uno::XInterface > xInterface = xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAAppService" )),mxContext);
- uno::Reference < ::ooo::vba::XVBAAppService > xVBAAppService (xInterface, ::uno::UNO_QUERY_THROW );
- if (xVBAAppService.is()){
- uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XEmbeddedScripts > xEnbeddedScripts ( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< script::XStorageBasedLibraryContainer > xMacroStorageBasedLibraryContainer = xEnbeddedScripts->getBasicLibraries();
- uno::Reference< script::XStorageBasedLibraryContainer > xDialogStorageBasedLibraryContainer = xEnbeddedScripts->getDialogLibraries();
- uno::Reference< script::XLibraryContainer > xMacroLibraryContainer ( xMacroStorageBasedLibraryContainer, uno::UNO_QUERY_THROW );
- uno::Reference< script::XLibraryContainer > xDialogLibraryContainer( xDialogStorageBasedLibraryContainer, uno::UNO_QUERY_THROW );
- return xVBAAppService->getVBProjects(this, mxContext, xModel, xMacroLibraryContainer, xDialogLibraryContainer);
- }
-
- }catch(uno::Exception* e)
- {
- }
- return aAny;
-
-
-
+ try // return empty object on error
+ {
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this );
+ aArgs[ 1 ] <<= getCurrentDocument();
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
+ uno::Reference< uno::XInterface > xVBProjects = xServiceManager->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBProjects" ) ), aArgs, mxContext );
+ return uno::Any( xVBProjects );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ return uno::Any();
}
-
-
-
-rtl::OUString&
+rtl::OUString&
VbaApplicationBase::getServiceImplName()
{
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaApplicationBase") );
return sImplName;
}
+
uno::Sequence<rtl::OUString>
VbaApplicationBase::getServiceNames()
{
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index 2f21943d63..0eba699a07 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -24,9 +24,9 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#include <vbahelper/vbadocumentbase.hxx>
-#include <vbahelper/helperdecl.hxx>
-#include <comphelper/unwrapargs.hxx>
+
+#include "vbahelper/vbadocumentbase.hxx"
+#include "vbahelper/helperdecl.hxx"
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/util/XProtectable.hpp>
@@ -35,8 +35,8 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp> //Michael E. Bohn
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <ooo/vba/XVBADocService.hpp>
+#include <comphelper/unwrapargs.hxx>
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
@@ -206,41 +206,26 @@ VbaDocumentBase::Activate() throw (uno::RuntimeException)
xFrame->activate();
}
-// ---- Michael E.Bohn Start-----
-
uno::Any SAL_CALL
VbaDocumentBase::getVBProject() throw (uno::RuntimeException)
-
{
- uno::Any aAny;
- uno::Reference< ::lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager();
- try
- {
- uno::Reference < ::uno::XInterface > xInterface = xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBADocService" )),mxContext);
- uno::Reference < ::ooo::vba::XVBADocService > xVBADocService (xInterface, ::uno::UNO_QUERY_THROW );
- if (xVBADocService.is()){
- uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XEmbeddedScripts > xEnbeddedScripts ( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< script::XStorageBasedLibraryContainer > xMacroStorageBasedLibraryContainer = xEnbeddedScripts->getBasicLibraries();
- uno::Reference< script::XStorageBasedLibraryContainer > xDialogStorageBasedLibraryContainer = xEnbeddedScripts->getDialogLibraries();
- uno::Reference< script::XLibraryContainer > xMacroLibraryContainer ( xMacroStorageBasedLibraryContainer, uno::UNO_QUERY_THROW );
- uno::Reference< script::XLibraryContainer > xDialogLibraryContainer( xDialogStorageBasedLibraryContainer, uno::UNO_QUERY_THROW );
-
- return xVBADocService->getVBProject( this, mxContext, xModel, xMacroLibraryContainer, xDialogLibraryContainer );
- }
-
- }catch(uno::Exception* e)
- {
- }
- return aAny;
-
+ try // return empty object on error
+ {
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this );
+ aArgs[ 1 ] <<= mxModel;
+ uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW );
+ uno::Reference< uno::XInterface > xVBProjects = xServiceManager->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBProject" ) ), aArgs, mxContext );
+ return uno::Any( xVBProjects );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ return uno::Any();
}
-
-// ---- Michael E.Bohn End -----
-
-
-rtl::OUString&
+rtl::OUString&
VbaDocumentBase::getServiceImplName()
{
static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaDocumentBase") );
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
new file mode 100755
index 0000000000..ee6eccbdd6
--- /dev/null
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "vbahelper/vbaeventshelperbase.hxx"
+#include <filter/msfilter/msvbahelper.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::ooo::vba;
+
+// ============================================================================
+
+VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs, const uno::Reference< uno::XComponentContext >& /*xContext*/ ) :
+ mpShell( 0 ),
+ mbDisposed( false )
+{
+ try
+ {
+ mxModel = getXSomethingFromArgs< frame::XModel >( rArgs, 0, false );
+ mpShell = getSfxObjShell( mxModel );
+
+ // add dispose listener
+ uno::Reference< lang::XComponent > xComponent( mxModel, uno::UNO_QUERY_THROW );
+ xComponent->addEventListener( this );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+VbaEventsHelperBase::~VbaEventsHelperBase()
+{
+ stopListening();
+}
+
+sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs )
+ throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ // getEventHandlerInfo() throws, if unknown event dentifier has been passed
+ const EventHandlerInfo& rInfo = getEventHandlerInfo( nEventId );
+ // getEventHandlerPath() searches for the macro in the document
+ return getEventHandlerPath( rInfo, rArgs ).getLength() > 0;
+}
+
+void SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs )
+ throw (lang::IllegalArgumentException, script::provider::ScriptFrameworkErrorException, util::VetoException, uno::RuntimeException)
+{
+ /* Derived classes may add new event identifiers to be processed while
+ processing the original event. All unprocessed events are collected in
+ a queue. First element in the queue is the next event to be processed. */
+ EventQueue aEventQueue;
+ aEventQueue.push_back( EventQueueEntry( nEventId, rArgs ) );
+
+ /* bEnabled will track if event processing is enabled. Every event handler
+ may disable handling of other events. */
+ bool bEnabled = true;
+
+ /* bCancel will contain the current Cancel value. It is possible that
+ multiple events will try to modify the Cancel value. Every event
+ handler receives the Cancel value of the previous event handler. */
+ bool bCancel = false;
+
+ /* bSuccess will change to true if at least one event handler has been
+ executed successfully. */
+ bool bSuccess = false;
+
+ /* Loop as long as there are more events to be processed, and as event
+ handling is still enabled. Derived classes may add new events to be
+ processed in the virtual implPrepareEvent() function. */
+ while( bEnabled && !aEventQueue.empty() )
+ {
+ /* Check that all class members are available, and that we are not
+ disposed (this may have happened at any time during execution of
+ the last event handler). */
+ if( mbDisposed || !mxModel.is() || !mpShell )
+ throw uno::RuntimeException();
+
+ // get info for next event
+ const EventHandlerInfo& rInfo = getEventHandlerInfo( aEventQueue.front().mnEventId );
+ uno::Sequence< uno::Any > aEventArgs = aEventQueue.front().maArgs;
+ aEventQueue.pop_front();
+
+ // let derived classes decide whether event processing is still enabled
+ bEnabled = implEventsEnabled();
+ // let derived classes prepare the event, they may add new events for next iteration
+ if( bEnabled && implPrepareEvent( aEventQueue, rInfo, aEventArgs ) )
+ {
+ // search the event handler macro in the document
+ ::rtl::OUString aMacroPath = getEventHandlerPath( rInfo, aEventArgs );
+ bool bEventSuccess = false;
+ if( aMacroPath.getLength() > 0 )
+ {
+ // build the argument list
+ uno::Sequence< uno::Any > aVbaArgs = implBuildArgumentList( rInfo, aEventArgs );
+ // insert current cancel value
+ if( rInfo.mnCancelIndex >= 0 )
+ {
+ if( rInfo.mnCancelIndex >= aVbaArgs.getLength() )
+ throw lang::IllegalArgumentException();
+ aVbaArgs[ rInfo.mnCancelIndex ] <<= bCancel;
+ }
+ // execute the event handler
+ uno::Any aRet, aCaller;
+ bEventSuccess = executeMacro( mpShell, aMacroPath, aVbaArgs, aRet, aCaller );
+ // extract new cancel value
+ if( rInfo.mnCancelIndex >= 0 )
+ {
+ if( rInfo.mnCancelIndex >= aVbaArgs.getLength() )
+ throw lang::IllegalArgumentException();
+ // cancel value may be boolean or any integer type, Any(bool) does not extract to sal_Int32
+ bool bNewCancel = false;
+ sal_Int32 nNewCancel = 0;
+ if( aVbaArgs[ rInfo.mnCancelIndex ] >>= bNewCancel )
+ bCancel = bNewCancel;
+ else if( aVbaArgs[ rInfo.mnCancelIndex ] >>= nNewCancel )
+ bCancel = nNewCancel != 0;
+ }
+ }
+ // post processing (also, if event handler does not exist, or on error
+ implPostProcessEvent( aEventQueue, rInfo, bEventSuccess, bCancel );
+ // global success, if at least one event handler succeeded
+ bSuccess |= bEventSuccess;
+ }
+ }
+
+ // if event handlers want to cancel the event, do so regardless of any errors
+ if( bCancel )
+ throw util::VetoException();
+
+ // if no event handler finished successfully, throw
+ if( !bSuccess )
+ throw script::provider::ScriptFrameworkErrorException();
+}
+
+void SAL_CALL VbaEventsHelperBase::disposing( const lang::EventObject& /*aSource*/ ) throw (uno::RuntimeException)
+{
+ OSL_TRACE( "VbaEventsHelperBase::disposing" );
+ stopListening();
+ mbDisposed = true;
+}
+
+// protected ------------------------------------------------------------------
+
+void VbaEventsHelperBase::registerEventHandler( sal_Int32 nEventId,
+ const sal_Char* pcMacroName, EventHandlerType eType, sal_Int32 nCancelIndex, const uno::Any& rUserData )
+{
+ EventHandlerInfo& rInfo = maEvents[ nEventId ];
+ rInfo.mnEventId = nEventId;
+ rInfo.maMacroName = ::rtl::OUString::createFromAscii( pcMacroName );
+ rInfo.meType = eType;
+ rInfo.mnCancelIndex = nCancelIndex;
+ rInfo.maUserData = rUserData;
+}
+
+// private --------------------------------------------------------------------
+
+const VbaEventsHelperBase::EventHandlerInfo& VbaEventsHelperBase::getEventHandlerInfo(
+ sal_Int32 nEventId ) const throw (lang::IllegalArgumentException)
+{
+ EventHandlerMap::const_iterator aIt = maEvents.find( nEventId );
+ if( aIt == maEvents.end() )
+ throw lang::IllegalArgumentException();
+ return aIt->second;
+}
+
+::rtl::OUString VbaEventsHelperBase::getEventHandlerPath( const EventHandlerInfo& rInfo,
+ const uno::Sequence< uno::Any >& rArgs ) const throw (lang::IllegalArgumentException)
+{
+ ::rtl::OUString aMacroName;
+ switch( rInfo.meType )
+ {
+ case EVENTHANDLER_GLOBAL:
+ aMacroName = rInfo.maMacroName;
+ break;
+ case EVENTHANDLER_DOCUMENT:
+ aMacroName = ::rtl::OUStringBuffer( implGetDocumentModuleName( rInfo, rArgs ) ).
+ append( sal_Unicode( '.' ) ).append( rInfo.maMacroName ).makeStringAndClear();
+ break;
+ }
+ return resolveVBAMacro( mpShell, aMacroName ).ResolvedMacro();
+}
+
+void VbaEventsHelperBase::stopListening()
+{
+ if( !mbDisposed ) try
+ {
+ uno::Reference< lang::XComponent > xComponent( mxModel, uno::UNO_QUERY_THROW );
+ xComponent->removeEventListener( this );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+// ============================================================================
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index adb0738a13..0388d145f2 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -35,22 +35,50 @@ using namespace ooo::vba;
rtl::OUString sApplication( RTL_CONSTASCII_USTRINGPARAM("Application") );
+// special key to return the Application
+rtl::OUString sAppService( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.Application") );
+
VbaGlobalsBase::VbaGlobalsBase(
const uno::Reference< ov::XHelperInterface >& xParent,
-const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName )
-: Globals_BASE( xParent, xContext )
+const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName )
+: Globals_BASE( xParent, xContext ), msDocCtxName( sDocCtxName )
{
// overwrite context with custom one ( that contains the application )
+ // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least thats what the code appears like it wants to do )
+ uno::Any aSrvMgr;
+ if ( xContext.is() && xContext->getServiceManager().is() )
+ {
+ aSrvMgr = uno::makeAny( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.stoc.OServiceManagerWrapper") ), xContext ) );
+ }
+
::cppu::ContextEntry_Init aHandlerContextInfo[] =
{
::cppu::ContextEntry_Init( sApplication, uno::Any() ),
::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ),
+ ::cppu::ContextEntry_Init( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.lang.theServiceManager" ) ), aSrvMgr )
};
-
- mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), xContext );
-
+ // don't pass a delegate, this seems to introduce yet another cyclic dependency ( and
+ // some strange behavior
+ mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), NULL );
}
+VbaGlobalsBase::~VbaGlobalsBase()
+{
+ try
+ {
+ uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY );
+ if ( xNameContainer.is() )
+ {
+ // release document reference ( we don't wan't the component context trying to dispose that )
+ xNameContainer->removeByName( msDocCtxName );
+ // release application reference, as it is holding onto the context
+ xNameContainer->removeByName( sApplication );
+ }
+ }
+ catch ( const uno::Exception& )
+ {
+ }
+}
void
VbaGlobalsBase::init( const uno::Sequence< beans::PropertyValue >& aInitArgs )
@@ -74,19 +102,30 @@ uno::Reference< uno::XInterface > SAL_CALL
VbaGlobalsBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (uno::Exception, uno::RuntimeException)
{
uno::Reference< uno::XInterface > xReturn;
-
- if ( hasServiceName( aServiceSpecifier ) )
+ if ( aServiceSpecifier.equals( sAppService ) )
+ {
+ // try to extract the Application from the context
+ uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY );
+ xNameContainer->getByName( sApplication ) >>= xReturn;
+ }
+ else if ( hasServiceName( aServiceSpecifier ) )
xReturn = mxContext->getServiceManager()->createInstanceWithContext( aServiceSpecifier, mxContext );
return xReturn;
}
uno::Reference< uno::XInterface > SAL_CALL
-VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException)
+VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException)
{
uno::Reference< uno::XInterface > xReturn;
- if ( hasServiceName( ServiceSpecifier ) )
- xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( ServiceSpecifier, Arguments, mxContext );
+ if ( aServiceSpecifier.equals( sAppService ) )
+ {
+ // try to extract the Application from the context
+ uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY );
+ xNameContainer->getByName( sApplication ) >>= xReturn;
+ }
+ else if ( hasServiceName( aServiceSpecifier ) )
+ xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceSpecifier, Arguments, mxContext );
return xReturn;
}
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 8654e6cb6a..cf1981fa8f 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -625,6 +625,30 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
dispatchExecute( pViewShell, SID_VIEWSHELL1 );
}
+bool extractBoolFromAny( bool& rbValue, const uno::Any& rAny )
+{
+ if( rAny >>= rbValue ) return true;
+
+ sal_Int64 nSigned = 0;
+ if( rAny >>= nSigned ) { rbValue = nSigned != 0; return true; }
+
+ sal_uInt64 nUnsigned = 0;
+ if( rAny >>= nUnsigned ) { rbValue = nUnsigned > 0; return true; }
+
+ double fDouble = 0.0;
+ if( rAny >>= fDouble ) { rbValue = fDouble != 0.0; return true; }
+
+ return false;
+}
+
+bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException)
+{
+ bool bValue = false;
+ if( extractBoolFromAny( bValue, rAny ) )
+ return bValue;
+ throw uno::RuntimeException();
+}
+
rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
{
uno::Type aType = pvargItem.getValueType();
@@ -1403,7 +1427,27 @@ void UserFormGeometryHelper::setHeight( double nHeight )
double points = double( static_cast<double>(_hmm) / factor);
return points;
}
-
+
+ uno::Reference< uno::XInterface > getUnoDocModule( const String& aModName, SfxObjectShell* pShell )
+ {
+ uno::Reference< uno::XInterface > xIf;
+ if ( pShell )
+ {
+ rtl::OUString sProj( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+ BasicManager* pBasMgr = pShell->GetBasicManager();
+ if ( pBasMgr && pBasMgr->GetName().Len() )
+ sProj = pShell->GetBasicManager()->GetName();
+ StarBASIC* pBasic = pShell->GetBasicManager()->GetLib( sProj );
+ if ( pBasic )
+ {
+ SbModule* pMod = pBasic->FindModule( aModName );
+ if ( pMod )
+ xIf = pMod->GetUnoModule();
+ }
+ }
+ return xIf;
+ }
+
SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
SfxObjectShell* pFoundShell = NULL;
diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk
index dda4be0cbc..9469df4736 100644
--- a/vbahelper/util/makefile.mk
+++ b/vbahelper/util/makefile.mk
@@ -102,3 +102,11 @@ SHL2LIBS=$(SLB)$/$(TARGET_MSFORMS).lib
# --- Targets -----------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/msforms.component
+
+$(MISC)/msforms.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ msforms.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt msforms.component
diff --git a/vbahelper/util/msforms.component b/vbahelper/util/msforms.component
new file mode 100644
index 0000000000..98ce4a8451
--- /dev/null
+++ b/vbahelper/util/msforms.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="ControlProviderImpl">
+ <service name="ooo.vba.ControlProvider"/>
+ </implementation>
+ <implementation name="ScVbaUserForm">
+ <service name="ooo.vba.msforms.UserForm"/>
+ </implementation>
+</component>
diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst
index 1cfa107f73..740ff554ee 100644
--- a/xmlhelp/prj/d.lst
+++ b/xmlhelp/prj/d.lst
@@ -4,4 +4,9 @@
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.*
..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.*
..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml
+..\util\*.xsl %_DEST%\bin%_EXT%\*.*
..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib
+..\%__SRC%\bin\helpxsl.zip %_DEST%\pck%_EXT%\helpxsl.zip
+..\%__SRC%\misc\LuceneHelpWrapper.component %_DEST%\xml%_EXT%\LuceneHelpWrapper.component
+..\%__SRC%\misc\tvhlp1.component %_DEST%\xml%_EXT%\tvhlp1.component
+..\%__SRC%\misc\ucpchelp1.component %_DEST%\xml%_EXT%\ucpchelp1.component
diff --git a/xmlhelp/source/com/sun/star/help/HelpComponent.java b/xmlhelp/source/com/sun/star/help/HelpComponent.java
index 18cb3feaa0..e0b5f0faf8 100755
--- a/xmlhelp/source/com/sun/star/help/HelpComponent.java
+++ b/xmlhelp/source/com/sun/star/help/HelpComponent.java
@@ -68,10 +68,8 @@ import java.io.PrintStream;
import java.io.File;
*/
-/** This class capsulates the class, that implements the minimal component, a
- * factory for creating the service (<CODE>__getComponentFactory</CODE>) and a
- * method, that writes the information into the given registry key
- * (<CODE>__writeRegistryServiceInfo</CODE>).
+/** This class capsulates the class, that implements the minimal component and a
+ * factory for creating the service (<CODE>__getComponentFactory</CODE>).
*/
public class HelpComponent
{
@@ -98,25 +96,6 @@ public class HelpComponent
return xFactory;
}
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns true if the operation succeeded
- * @param regKey the registryKey
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
- {
- boolean bSuccessHelpSearch = Factory.writeRegistryServiceInfo
- (HelpSearch._HelpSearch.class.getName(),
- HelpSearch._HelpSearch.getServiceNames(), regKey);
- boolean bSuccessHelpIndexer = Factory.writeRegistryServiceInfo
- (HelpIndexer.class.getName(),
- HelpIndexer.getServiceNames(), regKey);
-
- return bSuccessHelpSearch && bSuccessHelpIndexer;
- }
/** This method is a member of the interface for initializing an object
* directly after its creation.
* @param object This array of arbitrary objects will be passed to the
diff --git a/xmlhelp/source/com/sun/star/help/HelpSearch.java b/xmlhelp/source/com/sun/star/help/HelpSearch.java
index 714bb75a52..d140d3093a 100644
--- a/xmlhelp/source/com/sun/star/help/HelpSearch.java
+++ b/xmlhelp/source/com/sun/star/help/HelpSearch.java
@@ -54,10 +54,8 @@ import org.apache.lucene.search.WildcardQuery;
import com.sun.star.script.XInvocation;
import com.sun.star.beans.XIntrospectionAccess;
-/** This class capsulates the class, that implements the minimal component, a
- * factory for creating the service (<CODE>__getComponentFactory</CODE>) and a
- * method, that writes the information into the given registry key
- * (<CODE>__writeRegistryServiceInfo</CODE>).
+/** This class capsulates the class, that implements the minimal component and a
+ * factory for creating the service (<CODE>__getComponentFactory</CODE>).
*/
public class HelpSearch
{
@@ -314,19 +312,6 @@ public class HelpSearch
return xFactory;
}
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns true if the operation succeeded
- * @param regKey the registryKey
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return Factory.writeRegistryServiceInfo(_HelpSearch.class.getName(),
- _HelpSearch.getServiceNames(),
- regKey);
- }
/** This method is a member of the interface for initializing an object
* directly after its creation.
* @param object This array of arbitrary objects will be passed to the
diff --git a/xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component b/xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component
new file mode 100644
index 0000000000..04b35bcb12
--- /dev/null
+++ b/xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.help.HelpIndexer">
+ <service name="com.sun.star.help.HelpIndexer"/>
+ </implementation>
+ <implementation name="com.sun.star.help.HelpSearch$_HelpSearch">
+ <service name="com.sun.star.help.HelpSearch"/>
+ </implementation>
+</component>
diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk
index ffa08b30cf..a67f755a1c 100644
--- a/xmlhelp/source/com/sun/star/help/makefile.mk
+++ b/xmlhelp/source/com/sun/star/help/makefile.mk
@@ -76,6 +76,14 @@ fix_system_lucene:
@echo "Fix Java Class-Path entry for Lucene libraries from system."
@$(SED) -r -e "s#^(Class-Path:).*#\1 file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)#" \
-i ../../../../../$(INPATH)/class/HelpLinker/META-INF/MANIFEST.MF
+
+ALLTAR : $(MISC)/LuceneHelpWrapper.component
+
+$(MISC)/LuceneHelpWrapper.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt LuceneHelpWrapper.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)$(JARTARGET)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt LuceneHelpWrapper.component
.ELSE
all:
@echo java disabled
diff --git a/xmlhelp/source/cxxhelp/provider/services.cxx b/xmlhelp/source/cxxhelp/provider/services.cxx
index 7cb7e1d706..834638807b 100644
--- a/xmlhelp/source/cxxhelp/provider/services.cxx
+++ b/xmlhelp/source/cxxhelp/provider/services.cxx
@@ -36,46 +36,6 @@
using namespace com::sun::star;
//=========================================================================
-static sal_Bool writeInfo(
- void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- uno::Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- uno::Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
{
@@ -83,21 +43,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * /*pServiceManager*/, void * pRegistryKey )
-{
- return pRegistryKey &&
-
- //////////////////////////////////////////////////////////////////////
- // Write info into registry.
- //////////////////////////////////////////////////////////////////////
-
- writeInfo( pRegistryKey,
- ::chelp::ContentProvider::getImplementationName_Static(),
- ::chelp::ContentProvider::getSupportedServiceNames_Static() );
-}
-
-//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName,
void * pServiceManager,
diff --git a/xmlhelp/source/treeview/makefile.mk b/xmlhelp/source/treeview/makefile.mk
index 0c385862d7..be0ed8e76f 100644
--- a/xmlhelp/source/treeview/makefile.mk
+++ b/xmlhelp/source/treeview/makefile.mk
@@ -67,3 +67,11 @@ DEF1DES=UCB : Treeview help
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/tvhlp1.component
+
+$(MISC)/tvhlp1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ tvhlp1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt tvhlp1.component
diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx
index 7e705cc3f6..10f508b745 100644
--- a/xmlhelp/source/treeview/tvfactory.cxx
+++ b/xmlhelp/source/treeview/tvfactory.cxx
@@ -255,49 +255,6 @@ TVFactory::CreateInstance(
return Reference< XInterface >::query( xP );
}
-
-
-//=========================================================================
-static sal_Bool writeInfo( void * pRegistryKey,
- const rtl::OUString & rImplementationName,
- Sequence< rtl::OUString > const & rServiceNames )
-{
- rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- aKeyName += rImplementationName;
- aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
-
- Reference< registry::XRegistryKey > xKey;
- try
- {
- xKey = static_cast< registry::XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- }
-
- if ( !xKey.is() )
- return sal_False;
-
- sal_Bool bSuccess = sal_True;
-
- for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
- {
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( registry::InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
- }
- return bSuccess;
-}
-
-
-
//=========================================================================
extern "C" void SAL_CALL component_getImplementationEnvironment(
const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
@@ -307,20 +264,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
-
-//=========================================================================
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- (void)pServiceManager;
-
- return pRegistryKey && writeInfo( pRegistryKey,
- TVFactory::getImplementationName_static(),
- TVFactory::getSupportedServiceNames_static() );
-}
-
-
//=========================================================================
extern "C" void * SAL_CALL component_getFactory(
const sal_Char * pImplName,void * pServiceManager,void * pRegistryKey )
diff --git a/xmlhelp/source/treeview/tvhlp1.component b/xmlhelp/source/treeview/tvhlp1.component
new file mode 100644
index 0000000000..525de73e00
--- /dev/null
+++ b/xmlhelp/source/treeview/tvhlp1.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.help.TreeViewImpl">
+ <service name="com.sun.star.help.TreeView"/>
+ <service name="com.sun.star.ucb.HiearchyDataSource"/>
+ </implementation>
+</component>
diff --git a/xmlhelp/util/delzip b/xmlhelp/util/delzip
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/xmlhelp/util/delzip
diff --git a/xmlhelp/util/embed.xsl b/xmlhelp/util/embed.xsl
new file mode 100644
index 0000000000..3a4e3ef80f
--- /dev/null
+++ b/xmlhelp/util/embed.xsl
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output indent="yes" method="xml"/>
+
+<!-- SPECIFY YOUR FILE SYSTEM ROOT PATH TO THE HELP FILES -->
+<xsl:param name="fsroot" select="'file:///handbuch/WORKBENCH/helpcontent2/source/'"/>
+
+<!--
+######################################################
+All others
+######################################################
+-->
+<xsl:template match="/">
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="*|@*|comment()|processing-instruction()|text()">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="*|@*|comment()|processing-instruction()|text()" mode="embedded">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()" mode="embedded"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="bookmark" mode="embedded" />
+<xsl:template match="ahelp" mode="embedded">
+ <xsl:apply-templates mode="embedded"/>
+</xsl:template>
+
+<xsl:template match="paragraph[@role='heading']">
+ <title>
+ <xsl:apply-templates/>
+ </title>
+</xsl:template>
+
+<xsl:template match="paragraph[@role=*]">
+ <paragraph>
+ <xsl:apply-templates/>
+ </paragraph>
+</xsl:template>
+
+<xsl:template match="sort">
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<!--
+######################################################
+EMBED
+######################################################
+-->
+<xsl:template match="embed">
+
+ <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
+ <xsl:if test="not($doc//section[@id=$anchor])"> <!-- fallback for embeds that actually should be embedvars -->
+ <paragraph role="paragraph"><xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/></paragraph>
+ </xsl:if>
+</xsl:template>
+
+<!--
+######################################################
+EMBEDVAR
+######################################################
+-->
+<xsl:template match="embedvar">
+ <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
+ <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </xsl:if>
+
+ <!-- FPE: embedvars, that point to "text/shared/00/00000004.xml#wie" will only be resolved in the main_transform -->
+
+</xsl:template>
+</xsl:stylesheet>
diff --git a/xmlhelp/util/idxcaption.xsl b/xmlhelp/util/idxcaption.xsl
new file mode 100644
index 0000000000..7570fa5c78
--- /dev/null
+++ b/xmlhelp/util/idxcaption.xsl
@@ -0,0 +1,34 @@
+<xsl:stylesheet version="1.0" encoding="UTF-8"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:office="http://openoffice.org/2000/office"
+ xmlns:style="http://openoffice.org/2000/style"
+ xmlns:table="http://openoffice.org/2000/table"
+ xmlns:draw="http://openoffice.org/2000/drawing"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:meta="http://openoffice.org/2000/meta"
+ xmlns:number="http://openoffice.org/2000/datastyle"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:chart="http://openoffice.org/2000/chart"
+ xmlns:help="http://openoffice.org/2000/help"
+ xmlns:index="http://sun.com/2000/XMLSearch"
+ xmlns:text="http://openoffice.org/2000/text">
+
+<xsl:param name="Language" select="'en-US'"/>
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:template match="/">
+ <xsl:apply-templates select="//title" mode="include"/>
+ <xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
+</xsl:template>
+
+<xsl:template match="*" mode="include">
+ <xsl:value-of select="."/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="*"/>
+
+</xsl:stylesheet>
+
diff --git a/xmlhelp/util/idxcontent.xsl b/xmlhelp/util/idxcontent.xsl
new file mode 100644
index 0000000000..aa371d7f92
--- /dev/null
+++ b/xmlhelp/util/idxcontent.xsl
@@ -0,0 +1,104 @@
+<xsl:stylesheet version="1.0" encoding="UTF-8"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:office="http://openoffice.org/2000/office"
+ xmlns:style="http://openoffice.org/2000/style"
+ xmlns:table="http://openoffice.org/2000/table"
+ xmlns:draw="http://openoffice.org/2000/drawing"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:meta="http://openoffice.org/2000/meta"
+ xmlns:number="http://openoffice.org/2000/datastyle"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:chart="http://openoffice.org/2000/chart"
+ xmlns:help="http://openoffice.org/2000/help"
+ xmlns:index="http://sun.com/2000/XMLSearch"
+ xmlns:text="http://openoffice.org/2000/text">
+
+<xsl:param name="Language" select="'en-US'"/>
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:template match="helpdocument|body">
+ <xsl:choose>
+ <xsl:when test="meta/topic[@indexer='exclude']"/>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="title">
+ <xsl:value-of select="."/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="table">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="tablecell">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="tablerow">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="list">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="listitem">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="item">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="emph">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="paragraph">
+ <xsl:value-of select="."/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="section">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="bookmark">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="bookmark_value">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="link">
+ <xsl:apply-templates/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="ahelp[@visibility='visible']">
+ <xsl:value-of select="."/>
+ <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="*"/>
+
+</xsl:stylesheet>
+
+
diff --git a/xmlhelp/util/main_transform.xsl b/xmlhelp/util/main_transform.xsl
new file mode 100644
index 0000000000..d9b6c32296
--- /dev/null
+++ b/xmlhelp/util/main_transform.xsl
@@ -0,0 +1,972 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!--***********************************************************************
+ This is the main transformation style sheet for transforming.
+ Only use with OOo 2.0
+ Owner: fpe@openoffice.org
+ =========================================================================
+ Changes Log
+ May 24 2004 Created
+ Aug 24 2004 Fixed for help2 CWS
+ Aug 27 2004 Added css link, fixed missing embed-mode for variable
+ Removed width/height for images
+ Sep 03 2004 Modularized xsl, added some embedded modes
+ Oct 08 2004 Fixed bug wrong mode "embedded" for links
+ Added embedded modes for embed and embedvar (for cascaded embeds)
+ Added <p> tags around falsely embedded pars and vars
+ Dec 08 2004 #i38483#, fixed wrong handling of web links
+ #i37377#, fixed missing usage of Database parameter for switching
+ Jan 04 2005 #i38905#, fixed buggy branding replacement template
+ Mar 17 2005 #i43972#, added language info to image URL, evaluate Language parameter
+ evaluate new localize attribute in images
+ May 10 2005 #i48785#, fixed wrong setting of distrib variable
+ Aug 16 2005 workaround for #i53365#
+ Aug 19 2005 fixed missing list processing in embedded sections
+ Aug 19 2005 #i53535#, fixed wrong handling of Database parameter
+ Oct 17 2006 #i70462#, disabled sorting to avoid output of error messages to console
+ Jun 15 2009 #i101799#, fixed wrong handling of http URLs with anchors
+***********************************************************************//-->
+
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ Copyright 2000, 2010 Oracle and/or its affiliates.
+
+ 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.
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output indent="yes" method="html"/>
+
+<!--
+############################
+# Variables and Parameters #
+############################
+//-->
+
+<!-- General Usage -->
+<xsl:variable name="am" select="'&amp;'"/>
+<xsl:variable name="sl" select="'/'"/>
+<xsl:variable name="qt" select="'&quot;'"/>
+
+<!-- generic Icon alt text -->
+<xsl:variable name="alttext" select="'text/shared/00/icon_alt.xhp'"/>
+
+<!-- For calculating pixel sizes -->
+<xsl:variable name="dpi" select="'96'"/>
+<xsl:variable name="dpcm" select="'38'"/>
+
+<!-- Product brand variables used in the help files -->
+<xsl:variable name="brand1" select="'$[officename]'"/>
+<xsl:variable name="brand2" select="'$[officeversion]'"/>
+<xsl:variable name="brand3" select="'%PRODUCTNAME'"/>
+<xsl:variable name="brand4" select="'%PRODUCTVERSION'"/>
+
+<!-- meta data variables from the help file -->
+<xsl:variable name="filename" select="/helpdocument/meta/topic/filename"/>
+<xsl:variable name="topic_id" select="/helpdocument/meta/topic/@id"/>
+<xsl:variable name="topic_status" select="/helpdocument/meta/topic/@status"/>
+<xsl:variable name="title" select="/helpdocument/meta/topic/title"/>
+<xsl:variable name="doclang" select="/helpdocument/meta/topic/title/@xml-lang"/>
+
+<!-- Module and the corresponding switching values-->
+<xsl:param name="Database" select="'swriter'"/>
+<xsl:variable name="module" select="$Database"/>
+<xsl:variable name="appl">
+ <xsl:choose>
+ <xsl:when test="$module = 'swriter'"><xsl:value-of select="'WRITER'"/></xsl:when>
+ <xsl:when test="$module = 'scalc'"><xsl:value-of select="'CALC'"/></xsl:when>
+ <xsl:when test="$module = 'sdraw'"><xsl:value-of select="'DRAW'"/></xsl:when>
+ <xsl:when test="$module = 'simpress'"><xsl:value-of select="'IMPRESS'"/></xsl:when>
+ <xsl:when test="$module = 'schart'"><xsl:value-of select="'CHART'"/></xsl:when>
+ <xsl:when test="$module = 'sbasic'"><xsl:value-of select="'BASIC'"/></xsl:when>
+ <xsl:when test="$module = 'smath'"><xsl:value-of select="'MATH'"/></xsl:when>
+ </xsl:choose>
+</xsl:variable>
+
+ <!-- the other parameters given by the help caller -->
+<xsl:param name="System" select="'WIN'"/>
+<xsl:param name="productname" select="'Office'"/>
+<xsl:param name="productversion" select="''"/>
+<xsl:variable name="pversion">
+ <xsl:value-of select="translate($productversion,' ','')"/>
+</xsl:variable>
+<!-- this is were the images are -->
+<xsl:param name="imgrepos" select="''"/>
+<xsl:param name="Id" />
+<!-- (lame) distinction between OS and Commercial -->
+<xsl:param name="distrib">
+ <xsl:choose>
+ <xsl:when test="starts-with($productname,'OpenOffice')">
+ <xsl:value-of select="'OpenSource'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'COMMERCIAL'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:param>
+<xsl:param name="Language" select="'en-US'"/>
+<xsl:variable name="lang" select="$Language"/>
+
+<xsl:param name="ExtensionId" select="''"/>
+<xsl:param name="ExtensionPath" select="''"/>
+
+
+ <!-- parts of help and image urls -->
+<xsl:variable name="help_url_prefix" select="'vnd.sun.star.help://'"/>
+<xsl:variable name="img_url_prefix" select="concat('vnd.sun.star.zip://',$imgrepos,'/')"/>
+<xsl:variable name="urlpost" select="concat('?Language=',$lang,$am,'System=',$System,$am,'UseDB=no')"/>
+<xsl:variable name="urlpre" select="$help_url_prefix" />
+<xsl:variable name="linkprefix" select="$urlpre"/>
+<xsl:variable name="linkpostfix" select="$urlpost"/>
+
+<xsl:variable name="css" select="'default.css'"/>
+
+<!-- images for notes, tips and warnings -->
+<xsl:variable name="note_img" select="concat($img_url_prefix,'res/helpimg/note.png')"/>
+<xsl:variable name="tip_img" select="concat($img_url_prefix,'res/helpimg/tip.png')"/>
+<xsl:variable name="warning_img" select="concat($img_url_prefix,'res/helpimg/warning.png')"/>
+
+<!--
+#############
+# Templates #
+#############
+//-->
+
+<!-- Create the document skeleton -->
+<xsl:template match="/">
+ <xsl:variable name="csslink" select="concat($urlpre,'/',$urlpost)"/>
+ <html>
+ <head>
+ <title><xsl:value-of select="$title"/></title>
+ <link href="{$csslink}" rel="Stylesheet" type="text/css" /> <!-- stylesheet link -->
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
+ </head>
+ <body lang="{$lang}">
+ <xsl:apply-templates select="/helpdocument/body"/>
+ </body>
+ </html>
+</xsl:template>
+
+<!-- AHELP -->
+<xsl:template match="ahelp">
+ <xsl:if test="not(@visibility='hidden')"><span class="avis"><xsl:apply-templates /></span></xsl:if>
+</xsl:template>
+
+<!-- ALT -->
+<xsl:template match="alt"/>
+
+<!-- BOOKMARK -->
+<xsl:template match="bookmark">
+ <a name="{@id}"></a>
+ <xsl:choose>
+ <xsl:when test="starts-with(@branch,'hid')" />
+ <xsl:otherwise><xsl:apply-templates /></xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+<xsl:template match="bookmark" mode="embedded" />
+
+<!-- BOOKMARK_VALUE -->
+<xsl:template match="bookmark_value" />
+
+<!-- BR -->
+<xsl:template match="br"><br /></xsl:template>
+
+<!-- CAPTION -->
+<xsl:template match="caption" />
+
+<!-- CASE -->
+<xsl:template match="case"><xsl:call-template name="insertcase" /></xsl:template>
+<xsl:template match="case" mode="embedded">
+ <xsl:call-template name="insertcase">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- CASEINLINE -->
+<xsl:template match="caseinline"><xsl:call-template name="insertcase" /></xsl:template>
+<xsl:template match="caseinline" mode="embedded">
+ <xsl:call-template name="insertcase">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- COMMENT -->
+<xsl:template match="comment" />
+<xsl:template match="comment" mode="embedded"/>
+
+<!-- CREATED -->
+<xsl:template match="created" />
+
+<!-- DEFAULT -->
+<xsl:template match="default"><xsl:call-template name="insertdefault" /></xsl:template>
+<xsl:template match="default" mode="embedded">
+ <xsl:call-template name="insertdefault">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- DEFAULTINLINE -->
+<xsl:template match="defaultinline"><xsl:call-template name="insertdefault" /></xsl:template>
+<xsl:template match="defaultinline" mode="embedded">
+ <xsl:call-template name="insertdefault">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- EMBED -->
+<xsl:template match="embed"><xsl:call-template name="resolveembed"/></xsl:template>
+<xsl:template match="embed" mode="embedded"><xsl:call-template name="resolveembed"/></xsl:template>
+
+<!-- EMBEDVAR -->
+<xsl:template match="embedvar"><xsl:call-template name="resolveembedvar"/></xsl:template>
+<xsl:template match="embedvar" mode="embedded"><xsl:call-template name="resolveembedvar"/></xsl:template>
+
+<!-- EMPH -->
+<xsl:template match="emph">
+ <span class="emph"><xsl:apply-templates /></span>
+</xsl:template>
+<xsl:template match="emph" mode="embedded">
+ <span class="emph"><xsl:apply-templates /></span>
+</xsl:template>
+
+<!-- FILENAME -->
+<xsl:template match="filename" />
+
+<!-- HISTORY -->
+<xsl:template match="history" />
+
+<!-- IMAGE -->
+<xsl:template match="image"><xsl:call-template name="insertimage"/></xsl:template>
+<xsl:template match="image" mode="embedded"><xsl:call-template name="insertimage"/></xsl:template>
+
+<!-- ITEM -->
+<xsl:template match="item"><span class="{@type}"><xsl:apply-templates /></span></xsl:template>
+<xsl:template match="item" mode="embedded"><span class="{@type}"><xsl:apply-templates /></span></xsl:template>
+
+<!-- LASTEDITED -->
+<xsl:template match="lastedited" />
+
+<!-- LINK -->
+<xsl:template match="link">
+ <xsl:choose> <!-- don't insert the heading link to itself -->
+ <xsl:when test="(concat('/',@href) = /helpdocument/meta/topic/filename) or (@href = /helpdocument/meta/topic/filename)">
+ <xsl:apply-templates />
+ </xsl:when>
+ <xsl:when test="contains(child::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+ <xsl:call-template name="insert_howtoget">
+ <xsl:with-param name="linkhref" select="@href"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="createlink" />
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+<xsl:template match="link" mode="embedded">
+ <xsl:call-template name="createlink"/>
+</xsl:template>
+
+<!-- LIST -->
+<xsl:template match="list">
+ <xsl:choose>
+ <xsl:when test="@type='ordered'">
+ <ol>
+ <xsl:if test="@startwith">
+ <xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates />
+ </ol>
+ </xsl:when>
+ <xsl:otherwise>
+ <ul><xsl:apply-templates /></ul>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="list" mode="embedded">
+ <xsl:choose>
+ <xsl:when test="@type='ordered'">
+ <ol>
+ <xsl:if test="@startwith">
+ <xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="embedded"/>
+ </ol>
+ </xsl:when>
+ <xsl:otherwise>
+ <ul><xsl:apply-templates mode="embedded"/></ul>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- LISTITEM -->
+<xsl:template match="listitem">
+ <li><xsl:apply-templates /></li>
+</xsl:template>
+
+<xsl:template match="listitem" mode="embedded">
+ <li><xsl:apply-templates mode="embedded"/></li>
+</xsl:template>
+
+<!-- META, SEE HEADER -->
+<xsl:template match="meta" />
+
+<!-- OBJECT (UNUSED) -->
+<xsl:template match="object" />
+
+<!-- PARAGRAPH -->
+<xsl:template match="paragraph">
+ <xsl:choose>
+
+ <xsl:when test="@role='heading'">
+ <xsl:call-template name="insertheading">
+ <xsl:with-param name="level" select="@level"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(' note warning tip ',@role)">
+ <xsl:call-template name="insertnote">
+ <xsl:with-param name="type" select="@role" />
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+ <xsl:apply-templates />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:call-template name="insertpara" />
+ </xsl:otherwise>
+
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="paragraph" mode="embedded">
+ <xsl:choose>
+
+ <xsl:when test="@role='heading'"> <!-- increase the level of headings that are embedded -->
+ <!--
+ The internal sablotron processor does not seem to support the number function.
+ Therefore, we need a workaround for
+ <xsl:variable name="level"><xsl:value-of select="number(@level)+1"/></xsl:variable>
+ -->
+ <xsl:variable name="newlevel">
+ <xsl:choose>
+ <xsl:when test="@level='1'"><xsl:value-of select="'2'"/></xsl:when>
+ <xsl:when test="@level='2'"><xsl:value-of select="'2'"/></xsl:when>
+ <xsl:when test="@level='3'"><xsl:value-of select="'3'"/></xsl:when>
+ <xsl:when test="@level='4'"><xsl:value-of select="'4'"/></xsl:when>
+ <xsl:when test="@level='5'"><xsl:value-of select="'5'"/></xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="insertheading">
+ <xsl:with-param name="level" select="$newlevel"/>
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(' note warning tip ',@role)">
+ <xsl:call-template name="insertnote">
+ <xsl:with-param name="type" select="@role" />
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+ <xsl:apply-templates />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:call-template name="insertpara" />
+ </xsl:otherwise>
+
+ </xsl:choose>
+</xsl:template>
+
+
+<!-- SECTION -->
+<xsl:template match="section">
+ <a name="{@id}"></a>
+
+ <xsl:choose>
+
+ <xsl:when test="@id='relatedtopics'">
+ <div class="relatedtopics">
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <p class="related">
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]"/>
+ </p>
+ <div class="relatedbody">
+ <xsl:apply-templates />
+ </div>
+ </div>
+ </xsl:when>
+
+ <xsl:when test="@id='howtoget'">
+ <xsl:call-template name="insert_howtoget" />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+
+ </xsl:choose>
+
+</xsl:template>
+
+
+<!-- SECTION -->
+<xsl:template match="section" mode="embedded">
+ <a name="{@id}"></a>
+ <xsl:apply-templates mode="embedded"/>
+</xsl:template>
+
+<!-- SORT -->
+<xsl:template match="sort" >
+ <!-- sorting disabled due to #i70462#
+ <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+ //-->
+ <xsl:apply-templates />
+</xsl:template>
+<xsl:template match="sort" mode="embedded">
+<!-- sorting disabled due to #i70462#
+ <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+ //-->
+ <xsl:apply-templates />
+</xsl:template>
+
+<!-- SWITCH -->
+<xsl:template match="switch"><xsl:apply-templates /></xsl:template>
+<xsl:template match="switch" mode="embedded"><xsl:apply-templates /></xsl:template>
+
+<!-- SWITCHINLINE -->
+<xsl:template match="switchinline"><xsl:apply-templates /></xsl:template>
+<xsl:template match="switchinline" mode="embedded"><xsl:apply-templates mode="embedded"/></xsl:template>
+
+<!-- TABLE -->
+<xsl:template match="table"><xsl:call-template name="inserttable"/></xsl:template>
+<xsl:template match="table" mode="embedded"><xsl:call-template name="inserttable"/></xsl:template>
+
+<!-- TABLECELL -->
+<xsl:template match="tablecell"><td valign="top"><xsl:apply-templates /></td></xsl:template>
+<xsl:template match="tablecell" mode="icontable"><td valign="top"><xsl:apply-templates/></td></xsl:template>
+<xsl:template match="tablecell" mode="embedded"><td valign="top"><xsl:apply-templates mode="embedded"/></td></xsl:template>
+
+<!-- TABLEROW -->
+<xsl:template match="tablerow"><tr><xsl:apply-templates /></tr></xsl:template>
+<xsl:template match="tablerow" mode="icontable"><tr><xsl:apply-templates mode="icontable"/></tr></xsl:template>
+<xsl:template match="tablerow" mode="embedded"><tr><xsl:apply-templates mode="embedded"/></tr></xsl:template>
+
+<!-- TITLE -->
+<xsl:template match="title"/>
+
+<!-- TOPIC -->
+<xsl:template match="topic"/>
+
+<!-- VARIABLE -->
+<xsl:template match="variable"><a name="{@id}"></a><xsl:apply-templates /></xsl:template>
+<xsl:template match="variable" mode="embedded"><a name="{@id}"></a><xsl:apply-templates mode="embedded"/></xsl:template>
+
+<xsl:template match="text()">
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="text()" mode="embedded">
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- In case of missing help files -->
+<xsl:template match="help-id-missing"><xsl:value-of select="$Id"/></xsl:template>
+
+<!--
+###################
+# NAMED TEMPLATES #
+###################
+//-->
+
+<!-- Branding -->
+<xsl:template name="brand" >
+ <xsl:param name="string"/>
+
+ <xsl:choose>
+
+ <xsl:when test="contains($string,$brand1)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand1)"/>
+ <xsl:value-of select="$productname"/>
+ <xsl:value-of select="substring-after($string,$brand1)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand2)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand2)"/>
+ <xsl:value-of select="$pversion"/>
+ <xsl:value-of select="substring-after($string,$brand2)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand3)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand3)"/>
+ <xsl:value-of select="$productname"/>
+ <xsl:value-of select="substring-after($string,$brand3)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand4)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand4)"/>
+ <xsl:value-of select="$pversion"/>
+ <xsl:value-of select="substring-after($string,$brand4)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+</xsl:template>
+
+
+<!-- Insert Paragraph -->
+<xsl:template name="insertpara">
+ <xsl:variable name="role">
+ <xsl:choose>
+ <xsl:when test="ancestor::table">
+ <xsl:value-of select="concat(@role,'intable')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@role"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <p class="{$role}"><xsl:apply-templates /></p>
+</xsl:template>
+
+<!-- Insert "How to get Link" -->
+<xsl:template name="insert_howtoget">
+ <xsl:param name="linkhref" />
+ <xsl:variable name="archive" select="'shared'"/>
+ <xsl:variable name="tmp_href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
+ <xsl:variable name="tmp_doc" select="document($tmp_href)"/>
+ <table class="howtoget" width="100%" border="1" cellpadding="3" cellspacing="0">
+ <tr>
+ <td>
+ <p class="howtogetheader"><xsl:apply-templates select="$tmp_doc//variable[@id='wie']"/></p>
+ <div class="howtogetbody">
+ <xsl:choose>
+ <xsl:when test="$linkhref = ''"> <!-- new style -->
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise> <!-- old style -->
+ <xsl:variable name="archive1"><xsl:value-of select="concat(substring-before(substring-after($linkhref,'text/'),'/'),'/')"/></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive1,substring-before($linkhref,'#'),$urlpost)"/></xsl:variable>
+ <xsl:variable name="anc"><xsl:value-of select="substring-after($linkhref,'#')"/></xsl:variable>
+ <xsl:variable name="docum" select="document($href)"/>
+
+ <xsl:call-template name="insertembed">
+ <xsl:with-param name="doc" select="$docum" />
+ <xsl:with-param name="anchor" select="$anc" />
+ </xsl:call-template>
+
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <br/>
+</xsl:template>
+
+<!-- Create a link -->
+<xsl:template name="createlink">
+<xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+<xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with(@href,'http://')"> <!-- web links -->
+ <a href="{@href}"><xsl:apply-templates /></a>
+ </xsl:when>
+ <xsl:when test="contains(@href,'#')">
+ <xsl:variable name="anchor"><xsl:value-of select="concat('#',substring-after(@href,'#'))"/></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,substring-before(@href,'#'),$linkpostfix,$dbpostfix,$anchor)"/></xsl:variable>
+ <a href="{$href}"><xsl:apply-templates /></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,@href,$linkpostfix,$dbpostfix)"/></xsl:variable>
+ <a href="{$href}"><xsl:apply-templates /></a>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- Insert Note, Warning, or Tip -->
+<xsl:template name="insertnote">
+ <xsl:param name="type" /> <!-- note, tip, or warning -->
+ <xsl:variable name="imgsrc">
+ <xsl:choose>
+ <xsl:when test="$type='note'"><xsl:value-of select="$note_img"/></xsl:when>
+ <xsl:when test="$type='tip'"><xsl:value-of select="$tip_img"/></xsl:when>
+ <xsl:when test="$type='warning'"><xsl:value-of select="$warning_img"/></xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="'shared'"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="alt">
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/',$alttext,$urlpost,$dbpostfix)"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="concat('alt_',$type)"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </xsl:variable>
+ <div class="{$type}">
+ <table border="0" class="{$type}" cellspacing="0" cellpadding="5">
+ <tr>
+ <td><img src="{$imgsrc}" alt="{$alt}" title="{$alt}"/></td>
+ <td><xsl:apply-templates /></td>
+ </tr>
+ </table>
+ </div>
+ <br/>
+</xsl:template>
+
+<!-- Insert a heading -->
+<xsl:template name="insertheading">
+ <xsl:param name="level" />
+ <xsl:param name="embedded" />
+ <xsl:text disable-output-escaping="yes">&lt;h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text disable-output-escaping="yes">&lt;/h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+</xsl:template>
+
+<!-- Evaluate a case or caseinline switch -->
+<xsl:template name="insertcase">
+ <xsl:param name="embedded" />
+ <xsl:choose>
+ <xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
+ <xsl:if test="@select = $System">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
+ <xsl:if test="@select = $appl">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
+ <xsl:if test="@select = $distrib">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<!-- Evaluate a default or defaultinline switch -->
+<xsl:template name="insertdefault">
+ <xsl:param name="embedded" />
+
+ <xsl:choose>
+ <xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
+ <xsl:if test="not(../child::case[@select=$System]) and not(../child::caseinline[@select=$System])">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
+ <xsl:if test="not(../child::case[@select=$appl]) and not(../child::caseinline[@select=$appl])">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
+ <xsl:if test="not(../child::case[@select=$distrib]) and not(../child::caseinline[@select=$distrib])">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<!-- evaluate embeds -->
+<xsl:template name="insertembed">
+ <xsl:param name="doc" />
+ <xsl:param name="anchor" />
+ <!-- different embed targets (also falsely used embed instead embedvar) -->
+ <xsl:choose>
+ <xsl:when test="$doc//section[@id=$anchor]"> <!-- first test for a section of that name -->
+ <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
+ </xsl:when>
+ <xsl:when test="$doc//paragraph[@id=$anchor]"> <!-- then test for a para of that name -->
+ <p class="embedded">
+ <xsl:apply-templates select="$doc//paragraph[@id=$anchor]" mode="embedded"/>
+ </p>
+ </xsl:when>
+ <xsl:when test="$doc//variable[@id=$anchor]"> <!-- then test for a variable of that name -->
+ <p class="embedded">
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </p>
+ </xsl:when>
+ <xsl:otherwise> <!-- then give up -->
+ <p class="bug">D'oh! You found a bug (<xsl:value-of select="@href"/> not found).</p>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- Insert an image -->
+<xsl:template name="insertimage">
+
+ <xsl:variable name="fpath">
+ <xsl:call-template name="getfpath">
+ <xsl:with-param name="s"><xsl:value-of select="@src"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="fname">
+ <xsl:call-template name="getfname">
+ <xsl:with-param name="s"><xsl:value-of select="@src"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="src">
+ <xsl:choose>
+ <xsl:when test="not($ExtensionId='') and starts-with(@src,$ExtensionId)">
+ <xsl:value-of select="concat($ExtensionPath,'/',@src)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="(@localize='true') and not($lang='en-US')">
+ <xsl:value-of select="concat($img_url_prefix,$fpath,$lang,'/',$fname)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($img_url_prefix,$fpath,$fname)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!--<xsl:variable name="src"><xsl:value-of select="concat($img_url_prefix,@src)"/></xsl:variable>-->
+ <xsl:variable name="alt"><xsl:value-of select="./alt"/></xsl:variable>
+ <xsl:variable name="width" select="''"/> <!-- Images don't all have the correct size -->
+ <xsl:variable name="height" select="''"/><!-- Image don't all have the correct size -->
+ <img src="{$src}" alt="{$alt}" title="{$alt}">
+ <xsl:if test="not($width='')"><xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute></xsl:if>
+ <xsl:if test="not($height='')"><xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute></xsl:if>
+ </img>
+</xsl:template>
+
+<!-- Insert a Table -->
+<xsl:template name="inserttable">
+ <xsl:variable name="imgsrc"> <!-- see if we are in an image table -->
+ <xsl:value-of select="tablerow/tablecell[1]/paragraph[1]/image/@src"/>
+ </xsl:variable>
+
+ <xsl:choose>
+
+ <xsl:when test="count(descendant::tablecell)=1">
+ <table border="0" class="onecell" cellpadding="0" cellspacing="0">
+ <xsl:apply-templates />
+ </table>
+ </xsl:when>
+
+ <xsl:when test="descendant::tablecell[1]/descendant::image">
+ <table border="0" class="icontable" cellpadding="5" cellspacing="0">
+ <xsl:apply-templates mode="icontable"/>
+ </table>
+ </xsl:when>
+
+ <xsl:when test="@class='wide'">
+ <table border="1" class="{@class}" cellpadding="0" cellspacing="0" width="100%" >
+ <xsl:apply-templates />
+ </table>
+ </xsl:when>
+
+ <xsl:when test="not(@class='')">
+ <table border="1" class="{@class}" cellpadding="0" cellspacing="0" >
+ <xsl:apply-templates />
+ </table>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <table border="1" class="border" cellpadding="0" cellspacing="0" >
+ <xsl:apply-templates />
+ </table>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <br/>
+</xsl:template>
+
+<xsl:template name="resolveembed">
+ <div class="embedded">
+ <xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+ <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
+ <xsl:variable name="anc"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="docum" select="document($href)"/>
+
+ <xsl:call-template name="insertembed">
+ <xsl:with-param name="doc" select="$docum" />
+ <xsl:with-param name="anchor" select="$anc" />
+ </xsl:call-template>
+
+ </div>
+</xsl:template>
+
+<xsl:template name="resolveembedvar">
+ <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
+ <xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+ <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:choose>
+ <xsl:when test="$doc//variable[@id=$anchor]"> <!-- test for a variable of that name -->
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise> <!-- or give up -->
+ <span class="bug">[<xsl:value-of select="@href"/> not found].</span>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+</xsl:template>
+
+<!-- Apply -->
+<xsl:template name="apply">
+ <xsl:param name="embedded" />
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="getfpath">
+ <xsl:param name="s"/>
+ <xsl:param name="p"/>
+ <xsl:choose>
+ <xsl:when test="contains($s,'/')">
+ <xsl:call-template name="getfpath">
+ <xsl:with-param name="p"><xsl:value-of select="concat($p,substring-before($s,'/'),'/')"/></xsl:with-param>
+ <xsl:with-param name="s"><xsl:value-of select="substring-after($s,'/')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$p"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="getfname">
+ <xsl:param name="s"/>
+ <xsl:choose>
+ <xsl:when test="contains($s,'/')">
+ <xsl:call-template name="getfname">
+ <xsl:with-param name="s"><xsl:value-of select="substring-after($s,'/')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$s"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="createDBpostfix">
+ <xsl:param name="archive"/>
+ <xsl:variable name="newDB">
+ <xsl:choose>
+ <xsl:when test="(substring($archive,1,6) = 'shared')"><xsl:value-of select="$Database"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="substring-before($archive,'/')"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat($am,'DbPAR=',$newDB)"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk
index 10206670b5..e060db9efe 100644
--- a/xmlhelp/util/makefile.mk
+++ b/xmlhelp/util/makefile.mk
@@ -74,5 +74,19 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ----------------------------------------------------------
+ZIP1TARGET=helpxsl
+ZIP1FLAGS= -u -r
+#ZIP1DIR=$(PRJ)$/source$/auxiliary
+ZIP1LIST=main_transform*.xsl idxcaption.xsl idxcontent.xsl
+
+
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucpchelp1.component
+
+$(MISC)/ucpchelp1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpchelp1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpchelp1.component
diff --git a/xmlhelp/util/ucpchelp1.component b/xmlhelp/util/ucpchelp1.component
new file mode 100644
index 0000000000..a8bb64124e
--- /dev/null
+++ b/xmlhelp/util/ucpchelp1.component
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="CHelpContentProvider">
+ <service name="com.sun.star.help.XMLHelp"/>
+ <service name="com.sun.star.ucb.HelpContentProvider"/>
+ </implementation>
+</component>
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 6adeb410bc..5fd38a440a 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3107,6 +3107,12 @@ namespace xmloff { namespace token {
XML_N_CHART_EXT,
XML_COORDINATE_REGION,
+ XML_DIAGONAL_BL_TR_WIDTHS,
+ XML_DIAGONAL_TL_BR_WIDTHS,
+
+ XML_OUTSIDE_MINIMUM,//#i114142#
+ XML_OUTSIDE_MAXIMUM,//#i114142#
+
XML_TOKEN_END
};
diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst
index 7784bca047..9bbfe05f3a 100644
--- a/xmloff/prj/d.lst
+++ b/xmloff/prj/d.lst
@@ -116,3 +116,5 @@ mkdir: %_DEST%\inc%_EXT%\xmloff\table
..\inc\xmloff\table\XMLTableImport.hxx %_DEST%\inc%_EXT%\xmloff\table\XMLTableImport.hxx
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
+..\%__SRC%\misc\xo.component %_DEST%\xml%_EXT%\xo.component
+..\%__SRC%\misc\xof.component %_DEST%\xml%_EXT%\xof.component
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index e52ec47c72..373a8dacca 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -223,6 +223,8 @@ SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] =
{ ::xmloff::token::XML_NEAR_AXIS_OTHER_SIDE, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE },
{ ::xmloff::token::XML_OUTSIDE_START, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START },
{ ::xmloff::token::XML_OUTSIDE_END, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END },
+ { ::xmloff::token::XML_OUTSIDE_MINIMUM, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START },//#i114142#
+ { ::xmloff::token::XML_OUTSIDE_MAXIMUM, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END },//#i114142#
{ ::xmloff::token::XML_TOKEN_INVALID, 0 }
};
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 6d897c5e0f..7533422300 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1688,20 +1688,16 @@ void SchXMLExportHelper_Impl::exportTable()
{
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
- // write the original range name as id into the local table
- // to allow a correct re-association when copying via clipboard
+ exportText( *aIt );
+ if( nC < nComplexCount )
+ lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport );
if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd )
{
+ // remind the original range to allow a correct re-association when copying via clipboard
if ((*aColumnDescriptions_RangeIter).getLength())
- {
- mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
- *aColumnDescriptions_RangeIter);
- }
+ SchXMLTools::exportRangeToSomewhere( mrExport, *aColumnDescriptions_RangeIter );
++aColumnDescriptions_RangeIter;
}
- exportText( *aIt );
- if( nC < nComplexCount )
- lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport );
}
OSL_ASSERT( bHasOwnData || aColumnDescriptions_RangeIter == aColumnDescriptions_RangeEnd );
} // closing row and header-rows elements
@@ -1725,17 +1721,15 @@ void SchXMLExportHelper_Impl::exportTable()
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
if( aRowDescriptionsIter != aData.aRowDescriptions.end())
{
- // write the original range name as id into the local table
- // to allow a correct re-association when copying via clipboard
- if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
- {
- mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
- *aRowDescriptions_RangeIter++);
- }
exportText( *aRowDescriptionsIter );
++aRowDescriptionsIter;
if( nC < nComplexCount )
lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport );
+ if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
+ {
+ // remind the original range to allow a correct re-association when copying via clipboard
+ SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ );
+ }
}
}
@@ -1748,19 +1742,15 @@ void SchXMLExportHelper_Impl::exportTable()
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT );
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString );
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
- // write the original range name as id into the local table to
- // allow a correct re-association when copying via clipboard
+ exportText( msString, false ); // do not convert tabs and lfs
if( ( !bHasOwnData && aDataRangeIter != aDataRangeEndIter ) &&
- ( mbRowSourceColumns || (aColIt == aRowIt->begin())) )
+ ( mbRowSourceColumns || (aColIt == aRowIt->begin()) ) )
{
+ // remind the original range to allow a correct re-association when copying via clipboard
if ((*aDataRangeIter).getLength())
- {
- mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
- *aDataRangeIter);
- }
+ SchXMLTools::exportRangeToSomewhere( mrExport, *aDataRangeIter );
++aDataRangeIter;
}
- exportText( msString, false ); // do not convert tabs and lfs
}
}
}
@@ -3063,6 +3053,10 @@ void SchXMLExportHelper_Impl::exportSeries(
{
// add style name attribute
AddAutoStyleAttribute( aPropertyStates );
+
+ const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() );
+ if( nCurrentVersion >= SvtSaveOptions::ODFVER_012 )
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y );//#i114149#
SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_ERROR_INDICATOR, sal_True, sal_True );
}
else // autostyles
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 8c12781980..4d6f69a84e 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -34,6 +34,7 @@
#include "SchXMLImport.hxx"
#include "SchXMLTools.hxx"
#include "transporttypes.hxx"
+#include "XMLStringBufferImportContext.hxx"
#include <tools/debug.hxx>
#include <rtl/math.hxx>
#include "xmlnmspe.hxx"
@@ -687,6 +688,35 @@ SvXMLImportContext* SchXMLTableRowContext::CreateChildContext(
return pContext;
}
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+class SchXMLRangeSomewhereContext : public SvXMLImportContext
+{
+//#i113950# previously the range was exported to attribute text:id,
+//but that attribute does not allow arbitrary strings anymore
+//so we need to find an alternative to save that range info for copy/paste scenario ...
+//-> use description at an empty group element for now
+
+private:
+ ::rtl::OUString& mrRangeString;
+ ::rtl::OUStringBuffer maRangeStringBuffer;
+
+public:
+ SchXMLRangeSomewhereContext( SvXMLImport& rImport,
+ const ::rtl::OUString& rLocalName,
+ ::rtl::OUString& rRangeString );
+ virtual ~SchXMLRangeSomewhereContext();
+
+ virtual SvXMLImportContext* CreateChildContext(
+ USHORT nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
+ virtual void EndElement();
+};
+
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
// ========================================
// classes for cells and their content
@@ -778,11 +808,18 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
pContext = new SchXMLTextListContext( GetImport(), rLocalName, *rCell.pComplexString );
mbReadText = sal_False;//don't apply text from <text:p>
}
- // <text:p> element - read text and range-id
+ // <text:p> element - read text (and range from text:id old version)
else if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) )
{
pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent, &maRangeId );
}
+ // <draw:g> element - read range
+ else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_G ) )
+ {
+ //#i113950# previously the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore
+ //so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now
+ pContext = new SchXMLRangeSomewhereContext( GetImport(), rLocalName, maRangeId );
+ }
else
{
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
@@ -1148,3 +1185,34 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
}
}
+//---------------------------------------------------------------------------------------------------
+
+SchXMLRangeSomewhereContext::SchXMLRangeSomewhereContext( SvXMLImport& rImport,
+ const OUString& rLocalName,
+ OUString& rRangeString ) :
+ SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ),
+ mrRangeString( rRangeString )
+{
+}
+
+SchXMLRangeSomewhereContext::~SchXMLRangeSomewhereContext()
+{
+}
+
+SvXMLImportContext* SchXMLRangeSomewhereContext::CreateChildContext(
+ USHORT nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList >& )
+{
+ if( XML_NAMESPACE_SVG == nPrefix && IsXMLToken( rLocalName, XML_DESC ) )
+ {
+ return new XMLStringBufferImportContext(
+ GetImport(), nPrefix, rLocalName, maRangeStringBuffer );
+ }
+ return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+}
+
+void SchXMLRangeSomewhereContext::EndElement()
+{
+ mrRangeString = maRangeStringBuffer.makeStringAndClear();
+}
diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx
index dd477e67d9..cba15dfd44 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -600,6 +600,29 @@ void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsL
}
}
+void exportRangeToSomewhere( SvXMLExport& rExport, const ::rtl::OUString& rValue )
+{
+ //with issue #i366# and CWS chart20 ranges for error bars were introduced
+ //to keep them during copy paste from calc to impress for example it
+ //was necessary to introduce a mapping between the used ranges within calc and the data written to the local table
+ //this is why we write this ranges here
+
+ //#i113950# first the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore within ODF 1.2
+ //as an alternative the range info is now saved into the description at an empty group element (not very nice, but ODF conform)
+
+ const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
+ if( nCurrentODFVersion == SvtSaveOptions::ODFVER_010 || nCurrentODFVersion == SvtSaveOptions::ODFVER_011 )
+ return;//svg:desc is not allowed at draw:g in ODF1.0; but as the ranges for error bars are anyhow not allowed within ODF1.0 nor ODF1.1 we do not need the information
+
+ SvXMLElementExport aEmptyShapeGroup( rExport, XML_NAMESPACE_DRAW,
+ ::xmloff::token::GetXMLToken( ::xmloff::token::XML_G ),
+ sal_True, sal_False );
+ SvXMLElementExport aDescription( rExport, XML_NAMESPACE_SVG,
+ ::xmloff::token::GetXMLToken( ::xmloff::token::XML_DESC ),
+ sal_True, sal_False );
+ rExport.GetDocHandler()->characters( rValue );
+}
+
Reference< chart2::XRegressionCurve > getRegressionCurve(
const Reference< chart2::XDataSeries > & xDataSeries )
{
diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx
index 176618d002..52a17b31ba 100644
--- a/xmloff/source/chart/SchXMLTools.hxx
+++ b/xmloff/source/chart/SchXMLTools.hxx
@@ -105,6 +105,8 @@ namespace SchXMLTools
void exportText( SvXMLExport& rExport, const ::rtl::OUString& rText, bool bConvertTabsLFs );
+ void exportRangeToSomewhere( SvXMLExport& rExport, const ::rtl::OUString& rValue );
+
/** returns the properties of the equation of the first regression curve
that is no mean-value line
*/
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index c20a6ff98c..826379026e 100644
--- a/xmloff/source/core/facreg.cxx
+++ b/xmloff/source/core/facreg.cxx
@@ -167,117 +167,6 @@ XMLOFF_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-void SAL_CALL writeInfo( registry::XRegistryKey * pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices )
-{
- uno::Reference< registry::XRegistryKey > xNewKey(
- pRegistryKey->createKey(
- OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) );
-
- for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
- xNewKey->createKey( rServices.getConstArray()[i]);
-}
-
-#define WRITEINFO(className)\
- writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() )
-
-XMLOFF_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey )
-{
- if( pRegistryKey )
- {
- try
- {
- registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey );
-
- // impress oasis import
- WRITEINFO( XMLImpressImportOasis );
- WRITEINFO( XMLImpressStylesImportOasis );
- WRITEINFO( XMLImpressContentImportOasis );
- WRITEINFO( XMLImpressMetaImportOasis );
- WRITEINFO( XMLImpressSettingsImportOasis );
-
- // impress oasis export
- WRITEINFO( XMLImpressExportOasis );
- WRITEINFO( XMLImpressStylesExportOasis );
- WRITEINFO( XMLImpressContentExportOasis );
- WRITEINFO( XMLImpressMetaExportOasis );
- WRITEINFO( XMLImpressSettingsExportOasis );
-
- // animation import
- WRITEINFO( AnimationsImport );
-
- // impress OOo export
- WRITEINFO( XMLImpressExportOOO );
- WRITEINFO( XMLImpressStylesExportOOO );
- WRITEINFO( XMLImpressContentExportOOO );
- WRITEINFO( XMLImpressMetaExportOOO );
- WRITEINFO( XMLImpressSettingsExportOOO );
-
- // draw oasis import
- WRITEINFO( XMLDrawImportOasis );
- WRITEINFO( XMLDrawStylesImportOasis );
- WRITEINFO( XMLDrawContentImportOasis );
- WRITEINFO( XMLDrawMetaImportOasis );
- WRITEINFO( XMLDrawSettingsImportOasis );
-
- // draw oasis export
- WRITEINFO( XMLDrawExportOasis );
- WRITEINFO( XMLDrawStylesExportOasis );
- WRITEINFO( XMLDrawContentExportOasis );
- WRITEINFO( XMLDrawMetaExportOasis );
- WRITEINFO( XMLDrawSettingsExportOasis );
-
- // draw OOo export
- WRITEINFO( XMLDrawExportOOO );
- WRITEINFO( XMLDrawStylesExportOOO );
- WRITEINFO( XMLDrawContentExportOOO );
- WRITEINFO( XMLDrawMetaExportOOO );
- WRITEINFO( XMLDrawSettingsExportOOO );
-
- // drawing layer export
- WRITEINFO( XMLDrawingLayerExport );
-
- // impress xml clipboard export
- WRITEINFO( XMLImpressClipboardExport );
-
- // chart oasis import
- WRITEINFO( SchXMLImport );
- WRITEINFO( SchXMLImport_Meta );
- WRITEINFO( SchXMLImport_Styles );
- WRITEINFO( SchXMLImport_Content );
-
- // chart oasis export
- WRITEINFO( SchXMLExport_Oasis );
- WRITEINFO( SchXMLExport_Oasis_Meta );
- WRITEINFO( SchXMLExport_Oasis_Styles );
- WRITEINFO( SchXMLExport_Oasis_Content );
-
- // chart OOo export
- WRITEINFO( SchXMLExport );
- WRITEINFO( SchXMLExport_Styles );
- WRITEINFO( SchXMLExport_Content );
-
- // meta
- WRITEINFO( XMLMetaImportComponent );
- WRITEINFO( XMLMetaExportComponent );
-
- WRITEINFO( XMLVersionListPersistence );
-
- // meta OOo
- WRITEINFO( XMLMetaExportOOO );
-
- // writer auto text events
- WRITEINFO( XMLAutoTextEventExport );
- WRITEINFO( XMLAutoTextEventImport );
- WRITEINFO( XMLAutoTextEventExportOOO );
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_True;
-}
-
#define SINGLEFACTORY(classname)\
if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
{\
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 7dc3bc32f4..25550b1a79 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3082,8 +3082,8 @@ namespace xmloff { namespace token {
TOKEN( "axis-label-position", XML_AXIS_LABEL_POSITION ),
TOKEN( "near-axis", XML_NEAR_AXIS ),
TOKEN( "near-axis-other-side", XML_NEAR_AXIS_OTHER_SIDE ),
- TOKEN( "outside-minimum", XML_OUTSIDE_START ),
- TOKEN( "outside-maximum", XML_OUTSIDE_END ),
+ TOKEN( "outside-start", XML_OUTSIDE_START ),
+ TOKEN( "outside-end", XML_OUTSIDE_END ),
TOKEN( "tick-mark-position", XML_TICK_MARK_POSITION ),
TOKEN( "at-labels", XML_AT_LABELS ),
TOKEN( "at-axis", XML_AT_AXIS ),
@@ -3107,6 +3107,12 @@ namespace xmloff { namespace token {
TOKEN( "http://openoffice.org/2010/chart", XML_N_CHART_EXT ),
TOKEN( "coordinate-region", XML_COORDINATE_REGION ),
+ TOKEN( "diagonal-bl-tr-widths", XML_DIAGONAL_BL_TR_WIDTHS ),
+ TOKEN( "diagonal-tl-br-widths", XML_DIAGONAL_TL_BR_WIDTHS ),
+
+ TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ),
+ TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ),
+
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index 5d50cbecba..8e8b714970 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -708,6 +708,7 @@ void GetEnhancedPath( std::vector< com::sun::star::beans::PropertyValue >& rDest
case '8' :
case '9' :
case '.' :
+ case '-' :
{
com::sun::star::drawing::EnhancedCustomShapeParameterPair aPair;
if ( GetNextParameter( aPair.First, nIndex, rValue ) &&
@@ -1246,7 +1247,6 @@ void XMLEnhancedCustomShapeContext::EndElement()
{
switch( EASGet( pValues->Name ) )
{
- case EAS_Position :
case EAS_RangeYMinimum :
case EAS_RangeYMaximum :
case EAS_RangeXMinimum :
@@ -1258,6 +1258,8 @@ void XMLEnhancedCustomShapeContext::EndElement()
pValues->Value.getValue()), pH );
}
break;
+
+ case EAS_Position :
case EAS_Polar :
{
CheckAndResolveEquationParameter( (*((com::sun::star::drawing::EnhancedCustomShapeParameterPair*)
diff --git a/xmloff/source/transform/XMLFilterRegistration.cxx b/xmloff/source/transform/XMLFilterRegistration.cxx
index 80098d18e9..c08d030b93 100644
--- a/xmloff/source/transform/XMLFilterRegistration.cxx
+++ b/xmloff/source/transform/XMLFilterRegistration.cxx
@@ -146,39 +146,6 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTyp
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey )
-{
- if( pRegistryKey )
- {
- try
- {
- uno::Reference< registry::XRegistryKey > xMasterKey( reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ) );
-
- const ServiceDescriptor* pDescriptor = getServiceDescriptors();
- while ( pDescriptor->getImplementationName )
- {
- ::rtl::OUString sNewKeyName( RTL_CONSTASCII_USTRINGPARAM("/") );
- sNewKeyName += pDescriptor->getImplementationName();
- sNewKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") );
-
- uno::Reference< registry::XRegistryKey > xNewKey( xMasterKey->createKey( sNewKeyName ) );
-
- uno::Sequence< ::rtl::OUString > aServices = pDescriptor->getSupportedServiceNames();
- const ::rtl::OUString* pServices = aServices.getConstArray();
- for( sal_Int32 i = 0; i < aServices.getLength(); ++i, ++pServices )
- xNewKey->createKey( *pServices);
-
- ++pDescriptor;
- }
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "xof::component_writeInfo: InvalidRegistryException!" );
- }
- }
- return sal_True;
-}
-
void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
void * pRet = NULL;
diff --git a/xmloff/source/transform/makefile.mk b/xmloff/source/transform/makefile.mk
index bba8deb6db..031549fcb3 100644
--- a/xmloff/source/transform/makefile.mk
+++ b/xmloff/source/transform/makefile.mk
@@ -93,3 +93,11 @@ DEF1NAME = $(SHL1TARGET)
SLOFILES = $(SHL1OBJS)
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/xof.component
+
+$(MISC)/xof.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xof.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xof.component
diff --git a/xmloff/source/transform/xof.component b/xmloff/source/transform/xof.component
new file mode 100644
index 0000000000..8f9c88f7fa
--- /dev/null
+++ b/xmloff/source/transform/xof.component
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Calc.XMLContentImporter">
+ <service name="com.sun.star.comp.Calc.XMLContentImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Calc.XMLImporter">
+ <service name="com.sun.star.comp.Calc.XMLImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Calc.XMLMetaImporter">
+ <service name="com.sun.star.comp.Calc.XMLMetaImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Calc.XMLSettingsImporter">
+ <service name="com.sun.star.comp.Calc.XMLSettingsImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Calc.XMLStylesImporter">
+ <service name="com.sun.star.comp.Calc.XMLStylesImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Chart.XMLContentImporter">
+ <service name="com.sun.star.comp.Chart.XMLContentImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Chart.XMLImporter">
+ <service name="com.sun.star.comp.Chart.XMLImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Chart.XMLStylesImporter">
+ <service name="com.sun.star.comp.Chart.XMLStylesImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Draw.XMLContentImporter">
+ <service name="com.sun.star.comp.Draw.XMLContentImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Draw.XMLImporter">
+ <service name="com.sun.star.comp.Draw.XMLImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Draw.XMLMetaImporter">
+ <service name="com.sun.star.comp.Draw.XMLMetaImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Draw.XMLSettingsImporter">
+ <service name="com.sun.star.comp.Draw.XMLSettingsImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Draw.XMLStylesImporter">
+ <service name="com.sun.star.comp.Draw.XMLStylesImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Impress.XMLContentImporter">
+ <service name="com.sun.star.comp.Impress.XMLContentImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Impress.XMLImporter">
+ <service name="com.sun.star.comp.Impress.XMLImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Impress.XMLMetaImporter">
+ <service name="com.sun.star.comp.Impress.XMLMetaImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Impress.XMLSettingsImporter">
+ <service name="com.sun.star.comp.Impress.XMLSettingsImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Impress.XMLStylesImporter">
+ <service name="com.sun.star.comp.Impress.XMLStylesImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Math.XMLMetaImporter">
+ <service name="com.sun.star.comp.Math.XMLMetaImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Math.XMLSettingsImporter">
+ <service name="com.sun.star.comp.Math.XMLSettingsImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.OOo2OasisTransformer">
+ <service name="com.sun.star.comp.OOo2OasisTransformer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Oasis2OOoTransformer">
+ <service name="com.sun.star.comp.Oasis2OOoTransformer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLAutotextEventsImporter">
+ <service name="com.sun.star.comp.Writer.XMLAutotextEventsImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLContentImporter">
+ <service name="com.sun.star.comp.Writer.XMLContentImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLImporter">
+ <service name="com.sun.star.comp.Writer.XMLImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLMetaImporter">
+ <service name="com.sun.star.comp.Writer.XMLMetaImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLSettingsImporter">
+ <service name="com.sun.star.comp.Writer.XMLSettingsImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLStylesImporter">
+ <service name="com.sun.star.comp.Writer.XMLStylesImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.document.XMLMetaImporter">
+ <service name="com.sun.star.document.XMLMetaImporter"/>
+ </implementation>
+</component>
diff --git a/xmloff/util/makefile.mk b/xmloff/util/makefile.mk
index b8745b6b8f..857067985c 100644
--- a/xmloff/util/makefile.mk
+++ b/xmloff/util/makefile.mk
@@ -86,3 +86,11 @@ DEF1DES =XML Office Lib
# --- Targets ----------------------------------------------------------
.ENDIF
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/xo.component
+
+$(MISC)/xo.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xo.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xo.component
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
new file mode 100644
index 0000000000..7fe2119636
--- /dev/null
+++ b/xmloff/util/xo.component
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="SchXMLExport.Compact">
+ <service name="com.sun.star.comp.Chart.XMLExporter"/>
+ </implementation>
+ <implementation name="SchXMLExport.Content">
+ <service name="com.sun.star.comp.Chart.XMLContentExporter"/>
+ </implementation>
+ <implementation name="SchXMLExport.Oasis.Compact">
+ <service name="com.sun.star.comp.Chart.XMLOasisExporter"/>
+ </implementation>
+ <implementation name="SchXMLExport.Oasis.Content">
+ <service name="com.sun.star.comp.Chart.XMLOasisContentExporter"/>
+ </implementation>
+ <implementation name="SchXMLExport.Oasis.Meta">
+ <service name="com.sun.star.comp.Chart.XMLOasisMetaExporter"/>
+ </implementation>
+ <implementation name="SchXMLExport.Oasis.Styles">
+ <service name="com.sun.star.comp.Chart.XMLOasisStylesExporter"/>
+ </implementation>
+ <implementation name="SchXMLExport.Styles">
+ <service name="com.sun.star.comp.Chart.XMLStylesExporter"/>
+ </implementation>
+ <implementation name="SchXMLImport">
+ <service name="com.sun.star.comp.Chart.XMLOasisImporter"/>
+ </implementation>
+ <implementation name="SchXMLImport.Content">
+ <service name="com.sun.star.comp.Chart.XMLOasisContentImporter"/>
+ </implementation>
+ <implementation name="SchXMLImport.Meta">
+ <service name="com.sun.star.comp.Chart.XMLOasisMetaImporter"/>
+ </implementation>
+ <implementation name="SchXMLImport.Styles">
+ <service name="com.sun.star.comp.Chart.XMLOasisStylesImporter"/>
+ </implementation>
+ <implementation name="XMLDrawContentExportOOO">
+ <service name="com.sun.star.comp.Draw.XMLContentExporter"/>
+ </implementation>
+ <implementation name="XMLDrawContentExportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisContentExporter"/>
+ </implementation>
+ <implementation name="XMLDrawExportOOO">
+ <service name="com.sun.star.comp.Draw.XMLExporter"/>
+ </implementation>
+ <implementation name="XMLDrawExportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisExporter"/>
+ </implementation>
+ <implementation name="XMLDrawImportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisImporter"/>
+ </implementation>
+ <implementation name="XMLDrawMetaExportOOO">
+ <service name="com.sun.star.comp.Draw.XMLMetaExporter"/>
+ </implementation>
+ <implementation name="XMLDrawMetaExportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisMetaExporter"/>
+ </implementation>
+ <implementation name="XMLDrawSettingsExportOOO">
+ <service name="com.sun.star.comp.Draw.XMLSettingsExporter"/>
+ </implementation>
+ <implementation name="XMLDrawSettingsExportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisSettingsExporter"/>
+ </implementation>
+ <implementation name="XMLDrawStylesExportOOO">
+ <service name="com.sun.star.comp.Draw.XMLStylesExporter"/>
+ </implementation>
+ <implementation name="XMLDrawStylesExportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisStylesExporter"/>
+ </implementation>
+ <implementation name="XMLDrawingLayerExport">
+ <service name="com.sun.star.comp.DrawingLayer.XMLExporter"/>
+ </implementation>
+ <implementation name="XMLImpressClipboardExport">
+ <service name="com.sun.star.comp.Impress.XMLClipboardExporter"/>
+ </implementation>
+ <implementation name="XMLImpressContentExportOOO">
+ <service name="com.sun.star.comp.Impress.XMLContentExporter"/>
+ </implementation>
+ <implementation name="XMLImpressContentExportOasis">
+ <service name="com.sun.star.comp.Impress.XMLOasisContentExporter"/>
+ </implementation>
+ <implementation name="XMLImpressContentImportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisContentImporter"/>
+ <service name="com.sun.star.comp.Impress.XMLOasisContentImporter"/>
+ </implementation>
+ <implementation name="XMLImpressExportOOO">
+ <service name="com.sun.star.comp.Impress.XMLExporter"/>
+ </implementation>
+ <implementation name="XMLImpressExportOasis">
+ <service name="com.sun.star.comp.Impress.XMLOasisExporter"/>
+ </implementation>
+ <implementation name="XMLImpressImportOasis">
+ <service name="com.sun.star.comp.Impress.XMLOasisImporter"/>
+ </implementation>
+ <implementation name="XMLImpressMetaExportOOO">
+ <service name="com.sun.star.comp.Impress.XMLMetaExporter"/>
+ </implementation>
+ <implementation name="XMLImpressMetaExportOasis">
+ <service name="com.sun.star.comp.Impress.XMLOasisMetaExporter"/>
+ </implementation>
+ <implementation name="XMLImpressMetaImportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisMetaImporter"/>
+ <service name="com.sun.star.comp.Impress.XMLOasisMetaImporter"/>
+ </implementation>
+ <implementation name="XMLImpressSettingsExportOOO">
+ <service name="com.sun.star.comp.Impress.XMLSettingsExporter"/>
+ </implementation>
+ <implementation name="XMLImpressSettingsExportOasis">
+ <service name="com.sun.star.comp.Impress.XMLOasisSettingsExporter"/>
+ </implementation>
+ <implementation name="XMLImpressSettingsImportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisSettingsImporter"/>
+ <service name="com.sun.star.comp.Impress.XMLOasisSettingsImporter"/>
+ </implementation>
+ <implementation name="XMLImpressStylesExportOOO">
+ <service name="com.sun.star.comp.Impress.XMLStylesExporter"/>
+ </implementation>
+ <implementation name="XMLImpressStylesExportOasis">
+ <service name="com.sun.star.comp.Impress.XMLOasisStylesExporter"/>
+ </implementation>
+ <implementation name="XMLImpressStylesImportOasis">
+ <service name="com.sun.star.comp.Draw.XMLOasisStylesImporter"/>
+ <service name="com.sun.star.comp.Impress.XMLOasisStylesImporter"/>
+ </implementation>
+ <implementation name="XMLMetaExportComponent">
+ <service name="com.sun.star.document.XMLOasisMetaExporter"/>
+ </implementation>
+ <implementation name="XMLMetaExportOOo">
+ <service name="com.sun.star.document.XMLMetaExporter"/>
+ </implementation>
+ <implementation name="XMLMetaImportComponent">
+ <service name="com.sun.star.document.XMLOasisMetaImporter"/>
+ </implementation>
+ <implementation name="XMLVersionListPersistence">
+ <service name="com.sun.star.document.DocumentRevisionListPersistence"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.XMLAutotextEventsExporter">
+ <service name="com.sun.star.comp.Writer.XMLAutotextEventsExporter"/>
+ </implementation>
+ <implementation
+ name="com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter">
+ <service name="com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter"/>
+ </implementation>
+ <implementation
+ name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter">
+ <service name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter"/>
+ </implementation>
+ <implementation name="xmloff::AnimationsImport">
+ <service name="com.sun.star.comp.Xmloff.AnimationsImport"/>
+ </implementation>
+</component>
diff --git a/xmlscript/prj/d.lst b/xmlscript/prj/d.lst
index 51b2891e49..2f1ff7e377 100644
--- a/xmlscript/prj/d.lst
+++ b/xmlscript/prj/d.lst
@@ -11,3 +11,4 @@ mkdir: %_DEST%\inc%_EXT%\xmlscript
..\inc\xmlscript\xmlns.h %_DEST%\inc%_EXT%\xmlscript\xmlns.h
..\dtd\*.dtd %_DEST%\bin%_EXT%\*.dtd
+..\%__SRC%\misc\xcr.component %_DEST%\xml%_EXT%\xcr.component
diff --git a/xmlscript/source/misc/unoservices.cxx b/xmlscript/source/misc/unoservices.cxx
index 6209df3751..155fcc2800 100644
--- a/xmlscript/source/misc/unoservices.cxx
+++ b/xmlscript/source/misc/unoservices.cxx
@@ -115,15 +115,6 @@ extern "C"
// -----------------------------------------------------------------------------
- sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
- {
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, ::xmlscript::s_entries );
- }
-
- // -----------------------------------------------------------------------------
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/xmlscript/util/makefile.mk b/xmlscript/util/makefile.mk
index 3ccf63dc3b..ba731470b2 100644
--- a/xmlscript/util/makefile.mk
+++ b/xmlscript/util/makefile.mk
@@ -74,3 +74,11 @@ $(MISC)$/$(SHL1TARGET).flt : makefile.mk xcr.flt
@echo ------------------------------
@echo Making: $@
$(TYPE) xcr.flt > $@
+
+ALLTAR : $(MISC)/xcr.component
+
+$(MISC)/xcr.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xcr.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xcr.component
diff --git a/xmlscript/util/xcr.component b/xmlscript/util/xcr.component
new file mode 100644
index 0000000000..5ffe7f862f
--- /dev/null
+++ b/xmlscript/util/xcr.component
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.xml.input.SaxDocumentHandler">
+ <service name="com.sun.star.xml.input.SaxDocumentHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xmlscript.XMLBasicExporter">
+ <service name="com.sun.star.document.XMLBasicExporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xmlscript.XMLBasicImporter">
+ <service name="com.sun.star.document.XMLBasicImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xmlscript.XMLOasisBasicExporter">
+ <service name="com.sun.star.document.XMLOasisBasicExporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xmlscript.XMLOasisBasicImporter">
+ <service name="com.sun.star.document.XMLOasisBasicImporter"/>
+ </implementation>
+</component>